All files / src/qComponents/constants/locales index.js

75% Statements 6/8
50% Branches 1/2
100% Functions 1/1
75% Lines 6/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31                23x 23x 23x           23x 23x       23x                  
/* eslint-disable no-underscore-dangle */
import Vue from 'vue';
import VueI18n from 'vue-i18n';
import { merge } from 'lodash-es';
 
import ru from './ru';
import en from './en';
 
const installI18n = ({ locale, customI18nMessages }) => {
  const isI18nExist = Boolean(Vue.prototype._i18n);
  Iif (isI18nExist) {
    console.warn(
      `Error: Qui can't setup VueI18n, it has detected in the app, please merge i18n messages, see the docs`
    );
    return;
  }
  Vue.use(VueI18n);
  const i18n = new VueI18n({
    locale,
    messages: merge({ en, ru }, customI18nMessages)
  });
  Vue.prototype._i18n = i18n;
};
 
export default {
  en,
  ru
};
 
export { ru, en, installI18n };