Sha256: 384b7ed09d518fc747d70c9d6112bea94e14cc0e7e98b82f311f967d0c5f08b6

Contents?: true

Size: 1.44 KB

Versions: 5

Compression:

Stored size: 1.44 KB

Contents

(function (factory) {
  if (typeof define === 'function' && define.amd) {
    define(['jquery'], factory);
  } else if (typeof module === 'object' && typeof module.exports === 'object') {
    factory(require('jquery'));
  } else {
    factory(jQuery);
  }
}(function (jQuery) {
  // Russian
  function numpf(n, f, s, t) {
    // f - 1, 21, 31, ...
    // s - 2-4, 22-24, 32-34 ...
    // t - 5-20, 25-30, ...
    n = n % 100;
    var n10 = n % 10;
    if ( (n10 === 1) && ( (n === 1) || (n > 20) ) ) {
      return f;
    } else if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) {
      return s;
    } else {
      return t;
    }
  }

  jQuery.timeago.settings.strings["ru"] = {
    prefixAgo: null,
    prefixFromNow: "через",
    suffixAgo: "назад",
    suffixFromNow: null,
    seconds: "меньше минуты",
    minute: "минуту",
    minutes: function(value) { return numpf(value, "%d минуту", "%d минуты", "%d минут"); },
    hour: "час",
    hours: function(value) { return numpf(value, "%d час", "%d часа", "%d часов"); },
    day: "день",
    days: function(value) { return numpf(value, "%d день", "%d дня", "%d дней"); },
    month: "месяц",
    months: function(value) { return numpf(value, "%d месяц", "%d месяца", "%d месяцев"); },
    year: "год",
    years: function(value) { return numpf(value, "%d год", "%d года", "%d лет"); }
  };
}));

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails-timeago-2.20.0 vendor/assets/javascripts/locales/jquery.timeago.ru.js
rails-timeago-2.19.1 vendor/assets/javascripts/locales/jquery.timeago.ru.js
rails-timeago-2.19.0 vendor/assets/javascripts/locales/jquery.timeago.ru.js
rails-timeago-2.18.0 vendor/assets/javascripts/locales/jquery.timeago.ru.js
rails-timeago-2.17.1 vendor/assets/javascripts/locales/jquery.timeago.ru.js