Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

How to configure backend.loadPath with vue-cli 3.x? #20

Closed
DenniLa2 opened this issue Mar 11, 2018 · 2 comments
Closed

How to configure backend.loadPath with vue-cli 3.x? #20

DenniLa2 opened this issue Mar 11, 2018 · 2 comments

Comments

@DenniLa2
Copy link

DenniLa2 commented Mar 11, 2018

Hello!
I use i18next with vue-cli 2.x with this config:

import Vue from 'vue'
import i18next from 'i18next'
import VueI18Next from '@panter/vue-i18next'
import XHR from 'i18next-xhr-backend'

Vue.use(VueI18Next);

i18next
  .use(XHR)
  .init({
    lng: 'ru',
    preload: ['ru'],
    fallbackLng: 'en',
    debug: true,
    backend: {
      loadPath: '/static/i18n/{{ns}}.{{lng}}.json',
      addPath: '/static/i18n/{{ns}}-{{lng}}',
    },

    ns: [
      'common',
    ],
    defaultNS: ['common']
  });

export default new VueI18Next(i18next);

But with vue-cli 3.x this config not working:

i18next::backendConnector: loading namespace common for language ru failed failed parsing /static/i18n/common.ru.json to json
i18next::backendConnector: loading namespace common for language en failed failed parsing /public/i18n/common.en.json to json

How to configure load path to load translations with vue-cli 3.x?

@claudiocro
Copy link
Member

Hi

this seems to be a problem related to i18next in combination with vue-cli 3.x. Try to ask the vue-cli comunity how they handle their proxy,

@cj-prog
Copy link

cj-prog commented Oct 3, 2018

@DenniLa2 Did you find a solution to load paths to translation files with vue-cli 3? It would be nice if you could publish a solution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants