1

I have an application A1 containing module M1, which uses ngx-translate module. Module M1 is exported by ng-packagr and used by application A2 which also uses ngx-translate module. What i have noticed is TranslateHttpLoader loads the language files from host application. And somehow i want to forcefully use languages provided by the module instead of languages from application.
Is there any way to achieve this?

Sample code in module M1 :

   export function createTranslateLoader(http: HttpClient) {
        return new TranslateHttpLoader(http, './assets/i18n/', '.json');
    }

    @NgModule({
        imports: [
            BrowserModule,
            HttpClientModule,
            TranslateModule.forChild({
                loader: {
                    provide: TranslateLoader,
                    useFactory: (createTranslateLoader),
                    deps: [HttpClient]
                }
            })
        ],
        ...
    })
    export class SomeModule { ... }

Thank You.

Goofy
  • 210
  • 1
  • 3
  • 17

0 Answers0