@primeuix/locale
v0.1.0
Published
Locale utilities for PrimeUI Libraries
Downloads
1,961
Readme
PrimeUIX Locale
Shared locale and i18n layer for PrimeUI libraries. Manages language registration, switching, and translation lookup through a singleton instance so locale state is consistent across PrimeVue, PrimeReact, and PrimeNG within the same application.
Locales are deep-merged against a fallback language, so partial translations are safe — only the keys that differ need to be provided.
import Locale from '@primeuix/locale';
Locale.init({
lang: 'de',
fallback: 'en',
locales: { en: { accept: 'Accept' }, de: { accept: 'Akzeptieren' } }
});
Locale.use('de');
Locale.get(); // { accept: 'Akzeptieren' }Language changes emit a locale:change event via LocaleService, which Prime framework libraries listen to in order to trigger re-renders.
License
Licensed under the PrimeUI License - Copyright (c) PrimeTek Informatics
