An issue with loading JSON (language resource) files when the angular-cli build is used
See original GitHub issueI found an issue with loading JSON (language resource) files when the angular-cli build is used and the whole application is put under a subfolder and base href is changed. Currently, 404 Not Found
error is displayed since the library tries to access the file from (<domain>/assets/i18n/en.json
) instead of the (<domain>/subfolder/assets/i18n/en.json
) even though the base href is updated accordingly. The application works fine if I put it in the root folder.
In my opinion, the library should try to prepend the base href in all cases. Just a suggestion. Looking forward to resolving it.
Thanks in advance.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:9
- Comments:15
Top Results From Across the Web
en.json not found error on angular electron - Stack Overflow
json file in the /src/assets/i18n folder. Everything works good on the browser. But when I run electron build, it is failed to load...
Read more >3+ Ways for Reading Local JSON Files with Angular 15
In this post, we'll show you three different methods to read local JSON files in your Angular 15 application, each with an example....
Read more >Work with translation files - Angular
To extract the source language file, complete the following actions. Open a terminal window. Change to the root directory of your project. Run...
Read more >How to translate your Angular app with ngx-translate
1. Add ngx-translate to your Angular application 2. Set up the TranslateService in your app.module.ts 3. Create your main language translation file (in...
Read more >Implementing multi-language Angular applications rendered ...
A few recent comments on the same issue #754 suggest importing the contents of JSON files straight into the file which defines our...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
in app.module.ts make sure that you use this HttpLoaderFactory function:
that fixed this issue for me.
I had the same issue, but changing
"assets": [ "assets", "favicon.ico" ],
to"assets": [ "assets/", "favicon.ico" ],
helped me solved it.