forked from discourse/discourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'date_i18n_support' of git://github.com/kubabrecka/disco…
…urse
- Loading branch information
Showing
7 changed files
with
55 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// fix EN locale | ||
Date.getLocale('en').short_no_year = '{d} {Mon}'; | ||
|
||
// create CS locale | ||
Date.addLocale('cs', { | ||
'plural': true, | ||
'capitalizeUnit': false, | ||
'months': 'ledna,února,března,dubna,května,června,července,srpna,září,října,listopadu,prosince', | ||
'weekdays': 'neděle,pondělí,úterý,středa,čtvrtek,pátek,sobota', | ||
'units': 'milisekund:a|y||ou|ami,sekund:a|y||ou|ami,minut:a|y||ou|ami,hodin:a|y||ou|ami,den|dny|dnů|dnem|dny,týden|týdny|týdnů|týdnem|týdny,měsíc:|e|ů|em|emi,rok|roky|let|rokem|lety', | ||
'short': '{d}. {month} {yyyy}', | ||
'short_no_year': '{d}. {month}', | ||
'long': '{d}. {month} {yyyy} {H}:{mm}', | ||
'full': '{weekday} {d}. {month} {yyyy} {H}:{mm}:{ss}', | ||
'relative': function(num, unit, ms, format) { | ||
var numberWithUnit, last = num.toString().slice(-1); | ||
var mult; | ||
if (format === 'past' || format === 'future') { | ||
if (num === 1) mult = 3; | ||
else mult = 4; | ||
} else { | ||
if (num === 1) mult = 0; | ||
else if (num >= 2 && num <= 4) mult = 1; | ||
else mult = 2; | ||
} | ||
numberWithUnit = num + ' ' + this.units[(mult * 8) + unit]; | ||
switch(format) { | ||
case 'duration': return numberWithUnit; | ||
case 'past': return 'před ' + numberWithUnit; | ||
case 'future': return 'za ' + numberWithUnit; | ||
} | ||
} | ||
}); | ||
|
||
// set the current date locale | ||
Date.setLocale(I18n.locale); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ cs: | |
you: "Vy" | ||
ok: "ok" | ||
or: "nebo" | ||
now: "právě teď" | ||
|
||
suggested_topics: | ||
title: "Doporučená témata" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ en: | |
you: "You" | ||
ok: "ok" | ||
or: "or" | ||
now: "just now" | ||
|
||
suggested_topics: | ||
title: "Suggested Topics" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters