Commits

Max Zaets committed e3ad4e1

added timeago extension

Comments (0)

Files changed (37)

 			'issues.models.*',
 			'issues.components.*',
             'issues.extensions',
+            'issues.extensions.timeago.*',
 		));
 
         // check if there's a proper provider set

extensions/timeago/JTimeAgo.php

+<?php
+/**
+ * User: yiqing
+ * Date: 11-12-24
+ * Time: 下午11:10
+ * @see  https://github.com/rmm5t/jquery-timeago
+ *.......................................................................................
+ * @version 0.11.3   same as the timeago !
+ * @requires yii 1.1.x
+ * @author  yiqing
+ * @license MIT License - http://www.opensource.org/licenses/mit-license.php
+ *........................................................................................
+ */
+class JTimeAgo extends CWidget
+{
+
+//............<don't waste the widget id of yii generated ids>.....................................................................
+    /**
+     * @param bool $autoGenerate
+     * @return string
+     */
+    public function getId($autoGenerate = true)
+    {
+        $id = parent::getId($autoGenerate);
+        if ($this->startsWith($id, 'yw')) {
+            return __CLASS__ . substr($id, 2);
+        }
+        return $id;
+    }
+
+    /**
+     * @param $h
+     * @param $n
+     * @return bool
+     * if $h  stars with $n
+     *
+     */
+    protected function startsWith($h, $n)
+    {
+        return (false !== ($i = strrpos($h, $n)) &&
+            $i === strlen($h) - strlen($n));
+    }
+//.................................................................................
+    /**
+     * @var CClientScript
+     */
+    protected $cs;
+
+    /**
+     * @var bool
+     */
+    public $debug = YII_DEBUG;
+
+
+    /**
+     * @var string
+     */
+    public $selector = '.timeago';
+
+
+    /**
+     * @var array
+     */
+    public $options = array();
+
+    /**
+     * @var array
+     */
+    public $settings = array();
+
+    /**
+     * @var array
+     * canonical id to the corresponding js name ,the js file is under locales dir.
+     * just used only when the file name is different from the canonical form
+     * and you don't want modify the locale file manually.
+     *  eg:   array('zh_cn'=>'zh-cn')
+     * 
+     * ( In canonical form, a locale ID consists of only underscores and lower-case letters.)
+     */
+    public $localeIdMap = array();
+
+    /**
+     * @var bool
+     */
+    public $useLocale = true ;
+
+    /**
+     * @var string
+     */
+    protected $baseUrl ;
+
+    /**
+     * @var string
+     */
+    protected $assetsPath ;
+
+    /**
+     *
+     */
+    public function init()
+    {
+        //  most of places use it so make it as instance variable and for intelligence tips from IDE
+        $this->cs = Yii::app()->getClientScript();
+        parent::init();
+    }
+
+    /**
+     * @return void
+     */
+    public function  run()
+    {
+        $this->publishAssets()
+            ->registerClientScripts();
+    }
+
+    /**
+     * @return JTimeAgo
+     */
+    public function publishAssets()
+    {
+        $this->assetsPath = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
+        $this->baseUrl = Yii::app()->getAssetManager()->publish($this->assetsPath, false, -1, $this->debug);
+        return $this;
+    }
+
+    /**
+     * @return JTimeAgo
+     */
+    public function registerClientScripts()
+    {
+        //> .register js file;
+        $this->cs->registerCoreScript('jquery')->registerScriptFile($this->baseUrl . '/jquery.timeago.js');
+
+        if($this->useLocale == true) $this->handleLocale(true);
+
+        if (empty($this->selector)) {
+            // manually use it ?
+              return  $this;
+        }
+
+        $jsCode = '';
+        //> handle some settings
+        if (!empty($this->settings)) {
+            $settings = CJavaScript::encode($this->settings);
+            $jsCode .= <<<SETTINGS
+   jQuery.timeago.settings = {$settings};
+SETTINGS;
+            $jsCode .= "\n";
+        }
+
+        $options = CJavaScript::encode($this->options);
+        //>  the js code for setup
+        $jsCode .= <<<SETUP
+        jQuery("{$this->selector}").timeago({$options});
+SETUP;
+
+        //> register jsCode
+        $this->cs->registerScript(__CLASS__ . '#' . $this->getId(), $jsCode, CClientScript::POS_READY);
+        return $this;
+    }
+
+
+   /**
+    * @param bool $registerLocaleJs
+    * @return JTimeAgo
+    */
+    public function handleLocale($registerLocaleJs = true)
+    {
+        //  $localeId = Yii::app()->getLocale()->getCanonicalID($localeId) ;
+        $localeId =  Yii::app()->getLocale()->getId();
+        if(isset($this->localeIdMap[$localeId])){
+            $localeId = $this->localeIdMap[$localeId] ;
+        }
+        $localeJsPath = $this->assetsPath . DIRECTORY_SEPARATOR . 'locales' . DIRECTORY_SEPARATOR ."jquery.timeago.{$localeId}.js";
+       // echo $localeJsPath ; die(__FILE__);
+        if(! is_file($localeJsPath) ){
+            /**
+             * try  another locale form :
+             */
+            $localeId = str_replace('_','-',$localeId);
+            $localeJsPath = $this->assetsPath . DIRECTORY_SEPARATOR . 'locales' . DIRECTORY_SEPARATOR ."jquery.timeago.{$localeId}.js";
+            if(! is_file($localeJsPath)){
+                return $this;
+            }
+        }
+        if($registerLocaleJs == true){
+            $localeJsUrl = $this->baseUrl.'/locales/'."jquery.timeago.{$localeId}.js";
+            $this->cs->registerScriptFile($localeJsUrl);
+        }else{
+            $localeJsCode = file_get_contents($localeJsPath);
+            $this->cs->registerScript(__CLASS__.'_locale_'.$this->getId(),$localeJsCode,CClientScript::POS_HEAD);
+        }
+    }
+
+    /**
+     * @param $name
+     * @param $value
+     */
+    public function __set($name, $value)
+    {
+        if(strcasecmp($name,'debugMode') == 0 ){
+            //back compatible  with previous version
+            $this->debug = $value ;
+
+        }else  try {
+            //shouldn't swallow the parent ' __set operation
+            parent::__set($name, $value);
+        } catch (Exception $e) {
+            $this->options[$name] = $value;
+        }
+    }
+
+
+    /**
+     * @static
+     * @param bool $hashByName
+     * @return string
+     * return the widget assetsUrl
+     */
+    public static function getAssetsUrl($hashByName = false)
+    {
+        // return CHtml::asset(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets', $hashByName);
+        return Yii::app()->getAssetManager()->publish(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets', $hashByName, -1, YII_DEBUG);
+    }
+}
+

extensions/timeago/assets/jquery.timeago.js

+/**
+ * Timeago is a jQuery plugin that makes it easy to support automatically
+ * updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").
+ *
+ * @name timeago
+ * @version 0.11.3
+ * @requires jQuery v1.2.3+
+ * @author Ryan McGeary
+ * @license MIT License - http://www.opensource.org/licenses/mit-license.php
+ *
+ * For usage and examples, visit:
+ * http://timeago.yarp.com/
+ *
+ * Copyright (c) 2008-2012, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org)
+ */
+(function($) {
+  $.timeago = function(timestamp) {
+    if (timestamp instanceof Date) {
+      return inWords(timestamp);
+    } else if (typeof timestamp === "string") {
+      return inWords($.timeago.parse(timestamp));
+    } else if (typeof timestamp === "number") {
+      return inWords(new Date(timestamp));
+    } else {
+      return inWords($.timeago.datetime(timestamp));
+    }
+  };
+  var $t = $.timeago;
+
+  $.extend($.timeago, {
+    settings: {
+      refreshMillis: 60000,
+      allowFuture: false,
+      strings: {
+        prefixAgo: null,
+        prefixFromNow: null,
+        suffixAgo: "ago",
+        suffixFromNow: "from now",
+        seconds: "less than a minute",
+        minute: "about a minute",
+        minutes: "%d minutes",
+        hour: "about an hour",
+        hours: "about %d hours",
+        day: "a day",
+        days: "%d days",
+        month: "about a month",
+        months: "%d months",
+        year: "about a year",
+        years: "%d years",
+        wordSeparator: " ",
+        numbers: []
+      }
+    },
+    inWords: function(distanceMillis) {
+      var $l = this.settings.strings;
+      var prefix = $l.prefixAgo;
+      var suffix = $l.suffixAgo;
+      if (this.settings.allowFuture) {
+        if (distanceMillis < 0) {
+          prefix = $l.prefixFromNow;
+          suffix = $l.suffixFromNow;
+        }
+      }
+
+      var seconds = Math.abs(distanceMillis) / 1000;
+      var minutes = seconds / 60;
+      var hours = minutes / 60;
+      var days = hours / 24;
+      var years = days / 365;
+
+      function substitute(stringOrFunction, number) {
+        var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction;
+        var value = ($l.numbers && $l.numbers[number]) || number;
+        return string.replace(/%d/i, value);
+      }
+
+      var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) ||
+        seconds < 90 && substitute($l.minute, 1) ||
+        minutes < 45 && substitute($l.minutes, Math.round(minutes)) ||
+        minutes < 90 && substitute($l.hour, 1) ||
+        hours < 24 && substitute($l.hours, Math.round(hours)) ||
+        hours < 42 && substitute($l.day, 1) ||
+        days < 30 && substitute($l.days, Math.round(days)) ||
+        days < 45 && substitute($l.month, 1) ||
+        days < 365 && substitute($l.months, Math.round(days / 30)) ||
+        years < 1.5 && substitute($l.year, 1) ||
+        substitute($l.years, Math.round(years));
+
+      var separator = $l.wordSeparator === undefined ?  " " : $l.wordSeparator;
+      return $.trim([prefix, words, suffix].join(separator));
+    },
+    parse: function(iso8601) {
+      var s = $.trim(iso8601);
+      s = s.replace(/\.\d\d\d+/,""); // remove milliseconds
+      s = s.replace(/-/,"/").replace(/-/,"/");
+      s = s.replace(/T/," ").replace(/Z/," UTC");
+      s = s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400
+      return new Date(s);
+    },
+    datetime: function(elem) {
+      var iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title");
+      return $t.parse(iso8601);
+    },
+    isTime: function(elem) {
+      // jQuery's `is()` doesn't play well with HTML5 in IE
+      return $(elem).get(0).tagName.toLowerCase() === "time"; // $(elem).is("time");
+    }
+  });
+
+  $.fn.timeago = function() {
+    var self = this;
+    self.each(refresh);
+
+    var $s = $t.settings;
+    if ($s.refreshMillis > 0) {
+      setInterval(function() { self.each(refresh); }, $s.refreshMillis);
+    }
+    return self;
+  };
+
+  function refresh() {
+    var data = prepareData(this);
+    if (!isNaN(data.datetime)) {
+      $(this).text(inWords(data.datetime));
+    }
+    return this;
+  }
+
+  function prepareData(element) {
+    element = $(element);
+    if (!element.data("timeago")) {
+      element.data("timeago", { datetime: $t.datetime(element) });
+      var text = $.trim(element.text());
+      if (text.length > 0 && !($t.isTime(element) && element.attr("title"))) {
+        element.attr("title", text);
+      }
+    }
+    return element.data("timeago");
+  }
+
+  function inWords(date) {
+    return $t.inWords(distance(date));
+  }
+
+  function distance(date) {
+    return (new Date().getTime() - date.getTime());
+  }
+
+  // fix for IE6 suckage
+  document.createElement("abbr");
+  document.createElement("time");
+}(jQuery));

extensions/timeago/assets/locales/README.md

+# Locale override examples for timeago
+
+You can represent time statements in most western languages where
+a prefix and/or suffix is used.
+
+The default case is to use suffix only (as in English), which you
+do by providing the `suffixAgo` and `suffixFromNow` settings in
+the strings hash (earlier versions of timeago used the deprecated
+`ago` and `fromNow` options). If present, they are used.
+
+    2 minutes [suffixAgo]
+    2 minutes [suffixFromNow]
+
+In case you want to use prefix only instead of
+suffix (e.g. Greek), you provide the `prefixAgo` and
+`prefixFromNow` options in the strings hash and leave `suffixAgo`
+and `suffixFromNow` empty or null.
+
+    [prefixAgo] 2 minutes
+    [prefixFromNow] 2 minutes
+
+For languages where you want to use a prefix only for future
+tense and prefix/suffix for past tense (for example swedish), you
+can combine the prefix and suffixes as needed.
+
+    [prefixAgo] 2 minutes [suffixAgo]
+    [prefixFromNow] 2 minutes

extensions/timeago/assets/locales/jquery.timeago.ar.js

+// Language: Arabic
+// Translated By Khaled Attia < Khal3d.com >
+(function() {
+  function numpf(num, w, x, y, z) {
+    if( num == 0 ) {
+      return w;
+    } else if( num == 2 ) {
+      return x;
+    } else if( num >= 3 && num <= 10) {
+      return y; // 3:10
+    } else {
+      return z; // 11+
+    }
+  }
+  jQuery.timeago.settings.strings = {
+    prefixAgo: "منذ",
+    prefixFromNow: "يتبقى",
+    suffixAgo: null,
+    suffixFromNow: null, // null OR "من الآن"
+    seconds: function(value) { return numpf(value, "لحظات", "ثانيتين", "%d ثواني", "%d ثانيه"); },
+    minute: "دقيقة",
+    minutes: function(value) { return numpf(value, null, "دقيقتين", "%d دقائق", "%d دقيقة"); },
+    hour: "ساعة",
+    hours: function(value) { return numpf(value, null, "ساعتين", "%d ساعات", "%d ساعة"); },
+    day: "يوم",
+    days: function(value) { return numpf(value, null, "يومين", "%d أيام", "%d يوم"); },
+    month: "شهر",
+    months: function(value) { return numpf(value, null, "شهرين", "%d أشهر", "%d شهر"); },
+    year: "سنه",
+    years: function(value) { return numpf(value, null, "سنتين", "%d سنوات", "%d سنه"); }
+  };
+})();

extensions/timeago/assets/locales/jquery.timeago.bg.js

+// Bulgarian
+jQuery.timeago.settings.strings = {
+  prefixAgo: "преди",
+  prefixFromNow: "след",
+  suffixAgo: null,
+  suffixFromNow: null,
+  seconds: "по-малко от минута",
+  minute: "една минута",
+  minutes: "%d минути",
+  hour: "един час",
+  hours: "%d часа",
+  day: "един ден",
+  days: "%d дни",
+  month: "един месец",
+  months: "%d месеца",
+  year: "една година",
+  years: "%d години"
+};

extensions/timeago/assets/locales/jquery.timeago.bs.js

+// Bosnian
+(function() {
+  var numpf;
+
+  numpf = function(n, f, s, t) {
+    var n10;
+    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 = {
+    prefixAgo: "prije",
+    prefixFromNow: "za",
+    suffixAgo: null,
+    suffixFromNow: null,
+    second: "sekund",
+    seconds: function(value) {
+      return numpf(value, "%d sekund", "%d sekunde", "%d sekundi");
+    },
+    minute: "oko minut",
+    minutes: function(value) {
+      return numpf(value, "%d minut", "%d minute", "%d minuta");
+    },
+    hour: "oko sat",
+    hours: function(value) {
+      return numpf(value, "%d sat", "%d sata", "%d sati");
+    },
+    day: "oko jednog dana",
+    days: function(value) {
+      return numpf(value, "%d dan", "%d dana", "%d dana");
+    },
+    month: "mjesec dana",
+    months: function(value) {
+      return numpf(value, "%d mjesec", "%d mjeseca", "%d mjeseci");
+    },
+    year: "prije godinu dana ",
+    years: function(value) {
+      return numpf(value, "%d godinu", "%d godine", "%d godina");
+    },
+    wordSeparator: " "
+  };
+
+}).call(this);

extensions/timeago/assets/locales/jquery.timeago.ca.js

+// Catalan
+jQuery.timeago.settings.strings = {
+  prefixAgo: "fa",
+  prefixFromNow: "d'aqui a",
+  suffixAgo: null,
+  suffixFromNow: null,
+  seconds: "menys d'1 minut",
+  minute: "1 minut",
+  minutes: "uns %d minuts",
+  hour: "1 hora",
+  hours: "unes %d hores",
+  day: "1 dia",
+  days: "%d dies",
+  month: "aproximadament un mes",
+  months: "%d mesos",
+  year: "aproximadament un any",
+  years: "%d anys"
+};

extensions/timeago/assets/locales/jquery.timeago.cy.js

+// Welsh
+jQuery.timeago.settings.strings = {
+  prefixAgo: null,
+  prefixFromNow: null,
+  suffixAgo: "yn ôl",
+  suffixFromNow: "o hyn",
+  seconds: "llai na munud",
+  minute: "am funud",
+  minutes: "%d munud",
+  hour: "tua awr",
+  hours: "am %d awr",
+  day: "y dydd",
+  days: "%d diwrnod",
+  month: "tua mis",
+  months: "%d mis",
+  year: "am y flwyddyn",
+  years: "%d blynedd",
+  wordSeparator: " ",
+  numbers: []
+};

extensions/timeago/assets/locales/jquery.timeago.cz.js

+// Czech
+jQuery.timeago.settings.strings = {
+  prefixAgo: "před",
+  prefixFromNow: null,
+  suffixAgo: null,
+  suffixFromNow: null,
+  seconds: "méně než minutou",
+  minute: "minutou",
+  minutes: "%d minutami",
+  hour: "hodinou",
+  hours: "%d hodinami",
+  day: "1 dnem",
+  days: "%d dny",
+  month: "1 měsícem",
+  months: "%d měsíci",
+  year: "1 rokem",
+  years: "%d roky"
+};

extensions/timeago/assets/locales/jquery.timeago.da.js

+// Danish
+jQuery.timeago.settings.strings = {
+  prefixAgo: "for",
+  prefixFromNow: "om",
+  suffixAgo: "siden",
+  suffixFromNow: "",
+  seconds: "mindre end et minut",
+  minute: "ca. et minut",
+  minutes: "%d minutter",
+  hour: "ca. en time",
+  hours: "ca. %d timer",
+  day: "en dag",
+  days: "%d dage",
+  month: "ca. en måned",
+  months: "%d måneder",
+  year: "ca. et år",
+  years: "%d år"
+};

extensions/timeago/assets/locales/jquery.timeago.de.js

+// German
+jQuery.timeago.settings.strings = {
+  prefixAgo: "vor",
+  prefixFromNow: "in",
+  suffixAgo: "",
+  suffixFromNow: "",
+  seconds: "wenigen Sekunden",
+  minute: "etwa einer Minute",
+  minutes: "%d Minuten",
+  hour: "etwa einer Stunde",
+  hours: "%d Stunden",
+  day: "etwa einem Tag",
+  days: "%d Tagen",
+  month: "etwa einem Monat",
+  months: "%d Monaten",
+  year: "etwa einem Jahr",
+  years: "%d Jahren"
+};

extensions/timeago/assets/locales/jquery.timeago.el.js

+// Greek
+jQuery.timeago.settings.strings = {
+  prefixAgo: "πριν",
+  prefixFromNow: "σε",
+  suffixAgo: "",
+  suffixFromNow: "",
+  seconds: "λιγότερο από ένα λεπτό",
+  minute: "περίπου ένα λεπτό",
+  minutes: "%d λεπτά",
+  hour: "περίπου μία ώρα",
+  hours: "περίπου %d ώρες",
+  day: "μία μέρα",
+  days: "%d μέρες",
+  month: "περίπου ένα μήνα",
+  months: "%d μήνες",
+  year: "περίπου ένα χρόνο",
+  years: "%d χρόνια"
+};

extensions/timeago/assets/locales/jquery.timeago.es.js

+// Spanish
+jQuery.timeago.settings.strings = {
+   prefixAgo: "hace",
+   prefixFromNow: "dentro de",
+   suffixAgo: "",
+   suffixFromNow: "",
+   seconds: "menos de un minuto",
+   minute: "un minuto",
+   minutes: "unos %d minutos",
+   hour: "una hora",
+   hours: "%d horas",
+   day: "un día",
+   days: "%d días",
+   month: "un mes",
+   months: "%d meses",
+   year: "un año",
+   years: "%d años"
+};

extensions/timeago/assets/locales/jquery.timeago.fa.js

+
+// Persian
+// Use DIR attribute for RTL text in Persian Language for ABBR tag .
+// By MB.seifollahi@gmail.com
+jQuery.timeago.settings.strings = {
+  prefixAgo: null,
+  prefixFromNow: null,
+  suffixAgo: "پیش",
+  suffixFromNow: "از حال",
+  seconds: "کمتر از یک دقیقه",
+  minute: "حدود یک دقیقه",
+  minutes: "%d دقیقه",
+  hour: "حدود یک ساعت",
+  hours: "حدود %d ساعت",
+  day: "یک روز",
+  days: "%d روز",
+  month: "حدود یک ماه",
+  months: "%d ماه",
+  year: "حدود یک سال",
+  years: "%d سال",
+  wordSeparator: " "
+};

extensions/timeago/assets/locales/jquery.timeago.fi.js

+// Finnish
+jQuery.timeago.settings.strings = {
+  prefixAgo: null,
+  prefixFromNow: null,
+  suffixAgo: "sitten",
+  suffixFromNow: "tulevaisuudessa",
+  seconds: "alle minuutti",
+  minute: "minuutti",
+  minutes: "%d minuuttia",
+  hour: "tunti",
+  hours: "%d tuntia",
+  day: "päivä",
+  days: "%d päivää",
+  month: "kuukausi",
+  months: "%d kuukautta",
+  year: "vuosi",
+  years: "%d vuotta"
+};
+
+// The above is not a great localization because one would usually
+// write "2 days ago" in Finnish as "2 päivää sitten", however
+// one would write "2 days into the future" as "2:n päivän päästä"
+// which cannot be achieved with localization support this simple.
+// This is because Finnish has word suffixes (attached directly
+// to the end of the word). The word "day" is "päivä" in Finnish.
+// As workaround, the above localizations will say
+// "2 päivää tulevaisuudessa" which is understandable but
+// not as fluent.

extensions/timeago/assets/locales/jquery.timeago.fr.js

+// French
+jQuery.timeago.settings.strings = {
+   // environ ~= about, it's optional
+   prefixAgo: "il y a",
+   prefixFromNow: "d'ici",
+   seconds: "moins d'une minute",
+   minute: "environ une minute",
+   minutes: "environ %d minutes",
+   hour: "environ une heure",
+   hours: "environ %d heures",
+   day: "environ un jour",
+   days: "environ %d jours",
+   month: "environ un mois",
+   months: "environ %d mois",
+   year: "un an",
+   years: "%d ans"
+};

extensions/timeago/assets/locales/jquery.timeago.he.js

+// Hebrew
+jQuery.timeago.settings.strings = {
+  prefixAgo: "לפני",
+  prefixFromNow: "מעכשיו",
+  suffixAgo: "",
+  suffixFromNow: "",
+  seconds: "פחות מדקה",
+  minute: "דקה",
+  minutes: "%d דקות",
+  hour: "שעה",
+  hours: "%d שעות",
+  day: "יום",
+  days: "%d ימים",
+  month: "חודש",
+  months: "%d חודשים",
+  year: "שנה",
+  years: "%d שנים"
+};

extensions/timeago/assets/locales/jquery.timeago.hr.js

+// Croatian
+(function () {
+    var numpf;
+
+    numpf = function (n, f, s, t) {
+        var n10;
+        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 = {
+        prefixAgo: "prije",
+        prefixFromNow: "za",
+        suffixAgo: null,
+        suffixFromNow: null,
+        second: "sekundu",
+        seconds: function (value) {
+            return numpf(value, "%d sekundu", "%d sekunde", "%d sekundi");
+        },
+        minute: "oko minutu",
+        minutes: function (value) {
+            return numpf(value, "%d minutu", "%d minute", "%d minuta");
+        },
+        hour: "oko jedan sat",
+        hours: function (value) {
+            return numpf(value, "%d sat", "%d sata", "%d sati");
+        },
+        day: "jedan dan",
+        days: function (value) {
+            return numpf(value, "%d dan", "%d dana", "%d dana");
+        },
+        month: "mjesec dana",
+        months: function (value) {
+            return numpf(value, "%d mjesec", "%d mjeseca", "%d mjeseci");
+        },
+        year: "prije godinu dana",
+        years: function (value) {
+            return numpf(value, "%d godinu", "%d godine", "%d godina");
+        },
+        wordSeparator: " "
+    };
+
+}).call(this);

extensions/timeago/assets/locales/jquery.timeago.hu.js

+// Hungarian
+jQuery.timeago.settings.strings = {
+  prefixAgo: null,
+  prefixFromNow: null,
+  suffixAgo: null,
+  suffixFromNow: null,
+  seconds: "kevesebb mint egy perce",
+  minute: "körülbelül egy perce",
+  minutes: "%d perce",
+  hour: "körülbelül egy órája",
+  hours: "körülbelül %d órája",
+  day: "körülbelül egy napja",
+  days: "%d napja",
+  month: "körülbelül egy hónapja",
+  months: "%d hónapja",
+  year: "körülbelül egy éve",
+  years: "%d éve"
+};

extensions/timeago/assets/locales/jquery.timeago.hy.js

+// Armenian
+jQuery.timeago.settings.strings = {
+  prefixAgo: null,
+  prefixFromNow: null,
+  suffixAgo: "առաջ",
+  suffixFromNow: "հետո",
+  seconds: "վայրկյաններ",
+  minute: "մեկ րոպե",
+  minutes: "%d րոպե",
+  hour: "մեկ ժամ",
+  hours: "%d ժամ",
+  day: "մեկ օր",
+  days: "%d օր",
+  month: "մեկ ամիս",
+  months: "%d ամիս",
+  year: "մեկ տարի",
+  years: "%d տարի"
+};

extensions/timeago/assets/locales/jquery.timeago.id.js

+// Indonesian
+jQuery.timeago.settings.strings = {
+  prefixAgo: null,
+  prefixFromNow: null,
+  suffixAgo: "yang lalu",
+  suffixFromNow: "dari sekarang",
+  seconds: "kurang dari semenit",
+  minute: "sekitar satu menit",
+  minutes: "%d menit",
+  hour: "sekitar sejam",
+  hours: "sekitar %d jam",
+  day: "sehari",
+  days: "%d hari",
+  month: "sekitar sebulan",
+  months: "%d tahun",
+  year: "sekitar setahun",
+  years: "%d tahun"
+};

extensions/timeago/assets/locales/jquery.timeago.it.js

+// Italian
+jQuery.timeago.settings.strings = {
+  suffixAgo: "fa",
+  suffixFromNow: "da ora",
+  seconds: "meno di un minuto",
+  minute: "circa un minuto",
+  minutes: "%d minuti",
+  hour: "circa un'ora",
+  hours: "circa %d ore",
+  day: "un giorno",
+  days: "%d giorni",
+  month: "circa un mese",
+  months: "%d mesi",
+  year: "circa un anno",
+  years: "%d anni"
+};

extensions/timeago/assets/locales/jquery.timeago.ja.js

+// Japanese
+jQuery.timeago.settings.strings = {
+  prefixAgo: "",
+  prefixFromNow: "今から",
+  suffixAgo: "前",
+  suffixFromNow: "後",
+  seconds: "ほんの数秒",
+  minute: "約一分",
+  minutes: "%d 分",
+  hour: "大体一時間",
+  hours: "大体 %d 時間位",
+  day: "一日",
+  days: "%d 日ほど",
+  month: "大体一ヶ月",
+  months: "%d ヶ月ほど",
+  year: "丁度一年(虎舞流w)",
+  years: "%d 年",
+  wordSeparator: ""
+};

extensions/timeago/assets/locales/jquery.timeago.ko.js

+// Korean
+jQuery.timeago.settings.strings = {
+  suffixAgo: "전",
+  suffixFromNow: "후",
+  seconds: "1분 이내",
+  minute: "1분",
+  minutes: "%d분",
+  hour: "1시간",
+  hours: "%d시간",
+  day: "하루",
+  days: "%d일",
+  month: "한 달",
+  months: "%d달",
+  year: "1년",
+  years: "%d년",
+  wordSeparator: " "
+};

extensions/timeago/assets/locales/jquery.timeago.nl.js

+// Dutch
+jQuery.timeago.settings.strings = {
+   suffixAgo: "geleden",
+   suffixFromNow: "vanaf nu",
+   seconds: "iets minder dan een minuut",
+   minute: "ongeveer een minuut",
+   minutes: "%d minuten",
+   hour: "ongeveer een uur",
+   hours: "ongeveer %d uur",
+   day: "een dag",
+   days: "%d dagen",
+   month: "ongeveer een maand",
+   months: "%d maanden",
+   year: "ongeveer een jaar",
+   years: "%d jaar"
+};

extensions/timeago/assets/locales/jquery.timeago.no.js

+// Norwegian
+jQuery.timeago.settings.strings = {
+  prefixAgo: "for",
+  prefixFromNow: "om",
+  suffixAgo: "siden",
+  suffixFromNow: "",
+  seconds: "mindre enn et minutt",
+  minute: "ca. et minutt",
+  minutes: "%d minutter",
+  hour: "ca. en time",
+  hours: "ca. %d timer",
+  day: "en dag",
+  days: "%d dager",
+  month: "ca. en måned",
+  months: "%d måneder",
+  year: "ca. et år",
+  years: "%d år"
+};

extensions/timeago/assets/locales/jquery.timeago.pl.js

+// Polish
+(function() {
+  function numpf(n, s, t) {
+    // s - 2-4, 22-24, 32-34 ...
+    // t - 5-21, 25-31, ...
+    var n10 = n % 10;
+    if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) {
+      return s;
+    } else {
+      return t;
+    }
+  }
+
+  jQuery.timeago.settings.strings = {
+    prefixAgo: null,
+    prefixFromNow: "za",
+    suffixAgo: "temu",
+    suffixFromNow: null,
+    seconds: "mniej niż minutę",
+    minute: "minutę",
+    minutes: function(value) { return numpf(value, "%d minuty", "%d minut"); },
+    hour: "godzinę",
+    hours: function(value) { return numpf(value, "%d godziny", "%d godzin"); },
+    day: "dzień",
+    days: "%d dni",
+    month: "miesiąc",
+    months: function(value) { return numpf(value, "%d miesiące", "%d miesięcy"); },
+    year: "rok",
+    years: function(value) { return numpf(value, "%d lata", "%d lat"); }
+  };
+})();

extensions/timeago/assets/locales/jquery.timeago.pt.js

+// Portuguese
+jQuery.timeago.settings.strings = {
+   suffixAgo: "atrás",
+   suffixFromNow: "a partir de agora",
+   seconds: "menos de um minuto",
+   minute: "cerca de um minuto",
+   minutes: "%d minutos",
+   hour: "cerca de uma hora",
+   hours: "cerca de %d horas",
+   day: "um dia",
+   days: "%d dias",
+   month: "cerca de um mês",
+   months: "%d meses",
+   year: "cerca de um ano",
+   years: "%d anos"
+};

extensions/timeago/assets/locales/jquery.timeago.ro.js

+// Romanian
+$.timeago.settings.strings = {
+  prefixAgo: "acum",
+  prefixFromNow: "in timp de",
+  suffixAgo: "",
+  suffixFromNow: "",
+  seconds: "mai putin de un minut",
+  minute: "un minut",
+  minutes: "%d minute",
+  hour: "o ora",
+  hours: "%d ore",
+  day: "o zi",
+  days: "%d zile",
+  month: "o luna",
+  months: "%d luni",
+  year: "un an",
+  years: "%d ani"
+};

extensions/timeago/assets/locales/jquery.timeago.ru.js

+// Russian
+(function() {
+  function numpf(n, f, s, t) {
+    // f - 1, 21, 31, ...
+    // s - 2-4, 22-24, 32-34 ...
+    // t - 5-20, 25-30, ...
+    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 = {
+    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 лет"); }
+  };
+})();

extensions/timeago/assets/locales/jquery.timeago.sv.js

+// Swedish
+jQuery.timeago.settings.strings = {
+  prefixAgo: "för",
+  prefixFromNow: "om",
+  suffixAgo: "sedan",
+  suffixFromNow: "",
+  seconds: "mindre än en minut",
+  minute: "ungefär en minut",
+  minutes: "%d minuter",
+  hour: "ungefär en timme",
+  hours: "ungefär %d timmar",
+  day: "en dag",
+  days: "%d dagar",
+  month: "ungefär en månad",
+  months: "%d månader",
+  year: "ungefär ett år",
+  years: "%d år"
+};

extensions/timeago/assets/locales/jquery.timeago.tr.js

+// Turkish
+jQuery.extend($.timeago.settings.strings, {
+   suffixAgo: 'önce',
+   suffixFromNow: null,
+   seconds: '1 dakikadan',
+   minute: '1 dakika',
+   minutes: '%d dakika',
+   hour: '1 saat',
+   hours: '%d saat',
+   day: '1 gün',
+   days: '%d gün',
+   month: '1 ay',
+   months: '%d ay',
+   year: '1 yıl',
+   years: '%d yıl'
+});

extensions/timeago/assets/locales/jquery.timeago.uk.js

+// Ukrainian
+(function() {
+  function numpf(n, f, s, t) {
+    // f - 1, 21, 31, ...
+    // s - 2-4, 22-24, 32-34 ...
+    // t - 5-20, 25-30, ...
+    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 = {
+    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 років"); }
+  };
+})();

extensions/timeago/assets/locales/jquery.timeago.uz.js

+//Uzbek
+jQuery.timeago.settings.strings = {
+  prefixAgo: null,
+  prefixFromNow: "keyin",
+  suffixAgo: "avval",
+  suffixFromNow: null,
+  seconds: "bir necha soniya",
+  minute: "1 daqiqa",
+  minutes: function(value) { return "%d daqiqa" },
+  hour: "1 soat",
+  hours: function(value) { return "%d soat" },
+  day: "1 kun",
+  days: function(value) { return "%d kun" },
+  month: "1 oy",
+  months: function(value) { return "%d oy" },
+  year: "1 yil",
+  years: function(value) { return "%d yil" },
+  wordSeparator: " "
+};

extensions/timeago/assets/locales/jquery.timeago.zh_cn.js

+// Simplified Chinese
+jQuery.timeago.settings.strings = {
+  prefixAgo: null,
+  prefixFromNow: "从现在开始",
+  suffixAgo: "之前",
+  suffixFromNow: null,
+  seconds: "不到 1 分钟",
+  minute: "大约 1 分钟",
+  minutes: "%d 分钟",
+  hour: "大约 1 小时",
+  hours: "大约 %d 小时",
+  day: "1 天",
+  days: "%d 天",
+  month: "大约 1 个月",
+  months: "%d 月",
+  year: "大约 1 年",
+  years: "%d 年",
+  numbers: [],
+  wordSeparator: ""
+};

extensions/timeago/assets/locales/jquery.timeago.zh_tw.js

+// Traditional Chinese, zh-tw
+jQuery.timeago.settings.strings = {
+  prefixAgo: null,
+  prefixFromNow: "從現在開始",
+  suffixAgo: "之前",
+  suffixFromNow: null,
+  seconds: "不到 1 分鐘",
+  minute: "大約 1 分鐘",
+  minutes: "%d 分鐘",
+  hour: "大約 1 小時",
+  hours: "大約 %d 小時",
+  day: "1 天",
+  days: "%d 天",
+  month: "大約 1 個月",
+  months: "%d 月",
+  year: "大約 1 年",
+  years: "%d 年",
+  numbers: [],
+  wordSeparator: ""
+};
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.