@razmooo/translator

0.2.6 • Public • Published

Translator

Translator is a tool for generating translation files for Nuxt.js i18n package. It will scan all .vue, .js and .ts files in /pages, /components and /layouts directories for

$t('<insert translate tag here>')
ex.
$t('about.team')

If the tag does not exist, it will be created in translation's JSON file with an empty ("") value.

Features!

  • Generate new translation files or update existing ones.
  • Never miss a forgotten translation

Installation

Install with npm or yarn

npm install @razmooo/translator --save-dev
yarn add @razmooo/translator --dev

How to use

To create a new translation file with empty values just execute:

translator

If you want to update non-existing values in a existing translation file:

yarn translator --file-output path/to/file

Example

If you have a json files with translations in lang folder, you can specify the json file, which will be updated.

yarn translator --file-output lang/en-US.json

Help

Type yarn translator --help for help output.

Package Sidebar

Install

npm i @razmooo/translator

Weekly Downloads

3

Version

0.2.6

License

MIT

Unpacked Size

10.8 kB

Total Files

17

Last publish

Collaborators

  • razmooo