mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-22 17:40:22 +00:00
we now have two types of namespaces: - true namespace: angular.* - used for all global apis - virtual namespace: ng.*, ngMock.*, ... - used for all DI modules the virual namespaces have services under the second namespace level (e.g. ng.) and filters and directives prefixed with filter: and directive: respectively (e.g. ng.filter:orderBy, ng.directive:ngRepeat) this simplifies urls and makes them a lot shorter while still avoiding name collisions
72 lines
1.8 KiB
JavaScript
72 lines
1.8 KiB
JavaScript
'use strict';
|
||
|
||
/**
|
||
* @ngdoc object
|
||
* @name ng.$locale
|
||
*
|
||
* @description
|
||
* $locale service provides localization rules for various Angular components. As of right now the
|
||
* only public api is:
|
||
*
|
||
* * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`)
|
||
*/
|
||
function $LocaleProvider(){
|
||
this.$get = function() {
|
||
return {
|
||
id: 'en-us',
|
||
|
||
NUMBER_FORMATS: {
|
||
DECIMAL_SEP: '.',
|
||
GROUP_SEP: ',',
|
||
PATTERNS: [
|
||
{ // Decimal Pattern
|
||
minInt: 1,
|
||
minFrac: 0,
|
||
maxFrac: 3,
|
||
posPre: '',
|
||
posSuf: '',
|
||
negPre: '-',
|
||
negSuf: '',
|
||
gSize: 3,
|
||
lgSize: 3
|
||
},{ //Currency Pattern
|
||
minInt: 1,
|
||
minFrac: 2,
|
||
maxFrac: 2,
|
||
posPre: '\u00A4',
|
||
posSuf: '',
|
||
negPre: '(\u00A4',
|
||
negSuf: ')',
|
||
gSize: 3,
|
||
lgSize: 3
|
||
}
|
||
],
|
||
CURRENCY_SYM: '$'
|
||
},
|
||
|
||
DATETIME_FORMATS: {
|
||
MONTH: 'January,February,March,April,May,June,July,August,September,October,November,December'
|
||
.split(','),
|
||
SHORTMONTH: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),
|
||
DAY: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),
|
||
SHORTDAY: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','),
|
||
AMPMS: ['AM','PM'],
|
||
medium: 'MMM d, y h:mm:ss a',
|
||
short: 'M/d/yy h:mm a',
|
||
fullDate: 'EEEE, MMMM d, y',
|
||
longDate: 'MMMM d, y',
|
||
mediumDate: 'MMM d, y',
|
||
shortDate: 'M/d/yy',
|
||
mediumTime: 'h:mm:ss a',
|
||
shortTime: 'h:mm a'
|
||
},
|
||
|
||
pluralCat: function(num) {
|
||
if (num === 1) {
|
||
return 'one';
|
||
}
|
||
return 'other';
|
||
}
|
||
};
|
||
};
|
||
}
|