In order to use Sleekdocs Translate together with Angular ngx-translate you simply create a custom loader that loads the translations from the Sleekdocs CDN:
export function createTranslateLoader(http: HttpClient) {
// Url prefix from sleekdocs deploy
const urlPrefix = 'https://cdn.sleekdocs.com/c10602cc-0657-4839-89c8-bb9116898b86/dev/';
return new TranslateHttpLoader(http,
urlPrefix,
'.json');
}
@NgModule({
imports: [
BrowserModule,
HttpClientModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [HttpClient]
}
})
],
bootstrap: [AppComponent]
})
export class AppModule { }