Skip to content

Commit

Permalink
Merge pull request #678 from TerraPass/fix-ukrainian-genitive
Browse files Browse the repository at this point in the history
A fix for Ukrainian (uk) language translation
  • Loading branch information
timrwood committed Mar 17, 2013
2 parents eb5dad8 + cc32f73 commit 0a34591
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
15 changes: 9 additions & 6 deletions lang/uk.js
Expand Up @@ -53,12 +53,15 @@ function monthsCaseReplace(m, format) {
function weekdaysCaseReplace(m, format) {
var weekdays = {
'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),
'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_')
'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),
'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')
},

nounCase = (/\[ ?[Вв] ?(?:попередню|наступну)? ?\] ?dddd/).test(format) ?
nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ?
'accusative' :
'nominative';
((/\[?(?:минулої)? ?\] ?dddd/).test(format) ?
'genitive' :
'nominative');

return weekdays[nounCase][m.day()];
}
Expand Down Expand Up @@ -89,16 +92,16 @@ require('../moment').lang('uk', {
case 3:
case 5:
case 6:
return '[В минулу] dddd [в] LT';
return '[Минулої] dddd [в] LT';
case 1:
case 2:
case 4:
return '[В минулий] dddd [в] LT';
return '[Минулого] dddd [в] LT';
}
},
sameElse: 'L'
},
// It needs checking (adding) ukrainan plurals and cases.
// It needs checking (adding) Ukrainian plurals and cases.
relativeTime : {
future : "через %s",
past : "%s тому",
Expand Down
4 changes: 2 additions & 2 deletions test/lang/uk.js
Expand Up @@ -239,11 +239,11 @@ exports["lang:uk"] = {
case 3:
case 5:
case 6:
return '[В минулу] dddd [в] LT';
return '[Минулої] dddd [в] LT';
case 1:
case 2:
case 4:
return '[В минулий] dddd [в] LT';
return '[Минулого] dddd [в] LT';
}
}

Expand Down

0 comments on commit 0a34591

Please sign in to comment.