问题
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