Open YZahringer opened 4 years ago
Does this code snippet help you?
import { registerLocaleData } from '@angular/common';
/**
* Load the appropriate locale
*/
async function initializeLocale(localeId: string): Promise<void> {
return import(
/* webpackMode: "lazy-once" */
`@angular/common/locales/${localeId}.js`
).then((localeModule) => registerLocaleData(localeModule.default));
}
Then you can call it where you load the translations with locl:
await initializeLocale(translations.locale);
It would be useful to be able to load the
locale
data at bootstrap at the same time of translations.The solution documented here could be integrated/supported by
locl
? A better solution is now available with Angular 9 and$localize
?