For Webpack users

We need to retrieve the plugin from the npm repository, so just type the following command to get the latest:

 npm install aurelia-i18n --save

It will download and save the plugin in your project dependencies. As we said earlier, aurelia-i18n is based on i18n framework, so you should install a backend plugin. One of the most famous is i18next-xhr-backend, a simple i18next backend to be used in the browser. How does it work? Easy, using XHR, it will load resources from some backend server. Yes, your translation files! If you want to use the built-in aurelia-loader backend, the same plugin Aurelia use to get resources, it's okay, you can ignore the next step.

You know what to do now.

npm install i18next i18next-xhr-backend --save

We are almost ready. In your Webpack configuration file, you must add aurelia-i18n to your project's Aurelia bundles list (on the Aurelia section):

const coreBundles = {
    bootstrap: [/* many options here */],
    aurelia: [
/* many options here too*/
'aurelia-i18n' // add aurelia-i18n to the array ] }
..................Content has been hidden....................

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