├── .babelrc ├── .editorconfig ├── .eslintrc ├── .gitignore ├── .npmignore ├── .travis.yml ├── .vscode └── settings.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── README.md ├── docs ├── .vuepress │ ├── config.js │ └── public │ │ └── panter-logo.png ├── README.md ├── guide │ ├── component-interpolation.md │ ├── component.md │ ├── directive.md │ ├── i18n-options.md │ ├── i18n.md │ ├── miscellaneous.md │ ├── single-file-component.md │ └── started.md ├── installation.md └── introduction.md ├── examples ├── app.js ├── index.html └── perf │ ├── .gitignore │ ├── README.md │ ├── directive │ ├── .babelrc │ ├── .gitignore │ ├── README.md │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── App.vue │ │ └── main.js │ └── webpack.config.js │ ├── generate │ └── .gitkeep │ ├── index.js │ ├── method │ ├── .babelrc │ ├── .gitignore │ ├── README.md │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── App.vue │ │ └── main.js │ └── webpack.config.js │ ├── package-lock.json │ ├── package.json │ └── plain │ ├── .babelrc │ ├── .gitignore │ ├── README.md │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── App.vue │ └── main.js │ └── webpack.config.js ├── package.json ├── rollup.config.js ├── src ├── component.js ├── directive.js ├── i18n.js ├── install.js ├── utils.js └── wait.js ├── test ├── .eslintrc ├── helpers │ ├── backendMock.js │ └── globals.js ├── karma.conf.js └── unit │ ├── basic.test.js │ ├── component.test.js │ ├── directive.test.js │ ├── index.js │ ├── interpolation.test.js │ ├── render.test.js │ ├── utils.test.js │ └── wait.test.js ├── typings ├── index.d.ts ├── test │ └── vue-i18next-tests.ts └── tsconfig.json ├── webpack.config.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [["@babel/env"]], 3 | "plugins": [ 4 | "add-module-exports", 5 | "@babel/plugin-proposal-object-rest-spread" 6 | ], 7 | "env": { 8 | "test": { 9 | "presets": ["@babel/env"], 10 | "plugins": ["@babel/plugin-proposal-object-rest-spread", "istanbul"] 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "parserOptions": { 4 | "ecmaVersion": 6, 5 | "sourceType": "module", 6 | "ecmaFeatures": { 7 | "experimentalObjectRestSpread": true, 8 | "globalReturn": true 9 | } 10 | }, 11 | "globals": { 12 | "document": true, 13 | "window": true, 14 | "__VERSION__": true 15 | }, 16 | "plugins": ["prettier"], 17 | "extends": ["airbnb", "prettier"], 18 | "rules": { 19 | "prettier/prettier": ["error", { "singleQuote": true }], 20 | "arrow-body-style": [1, "as-needed"], 21 | "no-underscore-dangle": 0, 22 | "react/prop-types": 0, 23 | "consistent-return": 0, 24 | "import/no-unresolved": 0, 25 | "import/extensions": 0, 26 | "import/no-extraneous-dependencies": 0 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | lib/ 5 | gh-pages/ 6 | npm-debug.log 7 | test/coverage 8 | .temp/ 9 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | 2 | # OS Specific 3 | .Spotlight-V100 4 | .Trashes 5 | ehthumbs.db 6 | Thumbs.db 7 | 8 | # IDE Specific 9 | nbproject 10 | .~lock.* 11 | .buildpath 12 | .idea 13 | .project 14 | .settings 15 | composer.lock 16 | *.sublime-workspace 17 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "8" 4 | cache: yarn 5 | after_success: 6 | - npm run semantic-release 7 | - npm run coveralls 8 | - npm run docs:build 9 | deploy: 10 | provider: pages 11 | skip-cleanup: true 12 | local_dir: docs/.vuepress/dist 13 | github-token: $GH_TOKEN 14 | repo: panter/vue-i18next 15 | keep-history: true 16 | target-branch: gh-pages 17 | on: 18 | branch: master 19 | notifications: 20 | email: false 21 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "javascript.implicitProjectConfig.experimentalDecorators": true, 3 | "eslint.autoFixOnSave": true 4 | } -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to vue-i18next 2 | 3 | ✨ Thanks for contributing to **vue-i18next**! ✨ 4 | 5 | As a contributor, here are the guidelines we would like you to follow: 6 | - [Code of conduct](#code-of-conduct) 7 | - [How can I contribute?](#how-can-i-contribute) 8 | - [Using the issue tracker](#using-the-issue-tracker) 9 | - [Submitting a Pull Request](#submitting-a-pull-request) 10 | - [Coding rules](#coding-rules) 11 | - [Working with the code](#working-with-the-code) 12 | 13 | We also recommend that you read [How to Contribute to Open Source](https://opensource.guide/how-to-contribute). 14 | 15 | ## Code of conduct 16 | 17 | Help us keep **vue-i18next** open and inclusive. Please read and follow our [Code of conduct](CODE_OF_CONDUCT.md). 18 | 19 | ## How can I contribute? 20 | 21 | ### Improve documentation 22 | 23 | As a **vue-i18next** user, you are the perfect candidate to help us improve our documentation: typo corrections, clarifications, more examples, etc. 24 | 25 | ### Give feedback on issues 26 | 27 | Some issues are created without information requested in the [Bug report guideline](#bug-report). Help make them easier to resolve by adding any relevant information. 28 | 29 | ### Fix bugs and implement features 30 | 31 | Confirmed bugs and ready-to-implement features are marked with the [help wanted label](https://github.com/panter/vue-i18next/labels/help%20wanted). Post a comment on an issue to indicate you would like to work on it and to request help from the maintainers and the community. 32 | 33 | ## Using the issue tracker 34 | 35 | The issue tracker is the channel for [bug reports](#bug-report), [features requests](#feature-request) and [submitting pull requests](#submitting-a-pull-request) only. Please use the [Support](docs/support/README.md) and [Get help](README.md#get-help) sections for support, troubleshooting and questions. 36 | 37 | Before opening an issue or a Pull Request, please use the GitHub issue search to make sure the bug or feature request hasn't been already reported or fixed. 38 | 39 | ### Bug report 40 | 41 | A good bug report shouldn't leave others needing to chase you for more information. Please try to be as detailed as possible in your report and fill the information requested in the [Bug report template](https://github.com/semantic-release/semantic-release/issues/new?template=bug-report.md). 42 | 43 | ### Feature request 44 | 45 | Feature requests are welcome, but take a moment to find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible and fill the information requested in the [Feature request template](https://github.com/semantic-release/semantic-release/issues/new?template=feature-request.md). 46 | 47 | ## Submitting a Pull Request 48 | 49 | Good pull requests, whether patches, improvements, or new features, are a fantastic help. They should remain focused in scope and avoid containing unrelated commits. 50 | 51 | 1. [Set up the workspace](#set-up-the-workspace) 52 | 2. If you cloned a while ago, get the latest changes from upstream and update dependencies: 53 | ```bash 54 | $ git checkout master 55 | $ git pull upstream master 56 | $ rm -rf node_modules 57 | $ npm install 58 | ``` 59 | 3. Create a new topic branch (off the main project development branch) to contain your feature, change, or fix: 60 | ```bash 61 | $ git checkout -b 62 | ``` 63 | 4. Make your code changes, following the [Coding rules](#coding-rules) 64 | 5. Push your topic branch up to your fork: 65 | ```bash 66 | $ git push origin 67 | ``` 68 | 6. [Open a Pull Request](https://help.github.com/articles/creating-a-pull-request/#creating-the-pull-request) with a clear title and description. 69 | 70 | **Please ask first** before embarking on any significant pull requests (e.g. implementing features, refactoring code), otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project. 71 | 72 | If you have never created a pull request before, welcome 🎉 😄. [Here is a great tutorial](https://opensource.guide/how-to-contribute/#opening-a-pull-request) on how to send one :) 73 | 74 | Here is a summary of the steps to follow: 75 | 76 | 1. [Set up the workspace](#set-up-the-workspace) 77 | 2. If you cloned a while ago, get the latest changes from upstream and update dependencies: 78 | ```bash 79 | $ git checkout master 80 | $ git pull upstream master 81 | $ rm -rf node_modules 82 | $ npm install 83 | ``` 84 | 3. Create a new topic branch (off the main project development branch) to contain your feature, change, or fix: 85 | ```bash 86 | $ git checkout -b 87 | ``` 88 | 4. Make your code changes, following the [Coding rules](#coding-rules) 89 | 5. Push your topic branch up to your fork: 90 | ```bash 91 | $ git push origin 92 | ``` 93 | 6. [Open a Pull Request](https://help.github.com/articles/creating-a-pull-request/#creating-the-pull-request) with a clear title and description. 94 | 95 | **Tips**: 96 | - For ambitious tasks, open a Pull Request as soon as possible with the `[WIP]` prefix in the title, in order to get feedback and help from the community. 97 | - [Allow semantic-release maintainers to make changes to your Pull Request branch](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork). This way, we can rebase it and make some minor changes if necessary. All changes we make will be done in new commit and we'll ask for your approval before merging them. 98 | 99 | ## Coding rules 100 | 101 | ### Source code 102 | 103 | To ensure consistency and quality throughout the source code, all code modifications must have: 104 | - No [linting](#lint) errors 105 | - A [test](#tests) for every possible case introduced by your code change 106 | - **100%** test coverage 107 | - [Valid commit message(s)](#commit-message-guidelines) 108 | - Documentation for new features 109 | - Updated documentation for modified features 110 | 111 | ### Commit message guidelines 112 | 113 | #### Atomic commits 114 | 115 | If possible, make [atomic commits](https://en.wikipedia.org/wiki/Atomic_commit), which means: 116 | - a commit should contain exactly one self-contained functional change 117 | - a functional change should be contained in exactly one commit 118 | - a commit should not create an inconsistent state (such as test errors, linting errors, partial fix, feature with documentation etc...) 119 | 120 | A complex feature can be broken down into multiple commits as long as each one maintains a consistent state and consists of a self-contained change. 121 | 122 | #### Commit message format 123 | 124 | Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type**, a **scope** and a **subject**: 125 | 126 | ```commit 127 | (): 128 | 129 | 130 | 131 |