-
-
Notifications
You must be signed in to change notification settings - Fork 591
Closed
Description
Hi,
I'm trying to integrate this library in the starter kit provided by AngularClass:
https://github.com/AngularClass/angular2-webpack-starter.
PatrickJS/PatrickJS-starter#208
The webpack dev server is serving from the src
folder. The translations are defined in
src/assets/i18n
.
It doesn't seem to find the translation files using the provided setup:
export class App {
name = 'Angular 2 Webpack Starter';
url = 'https://twitter.com/AngularClass';
constructor(translate: TranslateService) {
var prefix = 'assets/i18n';
var suffix = '.json';
translate.useStaticFilesLoader(prefix, suffix);
var userLang = navigator.language.split('-')[0]; // use navigator lang if available
userLang = /(nl|fr|en)/gi.test(userLang) ? userLang : 'en';
// optional, default is "en"
translate.setDefaultLang('en');
// the lang to use, if the lang isn't available, it will use the current loader to get them
translate.use(userLang);
}
}
But if I change the configuration to be var prefix = 'src/assets/i18n';
it works.
I'm not sure this is something related to your package or perhaps to the starter kit architecture. So that's why I'll post it and reference it in both projects.
Kr
Sam V.
Metadata
Metadata
Assignees
Labels
No labels