{"issue":{"state":"open","created_at":"2011-02-10T04:55:31Z","updated_at":"2011-12-06T02:06:51Z","user":{"gravatar_id":"a235706e3d81b614acaec3368edfea4b","id":137217,"url":"https://api.github.com/users/deceze","login":"deceze","avatar_url":"https://secure.gravatar.com/avatar/a235706e3d81b614acaec3368edfea4b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":1,"body":"Allowing `jQuery.timeago.settings.strings.numbers` to be a callback function and adding optional `jQuery.timeago.settings.strings.formatter` callback, which can be used as a general post processing callback instead of the default `$.trim([prefix, words, suffix].join(\" \"))`.\n\nThis allows 100% localized Japanese for example:\n\n    jQuery.timeago.settings.strings = {\n      prefixAgo: \"\",\n      prefixFromNow: \"今から\",\n      suffixAgo: \"前\",\n      suffixFromNow: \"後\",\n      seconds: \"ほんの数秒\",\n      minute: \"約一分\",\n      minutes: \"%d分\",\n      hour: \"大体一時間\",\n      hours: \"大体%d時間位\",\n      day: \"一日\",\n      days: \"%d日ほど\",\n      month: \"大体一ヶ月\",\n      months: \"%dヶ月ほど\",\n      year: \"丁度一年\",\n      years: \"%d年\",\n      numbers: function (num) {\n        if (num > 99999) {\n          return num;\n        }\n\t\t\t\t\n        num = num.toString();\n        var numbers = [\"〇\", \"一\", \"二\", \"三\", \"四\", \"五\", \"六\", \"七\", \"八\", \"九\"],\n          units = [\"\", \"十\", \"百\", \"千\", \"万\"],\n          str = \"\";\n\n          for (var i = 0; i < num.length; i++) {\n            var scale = num.length - i - 1;\n            var digit = num[i];\n            if (digit > 0) {\n              if (digit > 1 || (scale != 1 && scale != 2)) {\n                str += numbers[digit];\n              }\n              str += units[scale];\n            }\n          }\n\t\t\t\t\n        return str || numbers[0];\n      },\n      formatter: function (prefix, words, suffix) { return [prefix, words, suffix].join(\"\"); }\n    }\n\n\nReturns `二十六日ほど前` for \"about 26 days ago\".","assignee":null,"pull_request":{"patch_url":"https://github.com/rmm5t/jquery-timeago/pull/34.patch","html_url":"https://github.com/rmm5t/jquery-timeago/pull/34","diff_url":"https://github.com/rmm5t/jquery-timeago/pull/34.diff"},"id":588383,"labels":[],"number":34,"title":"Improving l10n-ability by adding callbacks for numbers and formatter","html_url":"https://github.com/rmm5t/jquery-timeago/issues/34","closed_at":null,"url":"https://api.github.com/repos/rmm5t/jquery-timeago/issues/34","milestone":null},"action":"created","comment":{"created_at":"2011-12-06T02:06:51Z","updated_at":"2011-12-06T02:06:51Z","user":{"gravatar_id":"239a70da80d3959611470d87ca8f0755","id":1391,"url":"https://api.github.com/users/ashchan","login":"ashchan","avatar_url":"https://secure.gravatar.com/avatar/239a70da80d3959611470d87ca8f0755?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"+1 for this, really useful for Japanese and Chinese.","id":3027126,"url":"https://api.github.com/repos/rmm5t/jquery-timeago/issues/comments/3027126"}}