Does Ember support localization like SC 1.x

We were able to easily localize the SC application with a string table, and sc-build did a great job of creating different local directories with the correct localized files. Does Ember provide this data?

THX

+4
source share
2 answers

Not exactly the same as SC 1.x, but yes, Ember has localization.

First you need to define your localized strings in Ember.STRINGS:

Ember.STRINGS = { '_save': 'Save', '_ok': 'OK', '_apply': 'Apply', '_cancel': 'Cancel', '_close': 'Close', '_refresh': 'Refresh' } 

You can then localize any string by adding .loc() to the string to localize it:

 `_close`.loc() outputs "Close" 

Here you can read the source in ember-runtime mode and tests here .

+7
source

ZenDesk has a good internationalization library, currently called sproutcore-i18n, which I would recommend. I expect that in the near future they will change the name to ember-i18n.

https://github.com/zendesk/sproutcore-i18n

+4
source

Source: https://habr.com/ru/post/1389700/


All Articles