Skip to content
POEditor service provider for vue-i18n-locale-message
TypeScript JavaScript
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
.github/workflows
src
test
types
.editorconfig
.eslintignore
.eslintrc.js
.gitignore
.npmignore
CHANGELOG.md
LICENSE
README.md
jest.config.js
package.json
renovate.json
ship.config.js
tsconfig.json
yarn.lock

README.md

poeditor-service-provider

npm CircleCI

POEditor service provider for vue-i18n-locale-message

💿 Installation

$ npm install -g poeditor-service-provider # or npm install --save-dev poeditor-service-provider

due to use this provider, you need to install vue-i18n-locale-message beforehand.

$ npm install -g vue-i18n-locale-message

🚀 Usages

Configurations

Before you use this provider, you need to configure the following:

{
  "provider": {
    "id": "12345", // your POEditor project id
    "token": "xxx..." // your POEditor API token, if it's ommitted, use the value of `POEDITOR_API_TOKEN` ENV
  }
}

About details, See the POEditorProviderConfiguration.

Push the locale messages to POEditor

$ vue-i18n-locale-message push --provider=poeditor-service-provider \
    --conf ./poeditor-service-provider-conf.json \
    --target-paths=./src/locales/*.json \
    --filename-match=^([\\w]*)\\.json

Pull the locale messages from POEditor

$ vue-i18n-locale-message pull --provider=poeditor-service-provider \
    --conf ./poeditor-service-provider-conf.json \
    --output=./src/locales

Indicate translation status from POEditor

$ vue-i18n-locale-message status --provider=poeditor-service-provider \
  --conf=poeditor-service-provider-conf.json

Diff locale messages between local and POEditor

vue-i18n-locale-message diff --provider=poeditor-service-provider \
  --conf=poeditor-service-provider-conf.json \
  --target-paths=./src/locales/*.json \
  --filename-match=^([\\w]*)\\.json

Import the locale messages to POEditor

$ vue-i18n-locale-message import --provider=poeditor-service-provider \
    --conf ./poeditor-service-provider-conf.json \
    --target=./src/locales/ja.json \
    --format=json

Export the locale messages from POEditor

$ vue-i18n-locale-message export --provider=poeditor-service-provider \
    --conf ./poeditor-service-provider-conf.json \
    --output=./src/locales

⚠️ Do you have a hierarchical locale message?

POEditor will process locale messages with hierarchical structure as context.

Therefore, we need to normalize with flat structure , and push it to POEditor.

$ vue-i18n-locale-message push --provider=poeditor-service-provider \
    --conf ./poeditor-service-provider-conf.json \
    --target-paths=./src/locales/*.json \
    --nomalize=flat \
    --filename-match=^([\\w]*)\\.json

And also, when pulling data from POEditor, it need to normalize from flat structure to hierarchical structure.

$ vue-i18n-locale-message pull --provider=poeditor-service-provider \
    --conf ./poeditor-service-provider-conf.json \
    --nomalize=hierarchy \
    --output=./src/locales

©️ License

MIT

You can’t perform that action at this time.