Reputation: 882
To localize my Angular 13 application I followed the official guide: https://angular.io/guide/i18n-example, created *.xlf files with translations, everything seems to work fine so far.
Now, I wonder if it's possible to dynamically change the current display language (current locale and translations) without recompiling and reloading the Angular application, keeping the same Url address. For example, I'd like to have a Combobox in the component and when the user selects a different language, dynamically change the UI display language for the entire site. Is this possible using the default i18n Angular 13 functionality? Should I use ngx-translate instead of the default one? What are the pros and cons?
Upvotes: 2
Views: 2255
Reputation: 2084
possible solutions with i18n (u will need reload page 100% at this time angualr i18n can't update displayed data in runtime):
with using ngx-translate u can saw actually language when it changed (runtime updated)
Upvotes: 1