-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
Languages #14
Comments
not yet, but seems like a good enhancement. The questions are:
|
@stefanpenner we should sync up on this. I have made some progress around this area by building an ember-addon for formatjs and would let to vet it. Bindable languages work Per transform option: {{#x-intl locales='fr-FR'}}
<p>
<b>{{format-date today day='numeric' month='long'}}</b>
<i>('fr-FR' locale)</i>
</p>
{{/x-intl}} The one I need to think through is how to globally store a language option. |
maybe app/locales/en
app/locales/de |
👍 great idea |
Hi, |
I am days away from releasing The syntax will be nearly identical to handlebars-intl |
https://github.com/yahoo/ember-intl the helper you are looking for is like format time date and relative — On Tue, Jan 27, 2015 at 5:52 PM, Felipe Leusin notifications@github.com
|
@jasonmit nice! |
This feature is needed strongly. I'd prefer a global configuration. Maybe this is helpful: |
moment.locale('fr'); // Set the default/global locale Of course that wouldn't result in bound helpers, but perhaps something you can use until it's implemented. |
I'm using ember-cli-i18n which stores current locale as Since there isn't a common way to store locale setting in application yet I would prefer using a bindable locale option in |
I was able to update my little moment helper to observe locale changes and rerender view. Perhaps it's a starting point. I'm not sure if rerender helper view is the right way to go.
|
@jelhan usually the locale does not change throughout the lifetime of app. Are you sure you need to observe I say this because I'm in the process of ripping this functionality out of Also, are you removing the observer when the view is destroyed? |
@jasonmit I have to support on-the-fly switching of locales without a reload of page in my app and therefore moved from ember-i18n to ember-cli-i18n. Of course it depends on your project if on-the-fly update of locales is needed or if observing locales should be avoided due to performance issues. |
I should have been more clear, you get this behavior if you force an app reset on locale change. You now don't take the perf hit and you aren't re-fetching your assets.
|
Changing locales doesn't seem to work for me right now. I added a default locale, as specified in the README, but moment's locale seems to be set in tone to 'en'. Any luck with this? |
@jasonmit @seven7seven Do you include the locale you specified as default locale? Also have a check if your default locale is supported by moment.js. |
@seven7seven are you able to reproduce this and show me so I can look into it.
I'd be happy to review a pull request but I don't feel this functionality of changing your locale to trigger a rerender covers the 80% usecase. And as I said above, ember-intl does support the functionality you are after and supports date, time and relative time formatting. |
#75 will allow for inlining locales, global is supported and documented |
Closing as there is now documentation on setting global and local locales |
Is there an easy way to change the language?
The text was updated successfully, but these errors were encountered: