strong-globalize is a JavaScript library for internationalization and localization (often called globalization) within Node.js applications. Currently at version 6.0.6, it provides a comprehensive API for formatting messages, currencies, dates, and numbers, as well as utility wrappers for Node.js console and `util.format`. It builds upon the Unicode CLDR data and the `jquery/globalize` library, offering features like autonomous message loading, runtime language switching, pseudo-localization, and deep string resource extraction from various file types (JSON, YAML, HTML). The library also includes command-line tools for extracting, linting, and translating strings from source code, facilitating a complete globalization workflow. It targets Node.js version 10 and above, ensuring compatibility with modern Node.js environments.
npm install strong-globalizeVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing strong-globalize with a default language, manually adding messages, and utilizing various formatting (messages, currency, date, number) and logging APIs. It also shows runtime language switching.
Upgrade your Node.js environment to version 10.x or newer to ensure compatibility.
Ensure that all necessary CLDR locale data is loaded for your supported languages. This often involves calling `Globalize.load()` from `jquery/globalize` or configuring `SG.SetRootDir` to point to a directory containing CLDR JSON data.
For applications needing dynamic language selection, either create new 'g' instances for each request/context or pass the desired locale explicitly to formatting methods, rather than relying solely on global state.
Verify that the message key (`app.greeting`) exists in your locale-specific message files (e.g., `en.json`, `en.yaml`) and that `SG.SetRootDir` is pointing to the correct directory. Also, ensure messages are added via `SG.addMessages` if managed programmatically.
Ensure that you are importing 'g' correctly (e.g., `import g from 'strong-globalize';` or `const g = require('strong-globalize');` in CommonJS) and that the library is fully initialized before attempting to call its methods.Install and explicitly load the required CLDR data for all locales your application supports. This often involves using `Globalize.load(cldrData)` from `jquery/globalize` after retrieving the appropriate CLDR JSON files. Check the `strong-globalize` documentation for guidance on automatic CLDR data loading if configured with `SG.SetRootDir`.
No dependency data recorded yet.