tflori / angular-translator

translation module for angular
https://tflori.github.io/angular-translator/
MIT License
21 stars 6 forks source link

Defaults back to 'en' #62

Closed ziemerz closed 7 years ago

ziemerz commented 7 years ago

Hi

We want to make a kind of easter egg implementation of a part of our system and wanted to make custom language (like 'pirate'). When we do that, it seems like it defaults back to english though. Is there some kind of check on the format of the languages provided? I can imagine this could also be an issue if you wanted localisation (like en_GB and en_US). What should the format of localisation be?

Suggestion Would it be possible to remove that restriction if there are any?

tflori commented 7 years ago

https://tflori.github.io/angular-translator/TranslatorConfig.html

Indeed there is a restriction because all languages (provided and chosen) are normalized to <two letter language>[[divider]<two letter region>].

You can internally name the language pr or something else that does not exist and map it somewhere. There was a reason behind this restriction and currently I don't know the reason. Maybe tomorrow I remember why :thinking:

tflori commented 7 years ago

The restriction was for non strict matching languages. I solved this problem otherwise and removed the restriction.

tflori commented 7 years ago

please upgrade to 2.3.1. if this is still not working feel free to reopen the issue. thanks for your contribution!