Cannot add a custom locale via config/locales
if PHP intl extension is installed.
#8924
-
DescriptionI want to add some custom locales that are not included in PHP's list generated by the intl extension. These reflect the languages available under Settings > Sites > [choose site] > Language. When the intl extension is not installed, you can add custom locales in Steps to reproduce
Additional info
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
Marked this as an enhancement request as this currently works by design. The Intl extension is supposed to provide an exhaustive list of recognized locales |
Beta Was this translation helpful? Give feedback.
-
I've got a problem with I also received |
Beta Was this translation helpful? Give feedback.
-
I don't really understand why this is an option in Craft if it doesn't work? Intl extension is installed and it doesn't work, and i also added a config file in to /config/locales/ and still get the same error:
|
Beta Was this translation helpful? Give feedback.
-
Checking in here to see if you can help me adding a non-standard locale? E.g. en-FR (english speakers in France). Tried using: (Use case: for hreflang links between regions) |
Beta Was this translation helpful? Give feedback.
-
In Craft 5, you can add custom locales using the localeAliases config setting: ->localeAliases([
'en-FR' => [
'aliasOf' => 'en',
'displayName' => 'English (French)',
],
]); |
Beta Was this translation helpful? Give feedback.
In Craft 5, you can add custom locales using the localeAliases config setting: