mirror of
https://github.com/sismics/docs.git
synced 2024-12-22 19:33:47 +01:00
parent
e74f86e118
commit
273136ab23
@ -106,7 +106,7 @@ module.exports = function(grunt) {
|
||||
dist: {
|
||||
expand: true,
|
||||
cwd: 'src/',
|
||||
src: ['**', '!**/*.js', '!*.html', '!**/*.less', '!**/*.css'],
|
||||
src: ['**', '!**/*.js', '!*.html', '!**/*.less', '!**/*.css', 'locale/**'],
|
||||
dest: 'dist/'
|
||||
}
|
||||
},
|
||||
|
@ -6,13 +6,15 @@
|
||||
angular.module('docs',
|
||||
// Dependencies
|
||||
['ui.router', 'ui.bootstrap', 'dialog', 'ngProgress', 'monospaced.qrcode', 'yaru22.angular-timeago', 'ui.validate',
|
||||
'ui.sortable', 'restangular', 'ngSanitize', 'ngTouch', 'colorpicker.module', 'ngFileUpload', 'pascalprecht.translate']
|
||||
'ui.sortable', 'restangular', 'ngSanitize', 'ngTouch', 'colorpicker.module', 'ngFileUpload', 'pascalprecht.translate',
|
||||
'tmh.dynamicLocale']
|
||||
)
|
||||
|
||||
/**
|
||||
* Configuring modules.
|
||||
*/
|
||||
.config(function($locationProvider, $urlRouterProvider, $stateProvider, $httpProvider, RestangularProvider, $translateProvider, timeAgoSettings) {
|
||||
.config(function($locationProvider, $urlRouterProvider, $stateProvider, $httpProvider,
|
||||
RestangularProvider, $translateProvider, timeAgoSettings, tmhDynamicLocaleProvider) {
|
||||
$locationProvider.hashPrefix('');
|
||||
|
||||
// Configuring UI Router
|
||||
@ -363,9 +365,11 @@ angular.module('docs',
|
||||
}
|
||||
|
||||
// Configuring Timago
|
||||
timeAgoSettings.overrideLang = $translateProvider.preferredLanguage();
|
||||
timeAgoSettings.fullDateAfterSeconds = 60 * 60 * 24 * 30; // 30 days
|
||||
|
||||
// Configuring tmhDynamicLocale
|
||||
tmhDynamicLocaleProvider.localeLocationPattern('locale/angular-locale_{{locale}}.js');
|
||||
|
||||
// Configuring $http to act like jQuery.ajax
|
||||
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
|
||||
$httpProvider.defaults.headers.put['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
|
||||
@ -428,8 +432,8 @@ angular.module('docs',
|
||||
// Watch for the number of XHR running
|
||||
$rootScope.$watch(function() {
|
||||
return $http.pendingRequests.length > 0
|
||||
}, function(count) {
|
||||
if (count == 0) {
|
||||
}, function(loading) {
|
||||
if (!loading) {
|
||||
$rootScope.ngProgress.complete();
|
||||
} else {
|
||||
$rootScope.ngProgress.start();
|
||||
|
@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Footer controller.
|
||||
*/
|
||||
angular.module('docs').controller('Footer', function($scope, $rootScope, Restangular, $translate, timeAgoSettings) {
|
||||
angular.module('docs').controller('Footer', function($scope, $rootScope, Restangular, $translate, timeAgoSettings, tmhDynamicLocale, $locale) {
|
||||
// Load app data
|
||||
Restangular.one('app').get().then(function(data) {
|
||||
$scope.app = data;
|
||||
@ -14,6 +14,10 @@ angular.module('docs').controller('Footer', function($scope, $rootScope, Restang
|
||||
$scope.currentLang = $translate.use();
|
||||
timeAgoSettings.overrideLang = $scope.currentLang;
|
||||
localStorage.overrideLang = $scope.currentLang;
|
||||
tmhDynamicLocale.set($scope.currentLang).then(function () {
|
||||
$rootScope.dateFormat = $locale.DATETIME_FORMATS.shortDate;
|
||||
$rootScope.dateTimeFormat = $locale.DATETIME_FORMATS.short;
|
||||
});
|
||||
});
|
||||
|
||||
// Change the current language
|
||||
|
@ -34,6 +34,7 @@
|
||||
<script src="lib/angular.translate.js" type="text/javascript"></script>
|
||||
<script src="lib/angular.sanitize.js" type="text/javascript"></script>
|
||||
<script src="lib/angular.touch.js" type="text/javascript"></script>
|
||||
<script src="lib/angular.tmhDynamicLocale.js" type="text/javascript"></script>
|
||||
<script src="lib/angular.ui-router.js" type="text/javascript"></script>
|
||||
<script src="lib/angular.ui-bootstrap.js" type="text/javascript"></script>
|
||||
<script src="lib/angular.ui-sortable.js" type="text/javascript"></script>
|
||||
|
260
docs-web/src/main/webapp/src/lib/angular.tmhDynamicLocale.js
Normal file
260
docs-web/src/main/webapp/src/lib/angular.tmhDynamicLocale.js
Normal file
@ -0,0 +1,260 @@
|
||||
/**
|
||||
* Angular Dynamic Locale - 0.1.32
|
||||
* https://github.com/lgalfaso/angular-dynamic-locale
|
||||
* License: MIT
|
||||
*/
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||
define([], function () {
|
||||
return (factory());
|
||||
});
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory();
|
||||
} else {
|
||||
factory();
|
||||
}
|
||||
}(this, function () {
|
||||
'use strict';
|
||||
angular.module('tmh.dynamicLocale', []).config(['$provide', function($provide) {
|
||||
function makeStateful($delegate) {
|
||||
$delegate.$stateful = true;
|
||||
return $delegate;
|
||||
}
|
||||
|
||||
$provide.decorator('dateFilter', ['$delegate', makeStateful]);
|
||||
$provide.decorator('numberFilter', ['$delegate', makeStateful]);
|
||||
$provide.decorator('currencyFilter', ['$delegate', makeStateful]);
|
||||
|
||||
}])
|
||||
.constant('tmhDynamicLocale.STORAGE_KEY', 'tmhDynamicLocale.locale')
|
||||
.provider('tmhDynamicLocale', ['tmhDynamicLocale.STORAGE_KEY', function(STORAGE_KEY) {
|
||||
|
||||
var defaultLocale,
|
||||
localeLocationPattern = 'angular/i18n/angular-locale_{{locale}}.js',
|
||||
nodeToAppend,
|
||||
storageFactory = 'tmhDynamicLocaleStorageCache',
|
||||
storage,
|
||||
storageKey = STORAGE_KEY,
|
||||
promiseCache = {},
|
||||
activeLocale,
|
||||
extraProperties = {};
|
||||
|
||||
/**
|
||||
* Loads a script asynchronously
|
||||
*
|
||||
* @param {string} url The url for the script
|
||||
@ @param {function} callback A function to be called once the script is loaded
|
||||
*/
|
||||
function loadScript(url, callback, errorCallback, $timeout) {
|
||||
var script = document.createElement('script'),
|
||||
element = nodeToAppend ? nodeToAppend : document.getElementsByTagName("body")[0],
|
||||
removed = false;
|
||||
|
||||
script.type = 'text/javascript';
|
||||
if (script.readyState) { // IE
|
||||
script.onreadystatechange = function () {
|
||||
if (script.readyState === 'complete' ||
|
||||
script.readyState === 'loaded') {
|
||||
script.onreadystatechange = null;
|
||||
$timeout(
|
||||
function () {
|
||||
if (removed) return;
|
||||
removed = true;
|
||||
element.removeChild(script);
|
||||
callback();
|
||||
}, 30, false);
|
||||
}
|
||||
};
|
||||
} else { // Others
|
||||
script.onload = function () {
|
||||
if (removed) return;
|
||||
removed = true;
|
||||
element.removeChild(script);
|
||||
callback();
|
||||
};
|
||||
script.onerror = function () {
|
||||
if (removed) return;
|
||||
removed = true;
|
||||
element.removeChild(script);
|
||||
errorCallback();
|
||||
};
|
||||
}
|
||||
script.src = url;
|
||||
script.async = true;
|
||||
element.appendChild(script);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a locale and replaces the properties from the current locale with the new locale information
|
||||
*
|
||||
* @param {string} localeUrl The path to the new locale
|
||||
* @param {Object} $locale The locale at the curent scope
|
||||
* @param {string} localeId The locale id to load
|
||||
* @param {Object} $rootScope The application $rootScope
|
||||
* @param {Object} $q The application $q
|
||||
* @param {Object} localeCache The current locale cache
|
||||
* @param {Object} $timeout The application $timeout
|
||||
*/
|
||||
function loadLocale(localeUrl, $locale, localeId, $rootScope, $q, localeCache, $timeout) {
|
||||
|
||||
function overrideValues(oldObject, newObject) {
|
||||
if (activeLocale !== localeId) {
|
||||
return;
|
||||
}
|
||||
angular.forEach(oldObject, function(value, key) {
|
||||
if (!newObject[key]) {
|
||||
delete oldObject[key];
|
||||
} else if (angular.isArray(newObject[key])) {
|
||||
oldObject[key].length = newObject[key].length;
|
||||
}
|
||||
});
|
||||
angular.forEach(newObject, function(value, key) {
|
||||
if (angular.isArray(newObject[key]) || angular.isObject(newObject[key])) {
|
||||
if (!oldObject[key]) {
|
||||
oldObject[key] = angular.isArray(newObject[key]) ? [] : {};
|
||||
}
|
||||
overrideValues(oldObject[key], newObject[key]);
|
||||
} else {
|
||||
oldObject[key] = newObject[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (promiseCache[localeId]) {
|
||||
activeLocale = localeId;
|
||||
return promiseCache[localeId];
|
||||
}
|
||||
|
||||
var cachedLocale,
|
||||
deferred = $q.defer();
|
||||
if (localeId === activeLocale) {
|
||||
deferred.resolve($locale);
|
||||
} else if ((cachedLocale = localeCache.get(localeId))) {
|
||||
activeLocale = localeId;
|
||||
$rootScope.$evalAsync(function() {
|
||||
overrideValues($locale, cachedLocale);
|
||||
storage.put(storageKey, localeId);
|
||||
$rootScope.$broadcast('$localeChangeSuccess', localeId, $locale);
|
||||
deferred.resolve($locale);
|
||||
});
|
||||
} else {
|
||||
activeLocale = localeId;
|
||||
promiseCache[localeId] = deferred.promise;
|
||||
loadScript(localeUrl, function() {
|
||||
// Create a new injector with the new locale
|
||||
var localInjector = angular.injector(['ngLocale']),
|
||||
externalLocale = localInjector.get('$locale');
|
||||
|
||||
overrideValues($locale, externalLocale);
|
||||
localeCache.put(localeId, externalLocale);
|
||||
delete promiseCache[localeId];
|
||||
|
||||
$rootScope.$applyAsync(function() {
|
||||
storage.put(storageKey, localeId);
|
||||
$rootScope.$broadcast('$localeChangeSuccess', localeId, $locale);
|
||||
deferred.resolve($locale);
|
||||
});
|
||||
}, function() {
|
||||
delete promiseCache[localeId];
|
||||
|
||||
$rootScope.$applyAsync(function() {
|
||||
if (activeLocale === localeId) {
|
||||
activeLocale = $locale.id;
|
||||
}
|
||||
$rootScope.$broadcast('$localeChangeError', localeId);
|
||||
deferred.reject(localeId);
|
||||
});
|
||||
}, $timeout);
|
||||
}
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
this.localeLocationPattern = function(value) {
|
||||
if (value) {
|
||||
localeLocationPattern = value;
|
||||
return this;
|
||||
} else {
|
||||
return localeLocationPattern;
|
||||
}
|
||||
};
|
||||
|
||||
this.appendScriptTo = function(nodeElement) {
|
||||
nodeToAppend = nodeElement;
|
||||
};
|
||||
|
||||
this.useStorage = function(storageName) {
|
||||
storageFactory = storageName;
|
||||
};
|
||||
|
||||
this.useCookieStorage = function() {
|
||||
this.useStorage('$cookieStore');
|
||||
};
|
||||
|
||||
this.defaultLocale = function(value) {
|
||||
defaultLocale = value;
|
||||
};
|
||||
|
||||
this.storageKey = function(value) {
|
||||
if (value) {
|
||||
storageKey = value;
|
||||
return this;
|
||||
} else {
|
||||
return storageKey;
|
||||
}
|
||||
};
|
||||
|
||||
this.addLocalePatternValue = function(key, value) {
|
||||
extraProperties[key] = value;
|
||||
};
|
||||
|
||||
this.$get = ['$rootScope', '$injector', '$interpolate', '$locale', '$q', 'tmhDynamicLocaleCache', '$timeout', function($rootScope, $injector, interpolate, locale, $q, tmhDynamicLocaleCache, $timeout) {
|
||||
var localeLocation = interpolate(localeLocationPattern);
|
||||
|
||||
storage = $injector.get(storageFactory);
|
||||
$rootScope.$evalAsync(function() {
|
||||
var initialLocale;
|
||||
if ((initialLocale = (storage.get(storageKey) || defaultLocale))) {
|
||||
loadLocaleFn(initialLocale);
|
||||
}
|
||||
});
|
||||
return {
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @description
|
||||
* @param {string} value Sets the locale to the new locale. Changing the locale will trigger
|
||||
* a background task that will retrieve the new locale and configure the current $locale
|
||||
* instance with the information from the new locale
|
||||
*/
|
||||
set: loadLocaleFn,
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @description Returns the configured locale
|
||||
*/
|
||||
get: function() {
|
||||
return activeLocale;
|
||||
}
|
||||
};
|
||||
|
||||
function loadLocaleFn(localeId) {
|
||||
var baseProperties = {locale: localeId, angularVersion: angular.version.full};
|
||||
return loadLocale(localeLocation(angular.extend({}, extraProperties, baseProperties)), locale, localeId, $rootScope, $q, tmhDynamicLocaleCache, $timeout);
|
||||
}
|
||||
}];
|
||||
}]).provider('tmhDynamicLocaleCache', function() {
|
||||
this.$get = ['$cacheFactory', function($cacheFactory) {
|
||||
return $cacheFactory('tmh.dynamicLocales');
|
||||
}];
|
||||
}).provider('tmhDynamicLocaleStorageCache', function() {
|
||||
this.$get = ['$cacheFactory', function($cacheFactory) {
|
||||
return $cacheFactory('tmh.dynamicLocales.store');
|
||||
}];
|
||||
}).run(['tmhDynamicLocale', angular.noop]);
|
||||
|
||||
return 'tmh.dynamicLocale';
|
||||
|
||||
}));
|
143
docs-web/src/main/webapp/src/locale/angular-locale_en.js
vendored
Normal file
143
docs-web/src/main/webapp/src/locale/angular-locale_en.js
vendored
Normal file
@ -0,0 +1,143 @@
|
||||
'use strict';
|
||||
angular.module("ngLocale", [], ["$provide", function($provide) {
|
||||
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
|
||||
function getDecimals(n) {
|
||||
n = n + '';
|
||||
var i = n.indexOf('.');
|
||||
return (i == -1) ? 0 : n.length - i - 1;
|
||||
}
|
||||
|
||||
function getVF(n, opt_precision) {
|
||||
var v = opt_precision;
|
||||
|
||||
if (undefined === v) {
|
||||
v = Math.min(getDecimals(n), 3);
|
||||
}
|
||||
|
||||
var base = Math.pow(10, v);
|
||||
var f = ((n * base) | 0) % base;
|
||||
return {v: v, f: f};
|
||||
}
|
||||
|
||||
$provide.value("$locale", {
|
||||
"DATETIME_FORMATS": {
|
||||
"AMPMS": [
|
||||
"AM",
|
||||
"PM"
|
||||
],
|
||||
"DAY": [
|
||||
"Sunday",
|
||||
"Monday",
|
||||
"Tuesday",
|
||||
"Wednesday",
|
||||
"Thursday",
|
||||
"Friday",
|
||||
"Saturday"
|
||||
],
|
||||
"ERANAMES": [
|
||||
"Before Christ",
|
||||
"Anno Domini"
|
||||
],
|
||||
"ERAS": [
|
||||
"BC",
|
||||
"AD"
|
||||
],
|
||||
"FIRSTDAYOFWEEK": 6,
|
||||
"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"
|
||||
],
|
||||
"STANDALONEMONTH": [
|
||||
"January",
|
||||
"February",
|
||||
"March",
|
||||
"April",
|
||||
"May",
|
||||
"June",
|
||||
"July",
|
||||
"August",
|
||||
"September",
|
||||
"October",
|
||||
"November",
|
||||
"December"
|
||||
],
|
||||
"WEEKENDRANGE": [
|
||||
5,
|
||||
6
|
||||
],
|
||||
"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,
|
||||
"maxFrac": 3,
|
||||
"minFrac": 0,
|
||||
"minInt": 1,
|
||||
"negPre": "-",
|
||||
"negSuf": "",
|
||||
"posPre": "",
|
||||
"posSuf": ""
|
||||
},
|
||||
{
|
||||
"gSize": 3,
|
||||
"lgSize": 3,
|
||||
"maxFrac": 2,
|
||||
"minFrac": 2,
|
||||
"minInt": 1,
|
||||
"negPre": "-\u00a4",
|
||||
"negSuf": "",
|
||||
"posPre": "\u00a4",
|
||||
"posSuf": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"id": "en",
|
||||
"localeID": "en",
|
||||
"pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
|
||||
});
|
||||
}]);
|
125
docs-web/src/main/webapp/src/locale/angular-locale_fr.js
vendored
Normal file
125
docs-web/src/main/webapp/src/locale/angular-locale_fr.js
vendored
Normal file
@ -0,0 +1,125 @@
|
||||
'use strict';
|
||||
angular.module("ngLocale", [], ["$provide", function($provide) {
|
||||
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
|
||||
$provide.value("$locale", {
|
||||
"DATETIME_FORMATS": {
|
||||
"AMPMS": [
|
||||
"AM",
|
||||
"PM"
|
||||
],
|
||||
"DAY": [
|
||||
"dimanche",
|
||||
"lundi",
|
||||
"mardi",
|
||||
"mercredi",
|
||||
"jeudi",
|
||||
"vendredi",
|
||||
"samedi"
|
||||
],
|
||||
"ERANAMES": [
|
||||
"avant J\u00e9sus-Christ",
|
||||
"apr\u00e8s J\u00e9sus-Christ"
|
||||
],
|
||||
"ERAS": [
|
||||
"av. J.-C.",
|
||||
"ap. J.-C."
|
||||
],
|
||||
"FIRSTDAYOFWEEK": 0,
|
||||
"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."
|
||||
],
|
||||
"STANDALONEMONTH": [
|
||||
"janvier",
|
||||
"f\u00e9vrier",
|
||||
"mars",
|
||||
"avril",
|
||||
"mai",
|
||||
"juin",
|
||||
"juillet",
|
||||
"ao\u00fbt",
|
||||
"septembre",
|
||||
"octobre",
|
||||
"novembre",
|
||||
"d\u00e9cembre"
|
||||
],
|
||||
"WEEKENDRANGE": [
|
||||
5,
|
||||
6
|
||||
],
|
||||
"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/y HH:mm",
|
||||
"shortDate": "dd/MM/y",
|
||||
"shortTime": "HH:mm"
|
||||
},
|
||||
"NUMBER_FORMATS": {
|
||||
"CURRENCY_SYM": "\u20ac",
|
||||
"DECIMAL_SEP": ",",
|
||||
"GROUP_SEP": "\u00a0",
|
||||
"PATTERNS": [
|
||||
{
|
||||
"gSize": 3,
|
||||
"lgSize": 3,
|
||||
"maxFrac": 3,
|
||||
"minFrac": 0,
|
||||
"minInt": 1,
|
||||
"negPre": "-",
|
||||
"negSuf": "",
|
||||
"posPre": "",
|
||||
"posSuf": ""
|
||||
},
|
||||
{
|
||||
"gSize": 3,
|
||||
"lgSize": 3,
|
||||
"maxFrac": 2,
|
||||
"minFrac": 2,
|
||||
"minInt": 1,
|
||||
"negPre": "-",
|
||||
"negSuf": "\u00a0\u00a4",
|
||||
"posPre": "",
|
||||
"posSuf": "\u00a0\u00a4"
|
||||
}
|
||||
]
|
||||
},
|
||||
"id": "fr",
|
||||
"localeID": "fr",
|
||||
"pluralCat": function(n, opt_precision) { var i = n | 0; if (i == 0 || i == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
|
||||
});
|
||||
}]);
|
125
docs-web/src/main/webapp/src/locale/angular-locale_zh_CN.js
vendored
Normal file
125
docs-web/src/main/webapp/src/locale/angular-locale_zh_CN.js
vendored
Normal file
@ -0,0 +1,125 @@
|
||||
'use strict';
|
||||
angular.module("ngLocale", [], ["$provide", function($provide) {
|
||||
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
|
||||
$provide.value("$locale", {
|
||||
"DATETIME_FORMATS": {
|
||||
"AMPMS": [
|
||||
"\u4e0a\u5348",
|
||||
"\u4e0b\u5348"
|
||||
],
|
||||
"DAY": [
|
||||
"\u661f\u671f\u65e5",
|
||||
"\u661f\u671f\u4e00",
|
||||
"\u661f\u671f\u4e8c",
|
||||
"\u661f\u671f\u4e09",
|
||||
"\u661f\u671f\u56db",
|
||||
"\u661f\u671f\u4e94",
|
||||
"\u661f\u671f\u516d"
|
||||
],
|
||||
"ERANAMES": [
|
||||
"\u516c\u5143\u524d",
|
||||
"\u516c\u5143"
|
||||
],
|
||||
"ERAS": [
|
||||
"\u516c\u5143\u524d",
|
||||
"\u516c\u5143"
|
||||
],
|
||||
"FIRSTDAYOFWEEK": 6,
|
||||
"MONTH": [
|
||||
"\u4e00\u6708",
|
||||
"\u4e8c\u6708",
|
||||
"\u4e09\u6708",
|
||||
"\u56db\u6708",
|
||||
"\u4e94\u6708",
|
||||
"\u516d\u6708",
|
||||
"\u4e03\u6708",
|
||||
"\u516b\u6708",
|
||||
"\u4e5d\u6708",
|
||||
"\u5341\u6708",
|
||||
"\u5341\u4e00\u6708",
|
||||
"\u5341\u4e8c\u6708"
|
||||
],
|
||||
"SHORTDAY": [
|
||||
"\u5468\u65e5",
|
||||
"\u5468\u4e00",
|
||||
"\u5468\u4e8c",
|
||||
"\u5468\u4e09",
|
||||
"\u5468\u56db",
|
||||
"\u5468\u4e94",
|
||||
"\u5468\u516d"
|
||||
],
|
||||
"SHORTMONTH": [
|
||||
"1\u6708",
|
||||
"2\u6708",
|
||||
"3\u6708",
|
||||
"4\u6708",
|
||||
"5\u6708",
|
||||
"6\u6708",
|
||||
"7\u6708",
|
||||
"8\u6708",
|
||||
"9\u6708",
|
||||
"10\u6708",
|
||||
"11\u6708",
|
||||
"12\u6708"
|
||||
],
|
||||
"STANDALONEMONTH": [
|
||||
"\u4e00\u6708",
|
||||
"\u4e8c\u6708",
|
||||
"\u4e09\u6708",
|
||||
"\u56db\u6708",
|
||||
"\u4e94\u6708",
|
||||
"\u516d\u6708",
|
||||
"\u4e03\u6708",
|
||||
"\u516b\u6708",
|
||||
"\u4e5d\u6708",
|
||||
"\u5341\u6708",
|
||||
"\u5341\u4e00\u6708",
|
||||
"\u5341\u4e8c\u6708"
|
||||
],
|
||||
"WEEKENDRANGE": [
|
||||
5,
|
||||
6
|
||||
],
|
||||
"fullDate": "y\u5e74M\u6708d\u65e5EEEE",
|
||||
"longDate": "y\u5e74M\u6708d\u65e5",
|
||||
"medium": "y\u5e74M\u6708d\u65e5 ah:mm:ss",
|
||||
"mediumDate": "y\u5e74M\u6708d\u65e5",
|
||||
"mediumTime": "ah:mm:ss",
|
||||
"short": "y/M/d ah:mm",
|
||||
"shortDate": "y/M/d",
|
||||
"shortTime": "ah:mm"
|
||||
},
|
||||
"NUMBER_FORMATS": {
|
||||
"CURRENCY_SYM": "\u00a5",
|
||||
"DECIMAL_SEP": ".",
|
||||
"GROUP_SEP": ",",
|
||||
"PATTERNS": [
|
||||
{
|
||||
"gSize": 3,
|
||||
"lgSize": 3,
|
||||
"maxFrac": 3,
|
||||
"minFrac": 0,
|
||||
"minInt": 1,
|
||||
"negPre": "-",
|
||||
"negSuf": "",
|
||||
"posPre": "",
|
||||
"posSuf": ""
|
||||
},
|
||||
{
|
||||
"gSize": 3,
|
||||
"lgSize": 3,
|
||||
"maxFrac": 2,
|
||||
"minFrac": 2,
|
||||
"minInt": 1,
|
||||
"negPre": "-\u00a4",
|
||||
"negSuf": "",
|
||||
"posPre": "\u00a4",
|
||||
"posSuf": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"id": "zh-cn",
|
||||
"localeID": "zh_CN",
|
||||
"pluralCat": function(n, opt_precision) { return PLURAL_CATEGORY.OTHER;}
|
||||
});
|
||||
}]);
|
@ -328,6 +328,11 @@
|
||||
},
|
||||
"selecttag": {
|
||||
"typeahead": "Type a tag"
|
||||
},
|
||||
"datepicker": {
|
||||
"current": "Today",
|
||||
"clear": "Clear",
|
||||
"close": "Done"
|
||||
}
|
||||
},
|
||||
"filter": {
|
||||
|
@ -328,6 +328,11 @@
|
||||
},
|
||||
"selecttag": {
|
||||
"typeahead": "Entrez un tag"
|
||||
},
|
||||
"datepicker": {
|
||||
"current": "Aujourd'hui",
|
||||
"clear": "Vider",
|
||||
"close": "Fermer"
|
||||
}
|
||||
},
|
||||
"filter": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
<table class="table">
|
||||
<tr ng-repeat="log in logs">
|
||||
<td width="20%">{{ log.create_date | date: 'yyyy-MM-dd HH:mm' }}</td>
|
||||
<td width="20%">{{ log.create_date | date: $root.dateTimeFormat }}</td>
|
||||
<td width="20%">
|
||||
<a ng-href="#/user/{{ log.username }}">
|
||||
<span class="glyphicon glyphicon-user"></span>
|
||||
|
@ -40,8 +40,13 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="inputCreateDate">{{ 'document.creation_date' | translate }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="inputCreateDate" ng-readonly="true" uib-datepicker-popup="yyyy-MM-dd" class="form-control"
|
||||
ng-model="document.create_date" datepicker-options="{ startingDay:1, showWeeks: false }" ng-click="datepickerOpened = true" is-open="datepickerOpened" ng-disabled="fileIsUploading" />
|
||||
<input type="text" id="inputCreateDate"
|
||||
current-text="{{ 'directive.datepicker.current' | translate }}"
|
||||
clear-text="{{ 'directive.datepicker.clear' | translate }}"
|
||||
close-text="{{ 'directive.datepicker.close' | translate }}"
|
||||
ng-readonly="true" uib-datepicker-popup="{{ dateFormat }}" class="form-control"
|
||||
ng-model="document.create_date" datepicker-options="{ startingDay:1, showWeeks: false }"
|
||||
ng-click="datepickerOpened = true" is-open="datepickerOpened" ng-disabled="fileIsUploading" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
@ -64,7 +64,7 @@
|
||||
<span class="glyphicon glyphicon-share" ng-if="document.shared" tooltip="{{ 'document.shared' | translate }}"></span>
|
||||
<a href="#/document/view/{{ document.id }}" target="_blank" ng-click="$event.stopPropagation()"><span class="glyphicon glyphicon-link"></span></a>
|
||||
|
||||
<div class="pull-right text-muted small">{{ document.create_date | timeAgo: 'yyyy-MM-dd' }}</div>
|
||||
<div class="pull-right text-muted small">{{ document.create_date | timeAgo: dateFormat }}</div>
|
||||
|
||||
<div class="tags small">
|
||||
<span class="label label-info" ng-repeat="tag in document.tags" ng-style="{ 'background': tag.color }">
|
||||
|
@ -41,7 +41,7 @@
|
||||
<div class="page-header">
|
||||
<h1>
|
||||
{{ document.title }}
|
||||
<small>{{ document.create_date | date: 'yyyy-MM-dd' }}
|
||||
<small>{{ document.create_date | date: dateFormat }}
|
||||
{{ 'document.view.by_creator' | translate }} <a href="#/user/{{ document.creator }}">{{ document.creator }}</a></small>
|
||||
</h1>
|
||||
|
||||
@ -106,10 +106,12 @@
|
||||
<strong>{{ comment.creator }}</strong>
|
||||
<p>
|
||||
{{ comment.content }}<br />
|
||||
<span class="text-muted">{{ comment.create_date | date: 'yyyy-MM-dd' }}</span>
|
||||
<span class="text-muted">{{ comment.create_date | timeAgo: dateTimeFormat }}</span>
|
||||
<span class="text-muted pull-right btn-link pointer"
|
||||
ng-show="document.writable || userInfo.username == comment.creator"
|
||||
ng-click="deleteComment(comment)">{{ 'delete' | translate }}</span>
|
||||
ng-click="deleteComment(comment)">
|
||||
<span class="glyphicon glyphicon-remove"></span>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<tbody>
|
||||
<tr ng-repeat="log in logs"
|
||||
ng-class="{ info: log.level == 'INFO' || log.level == 'DEBUG', warning: log.level == 'WARN', danger: log.level == 'ERROR' || log.level == 'FATAL' }">
|
||||
<td>{{ log.date | date: 'yyyy-MM-dd HH:mm' }}</td>
|
||||
<td>{{ log.date | date: dateTimeFormat }}</td>
|
||||
<td>{{ log.tag }}</td>
|
||||
<td class="cell-message">{{ log.message }}</td>
|
||||
</tr>
|
||||
|
@ -10,8 +10,8 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="session in sessions | orderBy: '-current'" ng-class="{ 'info': session.current, 'warning': !session.current }">
|
||||
<td>{{ session.create_date | date: 'yyyy-MM-dd HH:mm' }}</td>
|
||||
<td>{{ session.last_connection_date | date: 'yyyy-MM-dd HH:mm' }}</td>
|
||||
<td>{{ session.create_date | date: dateTimeFormat }}</td>
|
||||
<td>{{ session.last_connection_date | date: dateTimeFormat }}</td>
|
||||
<td title="{{ session.user_agent }}">{{ session.ip }}</td>
|
||||
<td>
|
||||
<span ng-show="session.current" class="glyphicon glyphicon-ok"
|
||||
|
@ -16,7 +16,7 @@
|
||||
<tr ng-repeat="user in users | orderBy: 'username'" ng-click="editUser(user)"
|
||||
ng-class="{ active: $stateParams.username == user.username }">
|
||||
<td>{{ user.username }}</td>
|
||||
<td>{{ user.create_date | date: 'yyyy-MM-dd' }}</td>
|
||||
<td>{{ user.create_date | date: dateFormat }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
Loading…
Reference in New Issue
Block a user