mirror of
https://github.com/arnaucube/commonroutesApp.git
synced 2026-02-08 03:56:41 +01:00
translation system implemented
This commit is contained in:
@@ -4,7 +4,9 @@
|
||||
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
|
||||
// the 2nd parameter is an array of 'requires'
|
||||
// 'starter.controllers' is found in controllers.js
|
||||
angular.module('starter', ['ionic', 'starter.controllers'])
|
||||
angular.module('starter', ['ionic',
|
||||
'starter.controllers',
|
||||
'pascalprecht.translate'])
|
||||
|
||||
.run(function($ionicPlatform) {
|
||||
$ionicPlatform.ready(function() {
|
||||
@@ -36,7 +38,8 @@ angular.module('starter', ['ionic', 'starter.controllers'])
|
||||
url: '/settings',
|
||||
views: {
|
||||
'menuContent': {
|
||||
templateUrl: 'templates/settings.html'
|
||||
templateUrl: 'templates/settings.html',
|
||||
controller: 'SettingsCtrl'
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -80,4 +83,24 @@ angular.module('starter', ['ionic', 'starter.controllers'])
|
||||
});
|
||||
// if none of the above states are matched, use this as the fallback
|
||||
$urlRouterProvider.otherwise('/app/travels');
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
|
||||
/* translator */
|
||||
.config(['$translateProvider',function($translateProvider) {
|
||||
|
||||
/* get lang from the file translations.js */
|
||||
for(lang in translations){
|
||||
$translateProvider.translations(lang, translations[lang]);
|
||||
}
|
||||
|
||||
if(window.localStorage.getItem('lang')) {
|
||||
$translateProvider.preferredLanguage(window.localStorage.getItem('lang'));
|
||||
}else{
|
||||
$translateProvider.preferredLanguage('english');
|
||||
};
|
||||
|
||||
$translateProvider.useSanitizeValueStrategy('escape');
|
||||
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user