├── .gitignore ├── README.md ├── babel.config.js ├── package-lock.json ├── package.json ├── public ├── favicon.ico └── index.html ├── screenshots └── vue.gif └── src ├── App.vue ├── assets └── logo.png ├── components └── HelloWorld.vue ├── main.js └── plugins └── i18n.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw* 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-internationalization 2 | 3 | This is the source code for an article I wrote about adding internationalization to a Vue application. You can [read the article here](https://medium.com/p/d9cfdcabb03b/). 4 | 5 | In the article I show how to take the default app created from the @vue/cli and add internationalization to it. 6 | Here is what it looks like: 7 | 8 |  9 | 10 | ## Project setup 11 | ``` 12 | npm install 13 | ``` 14 | 15 | ### Compiles and hot-reloads for development 16 | ``` 17 | npm run serve 18 | ``` 19 | 20 | ### Compiles and minifies for production 21 | ``` 22 | npm run build 23 | ``` 24 | 25 | ### Run your tests 26 | ``` 27 | npm run test 28 | ``` 29 | 30 | ### Lints and fixes files 31 | ``` 32 | npm run lint 33 | ``` 34 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-internationalization", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "vue": "^2.5.17", 12 | "vue-flag-icon": "^1.0.6", 13 | "vue-i18n": "^8.3.1" 14 | }, 15 | "devDependencies": { 16 | "@vue/cli-plugin-babel": "^3.0.5", 17 | "@vue/cli-plugin-eslint": "^3.0.5", 18 | "@vue/cli-service": "^3.0.5", 19 | "babel-eslint": "^10.0.1", 20 | "eslint": "^5.8.0", 21 | "eslint-plugin-vue": "^5.0.0-0", 22 | "vue-template-compiler": "^2.5.17" 23 | }, 24 | "eslintConfig": { 25 | "root": true, 26 | "env": { 27 | "node": true 28 | }, 29 | "extends": [ 30 | "plugin:vue/essential", 31 | "eslint:recommended" 32 | ], 33 | "rules": {}, 34 | "parserOptions": { 35 | "parser": "babel-eslint" 36 | } 37 | }, 38 | "postcss": { 39 | "plugins": { 40 | "autoprefixer": {} 41 | } 42 | }, 43 | "browserslist": [ 44 | "> 1%", 45 | "last 2 versions", 46 | "not ie <= 8" 47 | ] 48 | } 49 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ratracegrad/vue-internationalization/9fdd06e985289d79ac954570c52c405f36e2a3e5/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 |
5 | {{ $t('guide') }}
6 | {{ $t('checkout') }}
7 | vue-cli documentation.
8 |