Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import ClientStorage from '@/utils/ClientStorage';
Vue.use(VueI18n);
export const supportedLanguages = {
"en-US": "English",
"bg-BG": "Български",
"de-DE": "Deutsch",
"nl-NL": "Nederlands",
"pt-BR": "Português",
};
// Extend the internal `VueI18n._translate` method in order to
// populate the source language messages on runtime
const sourceMessages = {};
const i18nTranslate = VueI18n.prototype._translate;
VueI18n.prototype._translate = function (messages, locale, fallback, key, host, interpolateMode, args) {
if (!sourceMessages[key]) {
sourceMessages[key] = key;
}
return i18nTranslate.apply(this, arguments);
};
const defaultLanguage = Object.keys(supportedLanguages)[0];
const i18nMessages = {};
i18nMessages[defaultLanguage] = sourceMessages;
// Create VueI18n instance
export const i18n = new VueI18n({
locale: defaultLanguage,
Vue.use(VueI18n);
export const supportedLanguages = {
"en-US": "English",
"bg-BG": "Български",
"de-DE": "Deutsch",
"nl-NL": "Nederlands",
"pt-BR": "Português",
};
// Extend the internal `VueI18n._translate` method in order to
// populate the source language messages on runtime
const sourceMessages = {};
const i18nTranslate = VueI18n.prototype._translate;
VueI18n.prototype._translate = function (messages, locale, fallback, key, host, interpolateMode, args) {
if (!sourceMessages[key]) {
sourceMessages[key] = key;
}
return i18nTranslate.apply(this, arguments);
};
const defaultLanguage = Object.keys(supportedLanguages)[0];
const i18nMessages = {};
i18nMessages[defaultLanguage] = sourceMessages;
// Create VueI18n instance
export const i18n = new VueI18n({
locale: defaultLanguage,
fallbackLocale: defaultLanguage,