I have a general question which is of high importance for us to be answered before we dig too deep into the project. Currently I am trying to build a project, which has translations for pretty much every single label. Is it possible to dynamically fetch a json from the backend and use it for translation? This would give users the ability to enter their own translations into the json (of course the keys have to stay the same). So far I have only read about hardcoded translations but I need them to be dynamically served from the backend. Is that possible with Angular and i18n?
- What do you mean by hardcoded translations?ukn– ukn2020-06-09 22:27:47 +00:00Commented Jun 9, 2020 at 22:27
- Usually there is a file/or multiple containing the translation inside the project. I haven’t seen an example of the translations getting pulled from a backend.Tom el Safadi– Tom el Safadi2020-06-09 22:30:33 +00:00Commented Jun 9, 2020 at 22:30
Add a comment |
1 Answer
I would take a look at ngx-translate, it provides some ways to load you translation from the server. I did it in AngularJS but I can't say I did in Angular 2+. The exemple of the stackblitz here is a proof that you can do it and is a good starting point.
1 Comment
Tom el Safadi
Worked perfectly with ngx-translate!!