@localeguard/core
v0.5.0
Published
Core localization checks for LocaleGuard: locale parsing, key comparison, and interpolation validation.
Maintainers
Readme
@localeguard/core
Core localization checks for LocaleGuard —
the engine behind the localeguard CLI. Zero runtime dependencies.
Provides:
- A JSON parser that reports duplicate keys and syntax errors with line numbers
- Key flattening and source-vs-target key comparison
- Interpolation validation for
{{double-brace}}(i18next) and{single-brace}(ICU / react-intl), with ICUplural/selecthandled conservatively - Text and JSON reporters
Most users should install the localeguard
CLI rather than this package directly.
import { runCheck, formatText } from "@localeguard/core";
const result = runCheck(
{ sourceLocale: "en", locales: ["fr"], localesPath: "public/locales" },
{ rootDir: process.cwd() },
);
console.log(formatText(result, { color: true }));
process.exitCode = result.stats.failed ? 1 : 0;See the main README for full docs.
