Giter Site home page Giter Site logo

mirego / accent-cli Goto Github PK

View Code? Open in Web Editor NEW
8.0 37.0 5.0 198 KB

Sync, merge and export with the Accent API.

Home Page: https://www.accent.reviews

License: BSD 3-Clause "New" or "Revised" License

JavaScript 0.37% Batchfile 0.12% TypeScript 99.51%
accent i18n

accent-cli's Introduction

Accent CLI

Version Build Status

Usage

$ npm install -g accent-cli
$ accent COMMAND
running command...
$ accent (-v|--version|version)
accent-cli/0.6.0 darwin-x64 node-v9.5.0
$ accent --help [COMMAND]
USAGE
  $ accent COMMAND
...

Configuration

accent-cli reads from a accent.json file. The file should contain valid JSON representing the configuration of your project.

Example

{
  "apiUrl": "http://your.accent.instance",
  "apiKey": "2nziVSaa8yUJxLkwoZA",
  "files": [
    {
      "language": "fr",
      "format": "json",
      "source": "localization/fr/*.json",
      "target": "localization/%slug%/%original_file_name%.json",
      "hooks": {
        "afterSync": "touch sync-done.txt"
      }
    }
  ]
}

Document configuration

Each operation section sync and addTranslations can contain the following object:

  • language: The identifier of the document’s language
  • format: The format of the document
  • source: The path of the document. This can contain glob pattern (See [the node glob library] used as a dependancy (https://github.com/isaacs/node-glob))
  • target: Path of the target languages
  • hooks: List of hooks to be run

Hooks

Here is a list of available hooks. Those are self-explanatory

  • beforeSync
  • afterSync
  • beforeExport
  • afterExport

Commands

accent export

Export files from Accent and write them to your local filesystem

USAGE
  $ accent export

OPTIONS
  --order-by=index|key-asc  [default: index] Will be used in the export call as the order of the keys

EXAMPLE
  $ accent export

accent help [COMMAND]

display help for accent

USAGE
  $ accent help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

accent jipt PSEUDOLANGUAGENAME

Export jipt files from Accent and write them to your local filesystem

USAGE
  $ accent jipt PSEUDOLANGUAGENAME

ARGUMENTS
  PSEUDOLANGUAGENAME  The pseudo language for in-place-translation-editing

EXAMPLE
  $ accent jipt

accent stats

Fetch stats from the API and display it beautifully

USAGE
  $ accent stats

EXAMPLE
  $ accent stats

accent sync

Sync files in Accent and write them to your local filesystem

USAGE
  $ accent sync

OPTIONS
  --add-translations                Add translations in Accent to help translators if you already have translated
                                    strings

  --merge-type=smart|passive|force  [default: smart] Will be used in the add translations call as the "merge_type" param

  --order-by=index|key-asc          [default: index] Will be used in the export call as the order of the keys

  --sync-type=smart|passive         [default: smart] Will be used in the sync call as the "sync_type" param

  --write                           Write the file from the export _after_ the operation

EXAMPLE
  $ accent sync

License

accent-cli is © 2019 Mirego and may be freely distributed under the New BSD license. See the LICENSE.md file.

About Mirego

Mirego is a team of passionate people who believe that work is a place where you can innovate and have fun. We’re a team of talented people who imagine and build beautiful Web and mobile applications. We come together to share ideas and change the world.

We also love open-source software and we try to give back to the community as much as we can.

accent-cli's People

Contributors

louim avatar remi avatar simonprev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.