Use Strings as Keys in angular-translate - AngularJS

て烟熏妆下的殇ゞ 提交于 2019-12-25 04:42:37

问题


I notice in all of the examples of angular-translate that they use translation ids like "errorMessage" as opposed to using the actual error message string like gettext does. Example:

{{'errorMessage' | translate }}

instead of

{{'Uh oh, something went wrong!' | translate}}

Q Why should/shouldn't one use the string as the actual translation id? It seems that it would improve readability and allow for easier translation of the resulting .json file.

来源:https://stackoverflow.com/questions/36852282/use-strings-as-keys-in-angular-translate-angularjs

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