Use Strings as Keys in angular-translate - Angular

2019-09-19 01:06发布

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.

0条回答
登录 后发表回答