How to

  1. Add localization

Add localization

  1. In assets/resources/i18n.js, add a new language.

    For example:

     export default {
       en: { ...commonTranslates.en },
       /* place here */
     }
    
  2. In components/, add a dir file with a new language to translations.

    For example: components/header/translation/jpn.js

  3. In main.js, add a language to Vue.i18n

    Import language object from assets.

    Then, use the Vue.i18n.add method. For example, Vue.i18n.add ("jpn", translations.jpn)

  4. Now it's possible to switch languages using 2 actions:

     i18n.createAction(dispatch, {
         path: i18n.actions.SET_LOCALE,
         payload: newLanguage
     })
    
     User.createAction(dispatch, {
         path: User.actions.CHANGE_LOCALE,
         payload: newLanguage
     })
    

results matching ""

    No results matching ""