我有一个多语言应用程序,每种语言都使用--aot编译,例如德语:
ng build --aot --env=prod --prod --build-optimizer --i18nFile=src/locale/DARI_messages_de_DE.xlf --i18nFormat=xlf --locale=de --missingTranslation warning --output-path dist/de --base-href /de/
我们需要在运行时获取本地化值,以便将其传递给后端处理。
如果您已经尝试从中获取
import { LOCALE_ID } from '@angular/core';
constructor(private modalService: BsModalService) {
console.log("LOCALE_ID", LOCALE_ID);
}
但是我认为LOCAL_ID是空的,我认为它仅用于JIT
有没有方法在运行时获取此参数?