summaryrefslogtreecommitdiffstats
path: root/js/vendor/momentjs/lang/ru.js
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-09-09 15:57:10 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-09-09 15:57:18 +0200
commit2824b43b7332e847810f042c4183ce95ee90e852 (patch)
tree9a10f31c8acbf01d72336d3d065f8c8fda4b83c5 /js/vendor/momentjs/lang/ru.js
parentf0abeddd07fcf21e30c95d58885416ef40d65391 (diff)
use bower for managing deps
Diffstat (limited to 'js/vendor/momentjs/lang/ru.js')
-rw-r--r--js/vendor/momentjs/lang/ru.js125
1 files changed, 125 insertions, 0 deletions
diff --git a/js/vendor/momentjs/lang/ru.js b/js/vendor/momentjs/lang/ru.js
new file mode 100644
index 000000000..069f6759d
--- /dev/null
+++ b/js/vendor/momentjs/lang/ru.js
@@ -0,0 +1,125 @@
+// moment.js language configuration
+// language : russian (ru)
+// author : Viktorminator : https://github.com/Viktorminator
+// Author : Menelion Elensúle : https://github.com/Oire
+
+function plural(word, num) {
+ var forms = word.split('_');
+ return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
+}
+
+function relativeTimeWithPlural(number, withoutSuffix, key) {
+ var format = {
+ 'mm': 'минута_минуты_минут',
+ 'hh': 'час_часа_часов',
+ 'dd': 'день_дня_дней',
+ 'MM': 'месяц_месяца_месяцев',
+ 'yy': 'год_года_лет'
+ };
+ if (key === 'm') {
+ return withoutSuffix ? 'минута' : 'минуту';
+ }
+ else {
+ return number + ' ' + plural(format[key], +number);
+ }
+}
+
+function monthsCaseReplace(m, format) {
+ var months = {
+ 'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
+ 'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_')
+ },
+
+ nounCase = (/D[oD]? *MMMM?/).test(format) ?
+ 'accusative' :
+ 'nominative';
+
+ return months[nounCase][m.month()];
+}
+
+function weekdaysCaseReplace(m, format) {
+ var weekdays = {
+ 'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
+ 'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_')
+ },
+
+ nounCase = (/\[ ?[Вв] ?(?:прошлую|следующую)? ?\] ?dddd/).test(format) ?
+ 'accusative' :
+ 'nominative';
+
+ return weekdays[nounCase][m.day()];
+}
+
+require('../moment').lang('ru', {
+ months : monthsCaseReplace,
+ monthsShort : "янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),
+ weekdays : weekdaysCaseReplace,
+ weekdaysShort : "вск_пнд_втр_срд_чтв_птн_сбт".split("_"),
+ weekdaysMin : "вс_пн_вт_ср_чт_пт_сб".split("_"),
+ longDateFormat : {
+ LT : "HH:mm",
+ L : "DD.MM.YYYY",
+ LL : "D MMMM YYYY г.",
+ LLL : "D MMMM YYYY г., LT",
+ LLLL : "dddd, D MMMM YYYY г., LT"
+ },
+ calendar : {
+ sameDay: '[Сегодня в] LT',
+ nextDay: '[Завтра в] LT',
+ lastDay: '[Вчера в] LT',
+ nextWeek: function () {
+ return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT';
+ },
+ lastWeek: function () {
+ switch (this.day()) {
+ case 0:
+ return '[В прошлое] dddd [в] LT';
+ case 1:
+ case 2:
+ case 4:
+ return '[В прошлый] dddd [в] LT';
+ case 3:
+ case 5:
+ case 6:
+ return '[В прошлую] dddd [в] LT';
+ }
+ },
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : "через %s",
+ past : "%s назад",
+ s : "несколько секунд",
+ m : relativeTimeWithPlural,
+ mm : relativeTimeWithPlural,
+ h : "час",
+ hh : relativeTimeWithPlural,
+ d : "день",
+ dd : relativeTimeWithPlural,
+ M : "месяц",
+ MM : relativeTimeWithPlural,
+ y : "год",
+ yy : relativeTimeWithPlural
+ },
+
+ ordinal: function (number, period) {
+ switch (period) {
+ case 'M':
+ case 'd':
+ case 'DDD':
+ return number + '-й';
+ case 'D':
+ return number + '-го';
+ case 'w':
+ case 'W':
+ return number + '-я';
+ default:
+ return number;
+ }
+ },
+
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+});