File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -8,3 +8,10 @@ export const SUPPORTED_LOCALES = [
88export type SupportedLocale = ( typeof SUPPORTED_LOCALES ) [ number ] | 'pseudo'
99
1010export const DEFAULT_LOCALE : SupportedLocale = 'en-US'
11+
12+ // Override display names shown in language selectors to ensure consistent wording
13+ export const LOCALE_DISPLAY_NAMES : Partial < Record < SupportedLocale , string > > = {
14+ 'en-US' : 'English (US)' ,
15+ 'es-ES' : 'Español (España)' ,
16+ 'ru-RU' : 'Русский (Россия)' ,
17+ }
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import IMG_ICON_MENU_DOTS from '@cowprotocol/assets/images/menu-grid-dots.svg'
1616import IMG_ICON_MENU_HAMBURGER from '@cowprotocol/assets/images/menu-hamburger.svg'
1717import IMG_ICON_SETTINGS_GLOBAL from '@cowprotocol/assets/images/settings-global.svg'
1818import IMG_ICON_X from '@cowprotocol/assets/images/x.svg'
19+ import { LOCALE_DISPLAY_NAMES } from '@cowprotocol/common-const'
1920import { useMediaQuery , useOnClickOutside } from '@cowprotocol/common-hooks'
2021import { addBodyClass , removeBodyClass } from '@cowprotocol/common-utils'
2122
@@ -102,6 +103,11 @@ const DAO_NAV_ITEMS: MenuItem[] = [
102103]
103104
104105const getLanguageName = ( locale : string ) : string => {
106+ const override = LOCALE_DISPLAY_NAMES [ locale as keyof typeof LOCALE_DISPLAY_NAMES ]
107+ if ( override ) {
108+ return override
109+ }
110+
105111 const display = new Intl . DisplayNames ( [ locale ] , { type : 'language' } )
106112 const languageName = display . of ( locale )
107113
You can’t perform that action at this time.
0 commit comments