A compiler plugin for the l10n-tools ecosystem that handles PO/MO file formats for internationalization workflows. Current stable version is 7.0.10, requiring Node >=22.19.0 and npm >=10.9.0. It is part of the l10n-tools monorepo and depends on l10n-tools-core ^8.0.0, which dropped PHP gettext support in v8.0.0 (a breaking change). This package is TypeScript-native, ESM-only, and designed for CLI-based translation compilation. Unlike standalone gettext parsers, it integrates tightly with l10n-tools's pipeline and is intended for use with l10n-tools-cli or programmatically via the core API. Release cadence follows the monorepo's weekly/biweekly schedule.
npm install l10n-tools-compiler-gettextNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Show reading a .po file, compiling it with compileGettext, and writing the .mo output. Minimal setup with TypeScript.
Update l10n-tools-core to ^8.0.0 and ensure your code does not rely on the removed PHP gettext support.
Use a compat shim or preprocess files to remove PHP-specific metadata.
Use import syntax or dynamic import(). Ensure parent package is also ESM or uses a bundler that supports ESM.
Ensure you pass a string. Use parsePo() first if you need to inspect or modify the parsed structure.
Update to latest version and pass options as flat object instead of nested structure.
Use import syntax or dynamic import(). Alternatively, set { type: 'module' } in package.json.Change to: import { compileGettext } from 'l10n-tools-compiler-gettext'Install l10n-tools-core: npm install l10n-tools-core@^8.0.0
Rename file to .mjs or add 'type': 'module' to package.json.