-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
What message file is used by default and why? #29
Comments
Hi @krisztianb, Thanks for using gettext and for this issue :) You're right, If I recall clearly (it's been a long time I haven't worked on this lib, yet using it everyday) I internally call I think I did that because I did not saw a practical use case where you load a catalog without wanting to use it for translations. I also assumed that In my usage, I even don't load any Tell me a bit more about yours? Best |
Hi @guillaumepotier, thanks for the great library. We are using it in our "word processing" application to display messages and for the GUI elements as well. Since our company is located in Austria, all the messages are in German by default. The technical use case is basically:
If I understand you correctly, this would mean that when we load 10 message files at step one and the last is for Japanese, the messages in the application would all be in Japanese. :-) This seems a bit odd to me. I mean setting the last loaded language as "default" doesn't really make sense. But maybe this is just my opinion. We currently fixed the issue by adding a I don't know if you are willing to change this behaviour, since it could also effect other users who expect the current behaviour. |
Thanks for looking into it. So there are three ways to set the default locale:
The "problem" is this line: https://github.com/guillaumepotier/gettext.js/blob/master/lib/gettext.js#L9 which sets Couldn't you just simply remove the |
I think this should be doable. I may find some time next week to look into it and ensure it does not breaks too much things in the test suite (except the get default locale test ;)) It makes sense, if no language is specified nor detected, it should simply render the default strings in the templates. Keep you posted Best |
We are using GetText.js in our application. Our default language is German. At the start of our application we load the English translations like this:
We never call setLocale to set the language, yet when calling the translation methods like this:
We get an English text. My expected behaviour would be to return the default text, when no locale has been set. What is your opinion?
The text was updated successfully, but these errors were encountered: