This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div id="app" data-app> | |
<div id="nav" v-if="locale"> | |
<div class="menu"> | |
<router-link :to="locale.base + '/'">{{ $t('main.nav.home') }}</router-link> | | |
<router-link :to="locale.base + '/about'">{{ $t('main.nav.about') }}</router-link> | |
</div> | |
<div class="languages"> | |
<v-menu offset-y> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
code: 'fr', | |
base: '/fr', | |
flag: 'fr', | |
name: 'Français', | |
translations: '/translations/fr.json' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import VueRouter from 'vue-router' | |
import store from '../store'; | |
import i18n from '../plugins/i18n'; | |
import axios from 'axios'; | |
Vue.use(VueRouter); | |
import routes from './routes'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function load (component) { | |
return () => import(/* webpackChunkName: "[request]" */ `@/views/${component}.vue`) | |
} | |
export default [{ | |
path: 'about', | |
name: 'About', | |
component: load('About') | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import VueRouter from 'vue-router' | |
Vue.use(VueRouter) | |
import routes from './routes' | |
import { SUPPORTED_LOCALES } from '../constants/locale' | |
// Creates regex (en|fr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const SUPPORTED_LOCALES = [{ | |
code: 'en', | |
base: '', | |
flag: 'us', | |
name: 'English', | |
translations: '/translations/en.json' | |
}, { | |
code: 'fr', | |
base: '/fr', | |
flag: 'fr', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const SUPPORTED_LOCALES = [{ | |
code: 'en', | |
base: '', | |
flag: 'us', | |
name: 'English', | |
translations: '/translations/en.json' | |
}, { | |
code: 'fr', | |
base: '/fr', | |
flag: 'fr', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import VueI18n from 'vue-i18n' | |
Vue.use(VueI18n) | |
export default new VueI18n({ | |
silentTranslationWarn: true, | |
locale: 'en', | |
fallbackLocale: 'dev', | |
messages: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import App from './App.vue' | |
import router from './router' | |
import store from './store' | |
import i18n from './i18n' | |
Vue.config.productionTip = false | |
new Vue({ | |
router, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import VueI18n from 'vue-i18n' | |
Vue.use(VueI18n) | |
export default new VueI18n({ | |
silentTranslationWarn: true, | |
locale: 'en', | |
fallbackLocale: 'dev', | |
messages: { |
NewerOlder