2011-07-29 20:47:16 +00:00
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2011-11-10 17:59:38 +00:00
|
|
|
|
* @ngdoc object
|
2012-06-12 06:49:24 +00:00
|
|
|
|
* @name ng.$locale
|
2011-07-29 20:47:16 +00:00
|
|
|
|
*
|
|
|
|
|
|
* @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`)
|
|
|
|
|
|
*/
|
2011-11-02 23:32:46 +00:00
|
|
|
|
function $LocaleProvider(){
|
|
|
|
|
|
this.$get = function() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
id: 'en-us',
|
2011-07-29 20:47:16 +00:00
|
|
|
|
|
2011-11-02 23:32:46 +00:00
|
|
|
|
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: '$'
|
|
|
|
|
|
},
|
2011-07-29 20:47:16 +00:00
|
|
|
|
|
2011-11-02 23:32:46 +00:00
|
|
|
|
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'
|
|
|
|
|
|
},
|
2011-08-24 18:00:18 +00:00
|
|
|
|
|
2011-11-02 23:32:46 +00:00
|
|
|
|
pluralCat: function(num) {
|
|
|
|
|
|
if (num === 1) {
|
|
|
|
|
|
return 'one';
|
|
|
|
|
|
}
|
|
|
|
|
|
return 'other';
|
2011-08-24 18:00:18 +00:00
|
|
|
|
}
|
2011-11-02 23:32:46 +00:00
|
|
|
|
};
|
2011-07-29 20:47:16 +00:00
|
|
|
|
};
|
2011-11-02 23:32:46 +00:00
|
|
|
|
}
|