Dynamically fetch translation from server with angular

Viewed 761

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?

1 Answers

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.

Related