Angular i18n choosing the best module

你离开我真会死。 提交于 2019-12-11 09:17:13

问题


I have been reading about i18n in angular and I have decided to use angular-translate.
But would like to know if I am wrong with my selection.
My site is building from scratch.

Also would appreciate which you consider is the best way to organize the translations.
Thank you


回答1:


There is basically no way to know. There are also other sensible modules, i.e. angular-localization, but... OK, angular-localization advertises itself as being more "Angular way", but by simply analyzing GitHub I am not that convinced (in terms of pure popularity).
That is, angular-translate is the most popular module for providing translations, which equates to widespread adoption - it is probably the least likely to fail.
On the other hand, I can least i18n deficiencies in angular-translate, but in most cases it is good enough.

Now, translations are only the part of the equation. The other part is a support for formatting numbers, dates, currency units, percentages, units of measurements and locale-aware collation (comparison and sorting). To some extent you can use Agnular's built-in "localization" (I have no idea why they call it that way), but you need to combine it with dynamic loading of locales. For that you need something like Angular Dynamic Locale, which is a kind of ugly workaround, but it works.

For other parts, you may be forced to switch to JavaScript built-in support for i18n or even write your own if you want premium support.



来源:https://stackoverflow.com/questions/28071152/angular-i18n-choosing-the-best-module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!