-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Localize whole application #12
Labels
Comments
Ember addon for internationalization: https://github.com/jamesarosen/ember-i18n |
In a different project I determined the locale using the user's preferred Browser languages. Using an instance initializer ( export default {
name: 'i18n',
initialize: function(application) {
let i18n = application.lookup('service:i18n');
i18n.set('locale', determineLocale(i18n.get('locales')));
}
};
function determineLocale(availableLocales) {
let userLanguages = navigator.languages || [];
userLanguages.push(navigator.language, navigator.userLanguage, 'en');
return userLanguages.compact().find((language) => {
return availableLocales.indexOf(language) > -1 ||
availableLocales.indexOf(language.split('-')[0]) > -1;
});
} |
ebrahim-elgaml
added a commit
to ebrahim-elgaml/webmarks
that referenced
this issue
Jul 17, 2017
refs raucao#12 install ember-i18n add localization for en and de set default languange to en add translation for search input field place holder
Merged
Works great now! I'm merging locally, with some changes on top. |
@ebrahim-elgaml Thanks again for your contribution! Much appreciated. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe these could be helpful:
The text was updated successfully, but these errors were encountered: