[#369] update angularjs locale
This commit is contained in:
parent
fdd0beae0e
commit
126cc30b02
|
@ -30,5 +30,5 @@
|
|||
= javascript_include_tag 'new_application'
|
||||
- if I18n.locale == :ru
|
||||
= javascript_include_tag 'moment/ru.js'
|
||||
= javascript_include_tag 'angular-1.2.15-locale_ru-ru'
|
||||
= javascript_include_tag 'angular-locale_ru-ru'
|
||||
= yield :additional_scripts if content_for?(:additional_scripts)
|
||||
|
|
|
@ -65,7 +65,7 @@ Rosa::Application.configure do
|
|||
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
||||
config.assets.precompile +=
|
||||
%w(login.css login.js reg_session.css tour.css tour.js gollum/editor/langs/*.js moment/ru.js
|
||||
codemirror_editor.js codemirror_editor.css new_application.css new_application.js angular-1.2.15-locale_ru-ru.js)
|
||||
codemirror_editor.js codemirror_editor.css new_application.css new_application.js angular-locale_ru-ru.js)
|
||||
|
||||
# Compress JavaScripts and CSS.
|
||||
config.assets.js_compressor = :uglifier
|
||||
|
|
|
@ -1,11 +1,35 @@
|
|||
/**
|
||||
* @license AngularJS v1.2.26
|
||||
* (c) 2010-2014 Google, Inc. http://angularjs.org
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
angular.module("ngLocale", [], ["$provide", function($provide) {
|
||||
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
|
||||
function getDecimals(n) {
|
||||
n = n + '';
|
||||
var i = n.indexOf('.');
|
||||
return (i == -1) ? 0 : n.length - i - 1;
|
||||
}
|
||||
|
||||
function getVF(n, opt_precision) {
|
||||
var v = opt_precision;
|
||||
|
||||
if (undefined === v) {
|
||||
v = Math.min(getDecimals(n), 3);
|
||||
}
|
||||
|
||||
var base = Math.pow(10, v);
|
||||
var f = ((n * base) | 0) % base;
|
||||
return {v: v, f: f};
|
||||
}
|
||||
|
||||
$provide.value("$locale", {
|
||||
"DATETIME_FORMATS": {
|
||||
"AMPMS": [
|
||||
"\u0434\u043e \u043f\u043e\u043b\u0443\u0434\u043d\u044f",
|
||||
"\u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0434\u043d\u044f"
|
||||
"AM",
|
||||
"PM"
|
||||
],
|
||||
"DAY": [
|
||||
"\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435",
|
||||
|
@ -53,10 +77,10 @@ $provide.value("$locale", {
|
|||
"\u043d\u043e\u044f\u0431.",
|
||||
"\u0434\u0435\u043a."
|
||||
],
|
||||
"fullDate": "EEEE, d MMMM y\u00a0'\u0433'.",
|
||||
"longDate": "d MMMM y\u00a0'\u0433'.",
|
||||
"medium": "dd.MM.yyyy H:mm:ss",
|
||||
"mediumDate": "dd.MM.yyyy",
|
||||
"fullDate": "EEEE, d MMMM y '\u0433'.",
|
||||
"longDate": "d MMMM y '\u0433'.",
|
||||
"medium": "d MMM y '\u0433'. H:mm:ss",
|
||||
"mediumDate": "d MMM y '\u0433'.",
|
||||
"mediumTime": "H:mm:ss",
|
||||
"short": "dd.MM.yy H:mm",
|
||||
"shortDate": "dd.MM.yy",
|
||||
|
@ -70,7 +94,6 @@ $provide.value("$locale", {
|
|||
{
|
||||
"gSize": 3,
|
||||
"lgSize": 3,
|
||||
"macFrac": 0,
|
||||
"maxFrac": 3,
|
||||
"minFrac": 0,
|
||||
"minInt": 1,
|
||||
|
@ -82,7 +105,6 @@ $provide.value("$locale", {
|
|||
{
|
||||
"gSize": 3,
|
||||
"lgSize": 3,
|
||||
"macFrac": 0,
|
||||
"maxFrac": 2,
|
||||
"minFrac": 2,
|
||||
"minInt": 1,
|
||||
|
@ -94,6 +116,6 @@ $provide.value("$locale", {
|
|||
]
|
||||
},
|
||||
"id": "ru-ru",
|
||||
"pluralCat": function (n) { if (n % 10 == 1 && n % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (n == (n | 0) && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) { return PLURAL_CATEGORY.FEW; } if (n % 10 == 0 || n == (n | 0) && n % 10 >= 5 && n % 10 <= 9 || n == (n | 0) && n % 100 >= 11 && n % 100 <= 14) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
|
||||
"pluralCat": function (n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (vf.v == 0 && i % 10 == 1 && i % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14)) { return PLURAL_CATEGORY.FEW; } if (vf.v == 0 && i % 10 == 0 || vf.v == 0 && i % 10 >= 5 && i % 10 <= 9 || vf.v == 0 && i % 100 >= 11 && i % 100 <= 14) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
|
||||
});
|
||||
}]);
|
Loading…
Reference in New Issue