问题描述
在 IIS 中运行我的应用程序时出现错误:myServer/assets/i18n/de.json not found
。如何在生产模式下添加 Transloco 翻译文件?
解决方法
在 transloco-root.module.ts 中向 ./assets/i18n 添加句号解决了我的问题。
getTranslation(lang: string) {
return this.http.get<Translation>(`./assets/i18n/${lang}.json`);}