npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@transifex/cli

v7.1.3

Published

i18n CLI tool for Transifex Native

Downloads

88,036

Readme

Transifex Native SDK: JavaScript i18n CLI tool

A command line tool that parses .js, .ts, .jsx, .tsx and .html source files, extracts phrases marked for localization by Transifex Native and pushes them to Transifex for translation.

Related packages:

Learn more about Transifex Native in the Transifex Developer Hub.

cli

Upgrade to v2

If you are upgrading from the 1.x.x version, please read this migration guide, as there are breaking changes in place.

Usage

Global installation

$ npm install -g @transifex/cli

$ txjs-cli COMMAND
running command...

$ txjs-cli --help [COMMAND]
USAGE
  $ txjs-cli COMMAND
...

Local installation in existing codebase

Install to local repo using npm.

$ npm install @transifex/cli --save

$ ./node_modules/.bin/txjs-cli COMMAND
running command...

Add it as a script command in package.json.

  ...
  "scripts": {
    "push": "txjs-cli push src/",
    ...
  },

Push content using npm.

$ npm run push

Commands

txjs-cli help [COMMAND]

Display help for txjs-cli

USAGE
  $ txjs-cli help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

txjs-cli push [PATTERN]

detect and push source content to Transifex

USAGE
  $ txjs-cli push [PATTERN] [--dry-run] [--fake] [-v] [--purge] [--no-wait] [--token <value>] [--secret <value>] [--append-tags <value>] [--with-tags-only <value>] [--without-tags-only <value>]
    [--cds-host <value>] [--do-not-keep-translations] [--override-tags] [--override-occurrences] [--parser auto|i18next|txnativejson] [--key-generator source|hash]

ARGUMENTS
  PATTERN  [default: **/*.{js,jsx,ts,tsx,html,vue,pug,ejs}] file pattern to scan for strings

FLAGS
  -v, --verbose                verbose output
  --append-tags=<value>        append tags to strings
  --cds-host=<value>           CDS host URL
  --do-not-keep-translations   remove translations when source strings change
  --dry-run                    dry run, do not apply changes in Transifex
  --fake                       do not push content to remote server
  --key-generator=<option>     [default: source] use hashed or source based keys
                               <options: source|hash>
  --no-wait                    disable polling for upload results
  --override-occurrences       override occurrences when pushing content
  --override-tags              override tags when pushing content
  --parser=<option>            [default: auto] file parser to use
                               <options: auto|i18next|txnativejson>
  --purge                      purge content on Transifex
  --secret=<value>             native project secret
  --token=<value>              native project public token
  --with-tags-only=<value>     push strings with specific tags
  --without-tags-only=<value>  push strings without specific tags

DESCRIPTION
  Detect and push source content to Transifex
  Parse .js, .ts, .jsx, .tsx and .html files and detect phrases marked for
  translation by Transifex Native toolkit for Javascript and
  upload them to Transifex for translation.

  To push content some environment variables must be set:
  TRANSIFEX_TOKEN=<Transifex Native Project Token>
  TRANSIFEX_SECRET=<Transifex Native Project Secret>
  (optional) TRANSIFEX_CDS_HOST=<CDS HOST>

  or passed as --token=<TOKEN> --secret=<SECRET> parameters

  Default CDS Host is https://cds.svc.transifex.net

  Examples:
  txjs-cli push -v
  txjs-cli push src/
  txjs-cli push /home/repo/src
  txjs-cli push "*.js"
  txjs-cli push --dry-run
  txjs-cli push --fake -v
  txjs-cli push --no-wait
  txjs-cli push --key-generator=hash
  txjs-cli push --append-tags="master,release:2.5"
  txjs-cli push --with-tags-only="home,error"
  txjs-cli push --without-tags-only="custom"
  txjs-cli push --token=mytoken --secret=mysecret
  txjs-cli push en.json --parser=i18next
  txjs-cli push en.json --parser=txnativejson
  TRANSIFEX_TOKEN=mytoken TRANSIFEX_SECRET=mysecret txjs-cli push

txjs-cli pull [PATTERN]

Pull content from Transifex for offline caching

USAGE
  $ txjs-cli pull [--token <value>] [--secret <value>] [-f <value>] [-l <value>] [--pretty] [--filter-tags <value>] [--filter-status reviewed|proofread|finalized] [--cds-host <value>]

FLAGS
  -f, --folder=<value>      output as files to folder
  -l, --locale=<value>      pull specific language locale code
  --cds-host=<value>        CDS host URL
  --filter-status=<option>  filter over translation status
                            <options: reviewed|proofread|finalized>
  --filter-tags=<value>     filter over specific tags
  --pretty                  beautify JSON output
  --secret=<value>          native project secret
  --token=<value>           native project public token

DESCRIPTION
  Pull content from Transifex for offline caching
  Get content as JSON files, to be used by mobile Javascript SDKs for
  offline support or warming up the cache with initial translations.

  By default, JSON files are printed in the console,
  unless the "-f foldername" parameter is provided. In that case
  the JSON files will be downloaded to that folder with the <locale>.json format.

  To pull content some environment variables must be set:
  TRANSIFEX_TOKEN=<Transifex Native Project Token>
  TRANSIFEX_SECRET=<Transifex Native Project Secret>
  (optional) TRANSIFEX_CDS_HOST=<CDS HOST>

  or passed as --token=<TOKEN> --secret=<SECRET> parameters

  Default CDS Host is https://cds.svc.transifex.net

  Examples:
  txjs-cli pull
  txjs-cli pull --pretty
  txjs-cli pull -f languages/
  txjs-cli pull --locale=fr -f .
  txjs-cli pull --filter-tags="foo,bar"
  txjs-cli pull --filter-status="reviewed"
  txjs-cli pull --token=mytoken --secret=mysecret
  TRANSIFEX_TOKEN=mytoken TRANSIFEX_SECRET=mysecret txjs-cli pull

txjs-cli invalidate

invalidate and refresh CDS cache

USAGE
  $ txjs-cli invalidate [--purge] [--token <value>] [--secret <value>] [--cds-host <value>]

FLAGS
  --cds-host=<value>  CDS host URL
  --purge             force delete CDS cached content
  --secret=<value>    native project secret
  --token=<value>     native project public token

DESCRIPTION
  Invalidate and refresh CDS cache
  Content for delivery is cached in CDS and refreshed automatically every hour.
  This command triggers a refresh of cached content on the fly.

  By default, invalidation does not remove existing cached content,
  but starts the process of updating with latest translations from Transifex.

  Passing the --purge option, cached content will be forced to be deleted,
  however use that with caution, as it may introduce downtime of
  translation delivery to the apps until fresh content is cached in the CDS.

  To invalidate translations some environment variables must be set:
  TRANSIFEX_TOKEN=<Transifex Native Project Token>
  TRANSIFEX_SECRET=<Transifex Native Project Secret>
  (optional) TRANSIFEX_CDS_HOST=<CDS HOST>

  or passed as --token=<TOKEN> --secret=<SECRET> parameters

  Default CDS Host is https://cds.svc.transifex.net

  Examples:
  txjs-cli invalidate
  txjs-cli invalidate --purge
  txjs-cli invalidate --token=mytoken --secret=mysecret
  TRANSIFEX_TOKEN=mytoken TRANSIFEX_SECRET=mysecret txjs-cli invalidate

License

Licensed under Apache License 2.0, see LICENSE file.