I'm working with angular-tranlate.
I got it working with the $translateProvider.translations('en', en_translations); where en_translations is the json with the mapping.
Now I'm having a problem when trying to use static files:
$translateProvider.preferredLanguage('en');
$translateProvider.useStaticFilesLoader({
prefix: 'locale-',
suffix: '.json'
});
I'm receiving this error:
Error: Unknown provider: $translateStaticFilesLoaderProvider <- $translateStaticFilesLoader
throw Error("Unknown provider: " + path.join(' <- '));
I have my locale-en.json file in the same location as the scrips file. and it looks like this:
{
"WELCOME": "Welcome",
"LANG": {
"LABEL": "Language",
"EN": "English",
"ES": "Spanish"
},
"LOGOFF": "Log Off",
"PROFILE": "Profile"
}
Any ideas?? thanks!!
you need to add the static files loader js to your index file. you can find it here
just put this in index.html
<script src="js/libs/angular/angular-translate-loader-static-files.min.js"></script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With