2.0.3 • Published 2 years ago

git18n v2.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Lightweight utility that automates translations management using react-intl (FormatJS).

Installation

yarn add -D git18n

Or with npm:

npm install --save-dev git18n

(Node version 16.5 or higher).

How to use:

  1. Retrieve access token on git18n.com and set as environment variable (GIT18N_SECRET_PROJECT_KEY="your-app-key")

  2. Add translate command to package.json:

"scripts": {
  "translate": "git18n --files 'src/**/*.js*'"
}

Default values for --files and --ignore are:

const DEFAULT_FILES_ARG = '(components|containers|pages|src|modules)/**/*.{ts,tsx,js,jsx}';
const DEFAULT_IGNORE_ARG = '**/*.d.ts';

Additional arguments:

  • --clean removes translation IDs not present in code
  • --prettyLocale formats locale files with line-breaks
  1. Run yarn translate to add new translations (i.e. when submitting a pull request) and when deploying (as part of the build process, e.g. yarn translate && yarn build).

There is no need to yarn translate during development since it just uses the defaultMessage as fallback.

Note: Full docs: https://docs.git18n.com

Please submit questions or bugs to: https://github.com/lassegit/git18n-node

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago