faq.questions
Frequently asked questions
Each answer here traces to this repository's own source code, documentation, or a live npm registry check run while writing this page.
Does this replace Angular's built-in i18n?
No. Angular's built-in i18n (@angular/localize) compiles a separate build per locale from $localize-tagged strings and XLIFF/ARB translation files, resolved once at build time. ngx-runtime-i18n loads catalogs in the browser through a signals-based I18nService instead, so switching a language does not require a new build. Compare against ngx-translate, transloco, and Angular's built-in i18n
Is ICU-lite enough for complex plural rules like Arabic or Russian?
Not out of the box. The default plural resolver only distinguishes a one category (count equal to 1) from other, so Russian's three plural forms and Arabic's six are not produced automatically. formatIcu accepts an optional plural-resolver hook, a (count, locale) => PluralCategory function, so a catalog that needs CLDR-accurate categories has to supply one, typically backed by Intl.PluralRules. ICU-lite parses plural, select, and selectordinal blocks, but it stays a small formatter, not a full ICU MessageFormat implementation. Read the ICU-lite core concepts page
Does it work with server-side rendering?
Yes. provideRuntimeI18nSsr() seeds Angular's TransferState on the server with the same keys the client-side provideRuntimeI18n() reads, so the first client render matches the server-rendered markup and hydration does not re-fetch the catalog or mutate the DOM before the app is stable. Walk through the SSR with Express recipe
Which Angular versions are supported?
@ngx-runtime-i18n/angular, @ngx-runtime-i18n/primeng, and @ngx-runtime-i18n/material each declare a peer dependency of "@angular/core": ">=16 <23", covering Angular 16 through 22 (re-verified against each package's published package.json on npm). @ngx-runtime-i18n/core has no Angular peer dependency at all, so it also runs in any TypeScript project.
Are all six packages published on npm?
Yes. @ngx-runtime-i18n/core, @ngx-runtime-i18n/angular, @ngx-runtime-i18n/primeng, @ngx-runtime-i18n/material, @ngx-runtime-i18n/schematics, and @ngx-runtime-i18n/cli are all published at version 2.1.0, confirmed with npm view against the public registry while writing this page. See the release history
Can I lazy-load translations per route?
Yes. withI18nScope('name') in a route's providers array loads a route-scoped catalog on activation, through the same fetchCatalog function used for the global catalog with a third scope argument, and unloads it automatically via DestroyRef when the route is destroyed. Read the route-scoped catalogs recipe
Does switching languages reload the page?
No. I18nService.setLang() is asynchronous: it fetches the target catalog, cancels any in-flight fetch for a language the user has since navigated away from, and updates the lang signal once the fetch resolves. Every consumer reading that signal re-renders in place, with no location.reload() or full navigation involved.
Is there a way to validate catalogs in CI?
Yes. @ngx-runtime-i18n/cli ships an ngx-i18n check command that scans source for every translation key usage and validates one or more language catalogs against that usage, reporting missing and unused keys. Its --fail-on-missing and --fail-on-unused flags turn either condition into a nonzero exit code for a CI gate. Read the CI catalog validation recipe
Does it work with PrimeNG or Angular Material?
Yes, as separate adapter packages. @ngx-runtime-i18n/primeng listens to I18nService.lang() and applies the matching translation object through PrimeNGConfig. @ngx-runtime-i18n/material keeps Angular Material's paginator, sort, stepper, and datepicker Intl services in sync with the same signal, with no page reload. Read the PrimeNG package docs
What license is it released under?
MIT, listed in the package.json of all six packages.