Created
January 13, 2018 13:21
-
-
Save anselmobattisti/bef967ce8a9ab8995fb32ded802c86c2 to your computer and use it in GitHub Desktop.
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
in main.js | |
import VueI18n from 'vue-i18n' | |
import lang from './language/lang' | |
const i18n = new VueI18n({ | |
locale: 'pt-BR', // set locale | |
messages: lang // set locale messages | |
} | |
new Vue({ | |
el: '#app', | |
router, | |
template: '<App/>', | |
closeLoading: true, | |
i18n | |
}) | |
in lang.js | |
import { ptBR } from './ptBR' | |
export default { | |
'pt-BR': ptBR | |
} | |
in ptbr.js | |
export const ptBR = { | |
general: { | |
loading: 'Aguarde, processando ... ', | |
construction: 'Obra', | |
message: 'Mensagem', | |
user: 'Usuário', | |
client: 'Cliente', | |
companiy: 'Empresa' | |
} | |
} | |
in your .vue file | |
<p>{{ $t("general.loading") }}</p> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment