- Copy
index.htmlandlocale-en.jsonto the same directory - From this directory run the
bashcommands below - Open http://127.0.0.1:8080
bower install angular
bower install angular-translate
bower install angular-translate-loader-static-files
npm install http-server
http-serverWhen running the code in the browser two requests will be made for static translation files:
locale-en-US.jsonlocale-en.json
In this case locale-en-US.json results in a 404 since it does not exist on the server. I am using registerAvailableLanguageKeys so I would expect that the first request would not be made. Since this should be aliasing en-US to en.
Now comment out line 22 in index.html (fallbackLanguage) and reload the page. This time only a single request is made for static translation files:
locale-en.json
This solves the problem of the 404 however I now have no fallback language, so if I change preferredLanguage to be de no translation happens and my message ID (HELLO) is shown instead.