-
Notifications
You must be signed in to change notification settings - Fork 50
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
Fallback Language Support #10
Comments
@SCKelemen I hadn't gotten that far with it yet...But there is already a library that does this https://godoc.org/golang.org/x/text/language I was hoping to integrate it at some point as a higher level function to the FindTranslator which does do fallback based on the array..So the higher level function would create the array. |
Thanks for all your help and suggestions @SCKelemen I apologize if I'm a little slow getting some of this implemented; my main focus right now is finding a job |
Do you want help implementing it? |
Ya I'm all for any help 👍 |
@SCKelemen so basically this library https://godoc.org/golang.org/x/text/ you specify a matcher of supported languages and then match based on preferred languages, say gathered from the Accept-Language header. But I don't know if there is a nice way to integrate it as of yet to help determine which locales we should look for but ideally when registering locales with this library languages would be added to the matcher and then a function could be added called DetermineLocale(...) and it could accept and array of preferred languages and determine the best matching using the matcher and attempt to return the Translator for the best matched locale. |
CLDR has fallback languages for cases in which a localization is unavailable. I would like to add support for this. Any thoughts or recommendations on implementation?
I would create LocaleResolver which takes in a locale ID, and if the ID is support, returns the ID, otherwise it runs through the list of fallback locales, and returns the first one that is supported. I'd probably need to specify a configurable default language value as well.
http://cldr.unicode.org/development/development-process/design-proposals/transform-fallback
http://cldr.unicode.org/development/development-process/design-proposals/languagedistance
The text was updated successfully, but these errors were encountered: