@yebu/clideprecated

CLI tool for yebu.io, a service for managing translations

Usage no npm install needed!

<script type="module">
  import yebuCli from 'https://cdn.skypack.dev/@yebu/cli';
</script>

README

 Yebu CLI

CLI tool for yebu.io, a modern modern translation management tool.

 Install

Requires Node 8+.

npm install -g @yebu/cli

 Usage

If you have existing translations in your project run yebu push.

If you have no translations, or have already pushed existing ones to the service you can run yebu pull to receive the latest updates.

The tool will create the following files and directories in your project:

Path Description
.yebu/ For tracking changes, don't add to .gitignore
.yebu-config Config settings, don't add to .gitignore
.yebu-auth Recommended to add to .gitignore so each user logs in and changes are tracked per user

 Supported formats

We currently support:

  • JavaScript (AMD, CommonJS, and ES)
  • JSON

We support flat and nested structures where applicable (your choice).

We're eager to support as many formats as possible. If you have a format which isn't supported get in touch.

 Advanced push & pull

Languages which support annotations (e.g. comments) allow advanced push & pull. This means you will benefit from:

  • Updating entries which already exist in the system.
  • Sophisticated git-like conflict resolution.
  • Ability to modify keys as well as values.

It's highly recommended that you use a format which supports these advanced features (e.g. JavaScript instead of JSON) if possible. The following formats support advanced mode:

  • JavaScript (AMD, CommonJS, and ES modules)

 Simple push & pull

Without annotations it's impossible to update existing entries without risking overriding other updates. Also if you modify a key there is no way to track it and it will be considered a new entry. The following formats can only update non-existing language entries:

  • JSON

For these formats you should make updates to existing entries on yebu.io and run yebu pull to update your files, only new or newly filled in entries will be updated from the CLI.

 Commands

yebu push

Push locale changes to the service.

You should only have language files in your locale folder. These will be automatically picked up and pushed. The names of your files will be used as the names of your languages. If for example you have the following files:

src/locales/en-GB.js
src/locales/fr-FR.js

Those entries will be pushed to en-GB and fr-FR languages. If those languages don't exist they will be created for you.

yebu pull

Pull remote changes from the service.

If you're using a format which supports advanced mode and you have conflicts, the conflicts will be written to the files in the same way that git does.