Localization
Switch component messages, locale conventions and writing direction at runtime through one tree-shakable Signal contract.
APPLICATION SETUP
Configure the initial locale
Pass the initial locale to provideNeuralNg(). English is built in; additional locale packs use granular entry points, so only explicitly imported languages enter the application bundle.
English
@neural-ng/core/locales/enTürkçe
@neural-ng/core/locales/trDeutsch
@neural-ng/core/locales/deFrançais
@neural-ng/core/locales/frEspañol
@neural-ng/core/locales/esPortuguês (Brasil)
@neural-ng/core/locales/pt-brالعربية
@neural-ng/core/locales/ar简体中文
@neural-ng/core/locales/zh-cnAll eight packs fully implement the current message contract. Each is an independent secondary entry point; importing one never bundles the others. Build additional languages with the custom-locale contract below.
Switch language without reloading
The demo below changes the real global locale service. Its Paginator, accessible labels and range report update from the same locale state. The original site locale is restored when you leave this page.
Active locale
en-US
- Direction
- ltr
- First day of week
- 0
- Resolved report
- Showing 1 to 10 of 137 items
Read resolved locale Signals
Components consume readonly Signals rather than copying locale state. Message interpolation is plain text and preserves unknown placeholders.
Create a partial custom locale
A locale needs a canonical language tag and direction. Message groups are partial: define only product-specific translations while every missing entry resolves from the English baseline.
Locale messages are text-only. Never place HTML, scripts or template markup inside translations.
Fallback and precedence
Resolution is deterministic. The nearest explicit component label wins, followed by the active locale and finally the complete English fallback.
Component override
A local labels or locale input for one instance.
Active locale
The current NeuralLocaleService message.
English fallback
The built-in value for every missing message.
Locale direction and document direction
A locale exposes ltr or rtl, but the locale service alone does not mutate the document. Configure provideNeuralNg({ direction: 'auto' }) to let NeuralNgService follow the active locale and apply the native html[dir] contract. Explicit ltr or rtl configuration always wins.
Format dates and numbers with Intl
Use the resolved locale code with browser-native Intl formatters. DatePicker uses the same locale contract for month/day names, field order and first-day-of-week behavior, while its parser remains strict and deterministic.
SSR and hydration must start identically
navigator.language during rendering because an environment-dependent default can produce different text, direction and calendar structure during hydration.