Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70900

Ng2-translate - Fallback to default language when file doesn't exist

$
0
0

@dhutton wrote:

Hi,

I have set up ng2-translate which translates my entire app and I have an en-GB.json file which contains all of my translations. The problem I have now is that if the user's device is set to another language (e.g. 'en-US'), I get 404 errors saying that the file en-US.json doesn't exist.

I have tried this solution https://github.com/ocombe/ng2-translate#how-to-handle-missing-translations but it seems that I would have to set up a default value for every single translation which isn't great.

Is there a way to automatically fall back to using the en-GB.json file if en-US.json (and other language files) doesn't exist?

Thanks for any help.

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70900

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>