-
-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translation file not found #1099
Comments
We have a similar issue on ng version 8. The translation files cannot be found, but same configuration works on a version 7 project. |
We have the same issue with V8 and Nativescript |
For anyone having a similar issue, this might be your solution. Please have a look and check. It solved the problem for me: |
I'm getting the following error
I'm having the following
|
any news about this issue? |
@DepickereSven export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, 'assets/i18n/', '.json');
}
@NgModule({
declarations: [
AppComponent,
HomeComponent,
],
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
HttpClientModule,
GraphQLModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: createTranslateLoader,
deps: [HttpClient]
}
})
],
providers: [
AuthService,
{provide: HTTP_INTERCEPTORS, useClass: InterceptorService, multi: true},
],
bootstrap: [AppComponent]
})
export class AppModule {
constructor(
private translate: TranslateService,
) {
this.translate.setDefaultLang('en');
translate.use('en');
}
}
the en.json is in src/assets/i18n |
I have this error happens randomly in production in error logging. Error: Http failure response for ./assets/en.json: 0 Unknown Error |
Hello,
I am trying to use the plugin in nativescript with shared functionality of web and native code in angular 7. I have already used in previous NS projects, but I'm not able to get the proper paths for the jSON files, please help.
This is the required code.
import { HttpClientModule, HttpClient } from "@angular/common/http";
mport { TranslateModule, TranslateLoader } from "@ngx-translate/core";
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
....
export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, "./assets/i18n/", ".json");
}
imports: [
...
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: createTranslateLoader,
deps: [HttpClient]
}
})
]
This is the error I am receiving...
CONSOLE ERROR file:///app/vendor.js:51832:24: ERROR {
"headers": {
"normalizedNames": {},
"lazyUpdate": null,
"headers": {}
},
"status": 0,
"statusText": "Unknown Error",
"url": "./assets/i18n/en.json",
"ok": false,
"name": "HttpErrorResponse",
"message": "Http failure response for ./assets/i18n/en.json: 0 Unknown Error",
"error": {
"line": 84573,
"column": 38,
"sourceURL": "file:///app/vendor.js",
"originalStack": "ZoneAwareError@file:///app/vendor.js:84573:38\nfile:///app/vendor.js:108252:37\nUIApplicationMain@[native code]\nstart@file:///app/vendor.js:103098:26\nrun@file:///app/vendor.js:103126:10\nbootstrapNativeScriptApp@file:///app/vendor.js:79967:26\nbootstrapApp@file:///app/vendor.js:79868:38\nbootstrapModule@file:///app/vendor.js:79852:26\nfile:///app/bundle.js:2014:144\n./main.ts@file:///app/bundle.js:2019:34\n__webpack_require__@file:///app/bundle.js:752:34\ncheckDeferredModules@file:///app/bundle.js:45:42\nfile:///app/bundle.js:828:38\nanonymous@file:
Been stuck in it for the last 2 hours, don't know what i'm missing here, please help.
The text was updated successfully, but these errors were encountered: