i18next / ng-i18next

translation for AngularJS using i18next
https://github.com/i18next/ng-i18next
MIT License
161 stars 54 forks source link

Changing language after app initialization #11

Closed irumiha closed 11 years ago

irumiha commented 11 years ago

I'm trying to integrate ng-i18next into my app and I have hit a problem: I can not change the language from within a controller. I want to allow my user to click on the language code and change the UI language based on that action. I'm using the directive based approach. Is such a functionality possible?

bugwelle commented 11 years ago

It was possible, in the last version :/ Of course, this has to be possible. In this version, it is currently only possible to set the config once... I'll push some code tomorrow ;)

bugwelle commented 11 years ago

Now you can change options at runtime. Simply require $i18next and then change any option you want:

irumiha commented 11 years ago

Great! Much easier to use than my quick solution. Thanks!

bugwelle commented 11 years ago

No problem.

If there's anything else that doesn't work (and I know some bugs that aren't listed here) please let me know. ;)

Have a look at the directive example. It shows how you can change the language at runtime :)

mikpetr commented 10 years ago

Hello. In my case it is't work :(

bugwelle commented 10 years ago

OK, could you please tell us, what exactly does not work? Are your HTML files on a server or did you just open a file directly (file:\\\)?

Regards, Andre