Search code examples
transloco

How to add Transloco translation files in production mode?


I got an error when running my app in IIS: myServer/assets/i18n/de.json not found. How to add the Transloco translation files in production mode?


Solution

  • Adding a fullstop to ./assets/i18n in transloco-root.module.ts fixed my problem.

    getTranslation(lang: string) {
        return this.http.get<Translation>(`./assets/i18n/${lang}.json`);}