Aurelia CLI users

Almost the same as we explained in the Webpack user section, we need to retrieve the aurelia-i18n plugin and backend server from the npm repositories:

npm install aurelia-i18n --save
npm install i18next i18next-xhr-backend --save

Now, we need to tell our project that we have new dependencies to be configured. Open your Aurelia configuration file (aurelia.json) and look for the dependencies section. You must add the following entries:

{
    "name": "i18next",
    "path": "../node_modules/i18next/dist/umd",
    "main": "i18next"
  },
  {
    "name": "aurelia-i18n",
    "path": "../node_modules/aurelia-i18n/dist/amd",
    "main": "aurelia-i18n"
  },
  {
    "name": "i18next-xhr-backend",
    "path": "../node_modules/i18next-xhr-backend/dist/umd",
    "main": "i18nextXHRBackend"
  }
If your application was created using the Aurelia CLI 0.33.1, you can omit this last step.

Finally, we are done with the plugins. Now, let's configure it to our application!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.180.71