Skip to content
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

Ngx-translate: ..assets/i18n/ja.json: 404 Not Found after deployment #1478

Open
ShreyaGLMS opened this issue Apr 12, 2024 · 0 comments
Open

Comments

@ShreyaGLMS
Copy link

I am using below code for transkation.
It's totally working fine on localhost but when I deploy this on dev environment it's giving me below error.
Translate error

Build created for publish also showing the json files and uloaded succesfully on server.
Can anyone help me with this issue.

angular 12
ngx-translate/core@13.0.0
@ngx-translate/http-loader@6.0.0

....
import { HttpClient } from '@angular/common/http';
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';

export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
}

@NgModule({
declarations: [
...
],
imports: [
...
...
TranslateModule.forRoot(
{
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}
)
],
providers: [ HttpClient,
{
provide: LocationStrategy,
useClass: HashLocationStrategy,
},
{ provide: HTTP_INTERCEPTORS, useClass: MyInterceptor, multi: true } ],
bootstrap: [AppComponent],
})
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant