-
I basically need an english interface with local currency and time zone. Is that possible by setting cldr config ? |
Beta Was this translation helpful? Give feedback.
Answered by
kipcole9
Apr 14, 2024
Replies: 1 comment 1 reply
-
Peter, a language tag can convey quite a lot of information that isn't obvious at first. It is documented in the BCP47 'U' extension. Here's an example of using the # English but preferring Egyptian Pound, Egypt as the region and Egypt/Cairo as the timezone
iex> {:ok, locale} = Cldr.validate_locale("en-u-cu-egp-rg-egzzzz-tz-egcai")
{:ok, #Cldr.LanguageTag<en-u-cu-egp-rg-egzzzz-tz-egcai [validated]>}
iex> Cldr.Currency.currency_from_locale(locale)
:EGP
iex> Cldr.Locale.territory_from_locale(locale)
:EG
iex> Cldr.Locale.timezone_from_locale(locale)
"Africa/Cairo"
That said, I'm not sure what you mean by |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
pshoukry
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Peter, a language tag can convey quite a lot of information that isn't obvious at first. It is documented in the BCP47 'U' extension. Here's an example of using the
en
locale but with the Egyptian pound as the default currency and overriding the region to beEG
.That said, I'm not sure wha…