Skip to content

Commit

Permalink
feat: config i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
pablosirera committed Jun 27, 2020
1 parent e149908 commit 2ae8f20
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 2 deletions.
1 change: 1 addition & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
5 changes: 5 additions & 0 deletions locales/es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"title": "Mis projectos"
}
}
25 changes: 25 additions & 0 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default {
'@nuxtjs/pwa',
// Doc: https://github.com/nuxt/content
'@nuxt/content',
'nuxt-i18n',
[
'nuxt-fontawesome',
{
Expand All @@ -66,6 +67,30 @@ export default {
** See https://content.nuxtjs.org/configuration
*/
content: {},
/*
** nuxt-i18n config
*/
i18n: {
locales: [
{
code: 'en',
iso: 'en-US',
file: 'en.json',
},
{
code: 'es',
iso: 'es-ES',
file: 'es.json',
},
],
seo: true,
lazy: true,
defaultLocale: 'es',
langDir: 'locales/',
vueI18n: {
fallbackLocale: 'es',
},
},
/*
** Build configuration
** See https://nuxtjs.org/api/configuration-build/
Expand Down
47 changes: 47 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"@nuxt/content": "^1.3.2",
"@nuxtjs/pwa": "^3.0.0-beta.20",
"nuxt": "^2.13.0",
"nuxt-fontawesome": "^0.4.0"
"nuxt-fontawesome": "^0.4.0",
"nuxt-i18n": "^6.12.2"
},
"devDependencies": {
"@nuxtjs/eslint-config": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion pages/projects/index.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<template>
<h1 class="title">Projects page</h1>
<h1 class="title">{{ $t('projects.title') }}</h1>
</template>

0 comments on commit 2ae8f20

Please sign in to comment.