i18next / ng-i18next

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

Specify version of i18next compatible with each version of ng-i18next #120

Closed prbaron closed 8 years ago

prbaron commented 8 years ago

Hi,

there are at the moment two majors versions of i18next, 1.x and 3.x. It would be nice to tell which version of i18next is necessary for a specific version of ng-i18next.

I am using i18next 1.x, can I upgrade to v1.0.1 ? Or do I have to keep an older version ?

anwalkers commented 8 years ago

v1.0.1 is build against "i18next": "^3.4.1". I will add a note to the documentation.

There are breaking changes between ng-i18next 0.x and 1.x and you will need to upgrade i18next to 3.x to work with ng-i18next 1.x.

To upgrade you will need to:

  1. Move configuration of the $i18nextProvider from the application's config to before angular boots using window.i18next... NOTE: There is an open issue with WebPack and SystemJS #99
  2. Add a the locale loader backend of choice. See i18next documentation
  3. Update all code translations from $i18next("localeKey") to $i18next.t("localeKey")
  4. Update the configuration for interpolation syntax or update your locales to use the default interpolation syntax. i18next 1.x was __key__ and 3.x is now {{key}}.
prbaron commented 8 years ago

ok, thank you