Coder Social home page Coder Social logo

ttag-cli's Introduction

ttag-cli

โš ๏ธ This project was previously named c-3po-cli. Some of the talks, presentations, and documentation may reference it with both names.

Command line utility for ttag translation library

Installation

npm install ttag-cli
# or global
npm install -g ttag-cli

Usage example:

ttag extract some.js

Comands description

extract [output|lang] <src...>

will extract translations to .pot file

Arguments:

-output  --o   result file with translations (.pot)  (default: translations.pot)
-lang  --l   sets default lang (ISO format)  (default: en)

check [lang] <pofile> <src...>

will check if all translations are present in .po file

Arguments:

-lang  --l   sets default lang (ISO format)  (default: en)

merge <path...>

will merge two or more po(t) files together using first non-empty msgstr and header from left-most file

translate <path> [args]

will open interactive prompt to translate all msgids with empty msgstr in cli

Arguments:

-output  --o   result file with translations (.po)  (default: translated.po)

stats <path>

will display various pofile statistics(encoding, plurals, translated, fuzzyness)

filter <path> [args]

will filter pofile by entry attributes(fuzzy, obsolete, (un)translated)

Arguments:

-fuzzy  --f   result file with fuzzy messages (.po)  (default: false)
-no-fuzzy  --nf   result file without fuzzy messages (.po)  (default: false)
-translated  --t   result file with translations (.po)  (default: false)
-not-translated  --nt   result file without translations (.po)  (default: false)
-reference  --r   a regexp to match references against  (default: )

Example:

 ttag filter -nt small.po

 msgid "test"
 msgstr ""

init <lang> <filename>

will create an empty .po file with all necessary headers for the locale

Arguments:

-lang   sets default locale (ISO format)  (default: en)
-filename   path to the .po file  

update [lang] <pofile> <src..>

will update existing po file. Add/remove new translations

Arguments:

-lang   sets default locale (ISO format)  (default: en)
-pofile   path to .po file with translations  
-src   path to source files/directories  

replace <pofile> <out> <path>

will replace all strings with translations from the .po file

color <pofile>

will output po(t)file with pretty colors on, combine with | less -r

spell <pofile> [locale]

will spellcheck po file messages with given locale, locale can be autodetected from pofile

validate <pofile>

will validate js template strings (${x}) in messages and translations and against each other

Please support ttag-cli development by sending issues/PRs.

ttag-cli's People

Contributors

alexmost avatar vharitonsky avatar

Watchers

 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.