5

I'm trying to use "@ngneat/transloco": ^2.17.1" for i18n in my application. It was working fine earlier but i don't know what happened suddenly all of a sudden I get this error message Unable to load translation and all the fallback languages, did you misspelled the scope name? and I'm not able to find out what is wrong.

I have tried to create a similar application in Codesandbox, but it works fine. I have the same kind of code in my app and it doesn't seem to work. Please help if there's any workaround.

enter image description here

HariHaran
  • 3,642
  • 2
  • 16
  • 33

1 Answers1

0

Below code works for me, for transloco i18n. use can use fetch() instead of http get() or import(). But i18n folder and json contents must be in assets folder of angular application.

If you get in this while using it in angular library , add i18n folder and json contents to your main application.

getTranslation(langPath: string) {
    return fetch(`/assets/i18n/${langPath}.json`).then<Translation>((res) => res.json());
}