js-gettext

gettext alternative for js

Usage no npm install needed!

<script type="module">
  import jsGettext from 'https://cdn.skypack.dev/js-gettext';
</script>

README

js-gettext

Text extraction from JS sources (js, ts, jsx)

Features

  • Super fast!
  • Outputs gettext compatible pot files or json

Install

npm i --global js-gettext

Usage

  Usage: js-gettext [options] <input> <output>


  Options:

    -V, --version                                     output the version number
    -f, --format <value>                              Output format (pot|json)
    -s, --singular <string>                           Singular translate function
    -p, --plural <string>                             Plural translate function
    -i, --ignore <glob>                               Ignore pattern
    -o, --formatterOptions <key1=value1;key2=value2>  Formatter options
    -v, --verbose                                     Verbose mode
    -h, --help                                        output usage information