A
A
Andrew2020-05-14 18:02:57
Angular
Andrew, 2020-05-14 18:02:57

What to use to internationalize Angular?

There is a project on Angular 9, the question arose about internationalization.
A cursory search revealed three options
1. Angular's built-in tools (via the i18n attribute).
Pros - supported by Angular itself, precompiled. You can add comments and explanations to each element of the translation
Cons - changes in the translation require recompilation. When laid out for sale, the build time of an angular project increases by N times, where N is the number of languages. Only template elements can be translated; translation within components and services is not available.
2. ngx-translate.
Pluses - json, translation in runtime, respectively, the ability to edit the translation on the fly. You can store the translation in the database.
Cons - you cannot add comments (as in the first paragraph), the dubious future of the project - https://github.com/ngx-translate/core/issues/783
3. https://github.com/ngneat/transloco
Pros - like previous paragraph
Cons - you can not add comments (as in the first paragraph). Also, the project is young, it exists for about a year, and it is not known exactly how well it has settled down, whether there will be cardinal changes or, even worse, whether it will be abandoned.

The question is what is the best thing to take for internationalization today? In an ideal - that it was possible with comments to translations.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question