We were able to easily localize SC app with the strings table and sc-build did a good job of building out the different lang directories with the right localized files. Does Ember provide these?
thx
Not exactly the same as SC 1.x, but yes there is localization in Ember.
You'll first need to define your localized strings to Ember.STRINGS:
Ember.STRINGS = {
'_save': 'Save',
'_ok': 'OK',
'_apply': 'Apply',
'_cancel': 'Cancel',
'_close': 'Close',
'_refresh': 'Refresh'
}
Then you can localize any string by adding .loc()
to a string to localize it:
`_close`.loc() outputs "Close"
You can read the source here in ember-runtime and the tests here.
ZenDesk has a nice internationalization library, currently named sproutcore-i18n that I'd recommend. I expect they'll be changing the name to ember-i18n in the near future.
https://github.com/zendesk/sproutcore-i18n
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With