Merge pull request #529 from kubabrecka/i18n_date_formats

update JS date formats for new languages
This commit is contained in:
Robin Ward
2013-03-22 09:18:45 -07:00

View File

@ -1,21 +1,3 @@
// fix DE locale
Date.getLocale('de').short_no_year = '{d}. {month}';
// fix EN locale
Date.getLocale('en').short_no_year = '{d} {Mon}';
// fix FR locale
Date.getLocale('fr').short_no_year = '{d} {month}';
// fix NL locale
Date.getLocale('nl').short_no_year = '{d} {Month}';
// fix SV locale
Date.getLocale('sv').short_no_year = 'den {d} {month}';
// fix zh_CN locale
Date.getLocale('zh-CN').short_no_year = '{yyyy}年{M}月';
// create CS locale, because it's not supported by Sugar at all // create CS locale, because it's not supported by Sugar at all
Date.addLocale('cs', { Date.addLocale('cs', {
'plural': true, 'plural': true,
@ -47,5 +29,46 @@ Date.addLocale('cs', {
} }
}); });
// fix DE locale
Date.getLocale('de').short_no_year = '{d}. {month}';
// fix EN locale
Date.getLocale('en').short_no_year = '{d} {Mon}';
// fix FR locale
Date.getLocale('fr').short_no_year = '{d} {month}';
// create ID locale, because it's not supported by Sugar at all
// TODO: currently just English, needs to be translated and localized
Date.addLocale('id', {
'plural': true,
'capitalizeUnit': false,
'months': 'January,February,March,April,May,June,July,August,September,October,November,December',
'weekdays': 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday',
'units': 'millisecond:|s,second:|s,minute:|s,hour:|s,day:|s,week:|s,month:|s,year:|s',
'short': '{Month} {d}, {yyyy}',
'short_no_year': '{Month} {d}',
'long': '{Month} {d}, {yyyy} {h}:{mm}{tt}',
'full': '{Weekday} {Month} {d}, {yyyy} {h}:{mm}:{ss}{tt}',
'past': '{num} {unit} {sign}',
'future': '{num} {unit} {sign}',
'duration': '{num} {unit}'
});
// fix NL locale
Date.getLocale('nl').short_no_year = '{d} {Month}';
// fix PT locale
Date.getLocale('pt').short_no_year = '{d} de {month}';
// fix SV locale
Date.getLocale('sv').short_no_year = 'den {d} {month}';
// fix zh_CN locale
Date.getLocale('zh-CN').short_no_year = '{yyyy}年{M}月';
// fix zh_TW locale
Date.getLocale('zh-TW').short_no_year = '{yyyy}年{M}月';
// set the current date locale, replace underscore with dash to make zh_CN work // set the current date locale, replace underscore with dash to make zh_CN work
Date.setLocale(I18n.locale.replace("_","-")); Date.setLocale(I18n.locale.replace("_","-"));