{"id":17966,"library":"strong-globalize-cli","title":"StrongLoop Globalize CLI","description":"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.","status":"active","version":"7.1.1","language":"javascript","source_language":"en","source_url":"git://github.com/strongloop/strong-globalize","tags":["javascript","StrongLoop","globalize","cldr"],"install":[{"cmd":"npm install strong-globalize-cli","lang":"bash","label":"npm"},{"cmd":"yarn add strong-globalize-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add strong-globalize-cli","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[],"quickstart":{"code":"npm install -g strong-globalize-cli\n\n# Create a sample JavaScript file\necho \"const g = require('strong-globalize'); g.log('Hello, World!');\" > app.js\n\n# Extract strings (creates intl/en/messages.json and intl/zz/messages.json)\nslt-globalize -e\n\n# Lint the extracted messages file\nslt-globalize -l\n\n# Configure IBM Globalization Pipeline credentials via environment variables\nexport BLUEMIX_URL=\"${process.env.BLUEMIX_URL ?? 'https://gp-beta-rest.ng.bluemix.net/translate/rest'}\"\nexport BLUEMIX_USER=\"${process.env.BLUEMIX_USER ?? 'your-user-id'}\"\nexport BLUEMIX_PASSWORD=\"${process.env.BLUEMIX_PASSWORD ?? 'your-password'}\"\nexport BLUEMIX_INSTANCE=\"${process.env.BLUEMIX_INSTANCE ?? 'your-instance-id'}\"\n\n# Translate strings using Globalization Pipeline (requires credentials setup)\nslt-globalize -t","lang":"javascript","description":"Demonstrates global installation, basic string extraction, linting, and translation via the command-line interface."},"warnings":[{"fix":"Upgrade your Node.js environment to version 10.x or later.","message":"The `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.","severity":"gotcha","affected_versions":"<10.0.0"},{"fix":"Set the required BLUEMIX_* environment variables or create `~/.strong-globalize/ibm-cloud-credentials.json` with valid IBM Cloud Globalization Pipeline credentials.","message":"To 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.","severity":"gotcha","affected_versions":">=1.0.0"},{"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.","message":"The `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.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-23T00:00:00.000Z","next_check":"2026-07-22T00:00:00.000Z","problems":[{"fix":"Install the package globally using `npm install -g strong-globalize-cli`.","cause":"The `strong-globalize-cli` package was not installed globally, or its executable path is not in your system's PATH.","error":"slt-globalize: command not found"},{"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.","cause":"The CLI could not find or validate the necessary credentials for the IBM Globalization Pipeline service.","error":"Error: IBM Cloud credentials are not provided or invalid when running `slt-globalize -t`."},{"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.","cause":"The `messages.json` file (e.g., `intl/en/messages.json`) contains malformed JSON, often due to manual edits or an issue during extraction.","error":"Error: Failed to parse messages.json: Unexpected token ..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}