Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EWPP-4957: Add missing Non-EU Member states to flag options. #1528

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,25 @@ public static function getSubscribedEvents() {
* The event.
*/
public function alterFlagOptions(FlagOptionsEvent $event): void {
$options = $event->getFlagOptions();
$options['albania'] = $this->t('Albania');
$options['bosnia-and-herzegovina'] = $this->t('Bosnia and Herzegovina');
$options['georgia'] = $this->t('Georgia');
$options['iceland'] = $this->t('Iceland');
$options['moldova'] = $this->t('Moldova');
$options['montenegro'] = $this->t('Montenegro');
$options['north-macedonia'] = $this->t('North Macedonia');
$options['norway'] = $this->t('Norway');
$options['serbia'] = $this->t('Serbia');
$options['switzerland'] = $this->t('Switzerland');
$options['turkey'] = $this->t('Turkey');
$options['ukraine'] = $this->t('Ukraine');
$options['EU Member states'] = $event->getFlagOptions();
$options['Non-EU Member states'] = [
'albania' => $this->t('Albania'),
'armenia' => $this->t('Armenia'),
'bosnia-and-herzegovina' => $this->t('Bosnia and Herzegovina'),
'georgia' => $this->t('Georgia'),
'iceland' => $this->t('Iceland'),
'israel' => $this->t('Israel'),
'liechtenstein' => $this->t('Liechtenstein'),
'moldova' => $this->t('Moldova'),
'montenegro' => $this->t('Montenegro'),
'north-macedonia' => $this->t('North Macedonia'),
'norway' => $this->t('Norway'),
'serbia' => $this->t('Serbia'),
'switzerland' => $this->t('Switzerland'),
'turkey' => $this->t('Turkey'),
'ukraine' => $this->t('Ukraine'),
'united-kingdom' => $this->t('United Kingdom'),
];
ksort($options);
$event->setFlagOptions($options);
}
Expand Down
4 changes: 4 additions & 0 deletions modules/oe_theme_helper/src/TwigExtension/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,12 @@ protected function getIconPath(array $context, string $icon): string {
// Flag icon names for non EU members.
$flag_icons_non_members = [
'albania',
'armenia',
'bosnia-and-herzegovina',
'georgia',
'iceland',
'israel',
'liechtenstein',
'moldova',
'montenegro',
'north-macedonia',
Expand All @@ -442,6 +445,7 @@ protected function getIconPath(array $context, string $icon): string {
'switzerland',
'turkey',
'ukraine',
'united-kingdom',
];
// Flag icons can have a -square string appended, so check if the icon name
// starts with a country name.
Expand Down