Registry / devops / strong-globalize-cli

strong-globalize-cli

JSON →
library7.1.1jsnpmunverified

strong-globalize-cli is a command-line interface tool designed to facilitate the globalization of JavaScript applications. Its primary functions include extracting translatable text messages from JavaScript and HTML source code, linting message files to identify potential issues, and integrating with IBM Globalization Pipeline for automated machine translation. The current stable version is 7.1.1, supporting Node.js versions 10.x and above. The tool distinguishes itself with both 'regular extraction' for package development and 'deep extraction' for enterprise-scale applications, allowing comprehensive identification of all literal strings—globalized or not—within a codebase. Its release cadence is tied to updates in globalization features or the underlying IBM Cloud services it integrates with.

npm install strong-globalize-cli
INSTALL
IMPORT
SIG · STRONG-GLOBALIZE-C
S
strong-globalize-cli
devopsjavascriptv7.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Demonstrates global installation, basic string extraction, linting, and translation via the command-line interface.

npm install -g strong-globalize-cli # Create a sample JavaScript file echo "const g = require('strong-globalize'); g.log('Hello, World!');" > app.js # Extract strings (creates intl/en/messages.json and intl/zz/messages.json) slt-globalize -e # Lint the extracted messages file slt-globalize -l # Configure IBM Globalization Pipeline credentials via environment variables export BLUEMIX_URL="${process.env.BLUEMIX_URL ?? 'https://gp-beta-rest.ng.bluemix.net/translate/rest'}" export BLUEMIX_USER="${process.env.BLUEMIX_USER ?? 'your-user-id'}" export BLUEMIX_PASSWORD="${process.env.BLUEMIX_PASSWORD ?? 'your-password'}" export BLUEMIX_INSTANCE="${process.env.BLUEMIX_INSTANCE ?? 'your-instance-id'}" # Translate strings using Globalization Pipeline (requires credentials setup) slt-globalize -t
strong-globalize --version
Debug
Known issues
gotchaThe `slt-globalize` command requires Node.js version 10.x or higher. Earlier Node.js versions are not supported and may lead to unexpected behavior or errors.
fix
Upgrade your Node.js environment to version 10.x or later.
affects: <10.0.0
gotchaTo utilize the translation feature (`slt-globalize -t`), access credentials for IBM Globalization Pipeline on IBM Cloud must be provided. This can be done either through environment variables (BLUEMIX_URL, BLUEMIX_USER, BLUEMIX_PASSWORD, BLUEMIX_INSTANCE) or by placing a `ibm-cloud-credentials.json` file in your home directory's `.strong-globalize` folder.
fix
Set the required BLUEMIX_* environment variables or create `~/.strong-globalize/ibm-cloud-credentials.json` with valid IBM Cloud Globalization Pipeline credentials.
affects: >=1.0.0
gotchaThe `extract` mode (`-e`) and `deepextract` mode (`-d`) serve different purposes. Regular extraction (`-e`) is typically for package development, while deep extraction (`-d`) is designed for enterprise-scale applications and includes non-globalized literal strings in `intl/zz/messages.json` to help identify untranslated content.
fix
Choose the appropriate extraction mode based on your project's scope and needs. Use `-e` for typical package string extraction and `-d` for a more comprehensive scan including potentially untranslated strings.
affects: >=1.0.0
Errors
Common errors & fixes
slt-globalize: command not found
The `strong-globalize-cli` package was not installed globally, or its executable path is not in your system's PATH.
fix
Install the package globally using `npm install -g strong-globalize-cli`.
Error: IBM Cloud credentials are not provided or invalid when running `slt-globalize -t`.
The CLI could not find or validate the necessary credentials for the IBM Globalization Pipeline service.
fix
Ensure `BLUEMIX_URL`, `BLUEMIX_USER`, `BLUEMIX_PASSWORD`, and `BLUEMIX_INSTANCE` environment variables are set, or that `~/.strong-globalize/ibm-cloud-credentials.json` exists and contains valid credentials.
Error: Failed to parse messages.json: Unexpected token ...
The `messages.json` file (e.g., `intl/en/messages.json`) contains malformed JSON, often due to manual edits or an issue during extraction.
fix
Manually inspect and correct the syntax errors in the specified `messages.json` file, or re-run `slt-globalize -e` to regenerate it if no manual changes were intended.
Upgrade
Version history
7.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
strong-globalize-cli — npm install strong-globalize-cli · libregistry