3

I am trying to learn Angular and i18n concept. My xlf files are ok. My html files are ok (well... I think they are). I can choose a language through terminal like

ng serve --configuration=fr 

but when I do that, only French version of the program works. I want to choose the language dynamically.

I am using Angular 8.

1
  • 1
    Please share a minimal representation of your implementation as well. It won't be possible to determine what's wrong without that. Or better, if possible, please provide a minimal reproducible stackblitz sample to work with. Commented Jul 29, 2019 at 15:26

2 Answers 2

6

Original angular multilanguage support doesn't allow you to change language dynamically. The only thing you could do is to generate projects for different languages and implement language changing by means of your server. You can read more about it here: https://angular.io/guide/i18n#merge-the-completed-translation-file-into-the-app

If you want to be able to change language dynamically I'd advise you to use ngx-translate

Sign up to request clarification or add additional context in comments.

Comments

-1

Please try with this. Simple implementation is there. Angular 8 translate with @ngx-translate

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.