1

I have used angular gettext in my app. I have two languages as of now and want to switch the language in the UI depending on users preferences. I have a button for two languages- DE and EN.

In the controller method i have set the language:

      $scope.changeLang = function (lang) {
                    gettextCatalog.currentLanguage = lang;
                    gettextCatalog.debug = true;

};

On doing this the language doesn't seem to change in the UI. What is the right way to change the language dynamically in UI using angular gettext?

Thanks in advance.

1 Answer 1

6

You need to use the setCurrentLanguage method:

gettextCatalog.setCurrentLanguage(lang);

https://angular-gettext.rocketeer.be/dev-guide/api/angular-gettext/

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

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.