I am new to angular-translate in my Angular app.
Requirement :
I have to create a multi language application in AngularJS
where user has an option to set his language. So, for that I have to load translations from files and save that preferred language in localStorage
.
So that if the user comes again to access the application he will be displayed the previously set language.
What i have done so far :
Loaded translations from files by using $translateProvider.useStaticFilesLoader
Code :
var app = angular.module("myLangApp", ['pascalprecht.translate'])
app.config(function($translateProvider) {
$translateProvider.useStaticFilesLoader({
prefix: 'languages/',
suffix: '.json'
});
$translateProvider.useLocalStorage();
});
Application works fine if I comment this line:
// $translateProvider.useLocalStorage();
But if I use it, I am getting this error on the console:
I have also included the angular-translate-storage-local.min.js
file in my index.html
.But no success.
I have also seen these questions in SO, but they don't help: Angular-translate's localStorage: Unknown provider: $translateLocalStorageProvider
Any immediate help will be highly appreciable. Thanks