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

Adding locales which aren't in getAvailableLocales() #52

Closed
greywolve opened this issue Aug 25, 2014 · 1 comment
Closed

Adding locales which aren't in getAvailableLocales() #52

greywolve opened this issue Aug 25, 2014 · 1 comment

Comments

@greywolve
Copy link

Hey Peter,

Thanks for the great library. I just wanted to ask if there is a simple way to add language/locale that doesn't exist in the java getAvailableLocales method you are using to check for validity?

I'm trying to add afrikaans which isn't included by default. I don't really need all the formatting stuff, just translations, but obviously trying to use :af in the dictionary blows up.

I searched for ways of adding locales to LocaleServiceProvider via java but it seems like quite a mission for what I want to actually do.

Any advice?

Thanks!

Oliver

@ptaoussanis
Copy link
Member

Hi Oliver,

Sorry for the delay getting back to you. Will be pushing a v2.1.0 (final) release later today which allows arbitrary locales for the translation API.

You'll be able to add :af keys to your dictionary and request :af translations w/o needing to make any config changes.

Note that you will need to make config changes (add an Afrikaans system locale) to use the localization utils since those lean on the JVM.

Hope that helps, cheers! :-)

ptaoussanis added a commit that referenced this issue Aug 28, 2014
The need to strictly enforce valid JVM Locales really only makes sense for
the (JVM) localization utils. The translation fns can be more lenient, using
their normal fallback mechanism when given an invalid locale.

Also in this commit:
  * Switched from `Exception`s to `ex-info`s.
  * Ring middleware improvements, mostly allowed by new distinguish between
    JVM and non-JVM locales.
  * General housekeeping.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants