문제

I am wondering what is the best way to realize a multi language support for a web app with handlebars and EmberJs in the back. There is no native multi language support in handlebars.

I found a handlebars helper https://gist.github.com/tracend/3261055 The code looks good and pretty simple, but I didn't test it yet.

Do you know another plugins/helpers?

도움이 되었습니까?

해결책

I use this one which is specific for Ember: https://github.com/jamesarosen/ember-i18n

It adds a 't' handlebars helper :

{{t main.offers countBinding="offers.length"}}

It supports plurals (via CDLR.js) and is not limited to handlebars thanks to Em.I18n.TranslateableProperties mixin, which allows property translation via a convention on any Ember Object.

다른 팁

It is very easy to write a helper, so you will find none or many handlebars implementations.

I'm using https://github.com/jquery/globalize for my projects. The implementation is a peace of cake.

Globalize is maintained by JQuery, supports everything you need and has an active community.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top