Handling translations

Being able to format dates and numbers according to local settings is only small part of the whole localization story. Usually when people think about localization it is the translation effort that comes to the mind first.

In an AngularJS application there are at least two places where we can find words to be translated to a target language: templates (partials) and strings used in JavaScript code.

For the rest of this chapter let's assume that we do have translated strings already available in a convenient format, for example JSON. Such JSON could be an object where keys correspond to logical names of fragments to be translated (For example, crud.user.remove.success), and the values are actual translated strings for a given ...

Get Mastering Web Application Development with AngularJS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.