i18next / ng-i18next

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

Filtered expression update when loading locale files #68

Closed rraziel closed 9 years ago

rraziel commented 9 years ago

Hello,

I'm having a small issue with the i18next filter. The provider is configured this way:

$i18nextProvider.options = {
  lng: 'en',
  useCookie: false,
  useLocalStorage: false,
  fallbackLng: 'en',
  resGetPath: 'locales/__lng__.json'
};

And the HTML is a simple:

<div ng-18next="testkey"></div>
<div>{{'testkey' | i18next}}</div>

The second div's content becomes testkey instead of the expected text associated with the key.

Apparently the div's content doesn't get refreshed once the json file is loaded, while the div with the ng-i18next attribute gets updated properly.

To make sure I simply set useLocalStorage to true. Once the json file was cached, the text appeared properly in the second div..

Any idea what the issue could be? The page is pretty much empty and there is no JS except for the ng-i18next initialization...

bugwelle commented 9 years ago

What version of ng-i18next, i18next and angular are you using? :)

Regards, Andre

rraziel commented 9 years ago

Thought I might as well try to be somewhat helpful, so I tested with multiple angular versions. Turns out it doesn't work with 1.3.3 (what I originally used) nor 1.3.0, but it does work with 1.2.27.

And to at least answer your original question: ng-i18next 0.3.5 and i18next 1.7.4.

bugwelle commented 9 years ago

Thanks. :+1: Please see: https://github.com/i18next/ng-i18next/pull/66 Everything works fine with angular prior to 1.3.0.

Version 0.3.6 is coming soon :)

Regards, Andre

bugwelle commented 9 years ago

Version 0.3.6 is now available. Please update now :) It should work. :)

rraziel commented 9 years ago

Thanks, works flawlessly.