03/04: translate datePicker
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See http://git.chorem.org/pollen.git commit b521eedaaebb8549e77842b524e322fb477d83c4 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Wed Jul 9 15:09:26 2014 +0200 translate datePicker --- pollen-ui-angular/src/main/webapp/i18n/en.js | 95 +++++++++++++++++++++ pollen-ui-angular/src/main/webapp/i18n/fr.js | 96 ++++++++++++++++++++++ .../src/main/webapp/js/controllers/localeCtrl.js | 21 ++++- 3 files changed, 211 insertions(+), 1 deletion(-) diff --git a/pollen-ui-angular/src/main/webapp/i18n/en.js b/pollen-ui-angular/src/main/webapp/i18n/en.js index 38d01f0..8ae450a 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/en.js +++ b/pollen-ui-angular/src/main/webapp/i18n/en.js @@ -119,3 +119,98 @@ var translateEN = { } +var i18n_EN = { + "DATETIME_FORMATS": { + "AMPMS": [ + "AM", + "PM" + ], + "DAY": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + "MONTH": [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ], + "SHORTDAY": [ + "Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat" + ], + "SHORTMONTH": [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" + ], + "fullDate": "EEEE, MMMM d, y", + "longDate": "MMMM d, y", + "medium": "MMM d, y h:mm:ss a", + "mediumDate": "MMM d, y", + "mediumTime": "h:mm:ss a", + "short": "M/d/yy h:mm a", + "shortDate": "M/d/yy", + "shortTime": "h:mm a" + }, + "NUMBER_FORMATS": { + "CURRENCY_SYM": "$", + "DECIMAL_SEP": ".", + "GROUP_SEP": ",", + "PATTERNS": [ + { + "gSize": 3, + "lgSize": 3, + "macFrac": 0, + "maxFrac": 3, + "minFrac": 0, + "minInt": 1, + "negPre": "-", + "negSuf": "", + "posPre": "", + "posSuf": "" + }, + { + "gSize": 3, + "lgSize": 3, + "macFrac": 0, + "maxFrac": 2, + "minFrac": 2, + "minInt": 1, + "negPre": "(\u00a4", + "negSuf": ")", + "posPre": "\u00a4", + "posSuf": "" + } + ] + }, + "id": "en", + "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} +} diff --git a/pollen-ui-angular/src/main/webapp/i18n/fr.js b/pollen-ui-angular/src/main/webapp/i18n/fr.js index 85aab6a..86bccd4 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/fr.js +++ b/pollen-ui-angular/src/main/webapp/i18n/fr.js @@ -119,3 +119,99 @@ var translateFR = { } +var i18n_FR = { + "DATETIME_FORMATS": { + "AMPMS": [ + "AM", + "PM" + ], + "DAY": [ + "dimanche", + "lundi", + "mardi", + "mercredi", + "jeudi", + "vendredi", + "samedi" + ], + "MONTH": [ + "janvier", + "f\u00e9vrier", + "mars", + "avril", + "mai", + "juin", + "juillet", + "ao\u00fbt", + "septembre", + "octobre", + "novembre", + "d\u00e9cembre" + ], + "SHORTDAY": [ + "dim.", + "lun.", + "mar.", + "mer.", + "jeu.", + "ven.", + "sam." + ], + "SHORTMONTH": [ + "janv.", + "f\u00e9vr.", + "mars", + "avr.", + "mai", + "juin", + "juil.", + "ao\u00fbt", + "sept.", + "oct.", + "nov.", + "d\u00e9c." + ], + "fullDate": "EEEE d MMMM y", + "longDate": "d MMMM y", + "medium": "d MMM y HH:mm:ss", + "mediumDate": "d MMM y", + "mediumTime": "HH:mm:ss", + "short": "dd/MM/yy HH:mm", + "shortDate": "dd/MM/yy", + "shortTime": "HH:mm" + }, + "NUMBER_FORMATS": { + "CURRENCY_SYM": "\u20ac", + "DECIMAL_SEP": ",", + "GROUP_SEP": "\u00a0", + "PATTERNS": [ + { + "gSize": 3, + "lgSize": 3, + "macFrac": 0, + "maxFrac": 3, + "minFrac": 0, + "minInt": 1, + "negPre": "-", + "negSuf": "", + "posPre": "", + "posSuf": "" + }, + { + "gSize": 3, + "lgSize": 3, + "macFrac": 0, + "maxFrac": 2, + "minFrac": 2, + "minInt": 1, + "negPre": "(", + "negSuf": "\u00a0\u00a4)", + "posPre": "", + "posSuf": "\u00a0\u00a4" + } + ] + }, + "id": "fr", + "pluralCat": function (n) { if (n >= 0 && n <= 2 && n != 2) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} +} + diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/localeCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/localeCtrl.js index 9805d8b..524e3ef 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/localeCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/localeCtrl.js @@ -19,9 +19,23 @@ * #L% */ angular.module('localeControllers', []) -.controller('LocaleCtrl', ['$scope', '$rootScope', '$translate', 'SessionStorage',function ($scope, $rootScope, $translate, SessionStorage) { +.controller('LocaleCtrl', ['$scope', '$rootScope', '$translate', 'SessionStorage', '$locale', function ($scope, $rootScope, $translate, SessionStorage, $locale) { $scope.debug = conf.debug; $scope.locale = SessionStorage.get().locale; + + var locales = []; + locales['fr'] = i18n_FR; + locales['en'] = i18n_EN; + + var loadLocale = function () { + if ($scope.locale == "fr" && angular.isDefined(i18n_FR)) { + angular.copy(i18n_FR, $locale); + } + else if (angular.isDefined(i18n_EN)) { + angular.copy(i18n_EN, $locale); + } + } + if (angular.isUndefined($scope.locale)) { // set locale with browser preference $scope.locale = navigator.language || navigator.userLanguage; @@ -35,6 +49,7 @@ angular.module('localeControllers', []) SessionStorage.save({locale:$scope.locale}); } $translate.use($scope.locale); + loadLocale(); $scope.switchLocale = function (locale) { //change locale @@ -42,7 +57,11 @@ angular.module('localeControllers', []) SessionStorage.save({locale:locale}); $scope.locale = locale; $translate.use(locale); + + loadLocale(); + $rootScope.$broadcast('switchLocale'); } } + }]) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm