Added jquery i18n plugin to Open Refine

This commit is contained in:
Blakko 2013-06-27 12:01:47 +02:00
parent 8cb1dc05f8
commit 817c6cc8d4
2 changed files with 6 additions and 1 deletions

View File

@ -309,6 +309,7 @@ function init() {
"externals/jquery.eventstack-0.3.js",
"externals/jquery-ui/jquery-ui-1.8.20.custom.min.js",
"externals/date.js",
"externals/jquery.i18n.js",
"externals/CFInstall.min.js",
"scripts/chrome-frame.js",
@ -384,6 +385,7 @@ function init() {
"externals/jquery-ui/jquery-ui-1.8.20.custom.min.js",
"externals/imgareaselect/jquery.imgareaselect.js",
"externals/date.js",
"externals/jquery.i18n.js",
"externals/CFInstall.min.js",
"scripts/chrome-frame.js",
@ -489,7 +491,8 @@ function init() {
"externals/jquery-ui/jquery-ui-1.8.20.custom.min.js",
"externals/imgareaselect/jquery.imgareaselect.js",
"externals/date.js",
"scripts/preferences.js"
"scripts/preferences.js",
"externals/jquery.i18n.js",
]
);
ClientSideResourceManager.addPaths(

View File

@ -0,0 +1,2 @@
(function(f){f.i18n={dict:null,plural:null,setDictionary:function(a){null===this.dict?this.dict=a:f.extend(this.dict,a)},setPlural:function(a){this.plural=a},_p:function(a,d,e){var c=this.dict[a],b=[];b.push(e);if(void 0===c||null===this.plural)return this.printf(1<e?d:a,b);a=this.plural.replace(/n%/g,e+"%");eval(a);return this.printf(c[plural],b)},_:function(a,d){var e=a;this.dict&&this.dict[a]&&(e=this.dict[a]);return this.printf(e,d)},printf:function(a,d){if(!d)return a;for(var e="",c=/%(\d+)\$s/g,
b=c.exec(a);b;){var f=parseInt(b[1],10)-1;a=a.replace("%"+b[1]+"$s",d[f]);b=c.exec(a)}c=a.split("%s");if(1<c.length)for(b=0;b<d.length;b++)0<c[b].length&&c[b].lastIndexOf("%")==c[b].length-1&&(c[b]+="s"+c.splice(b+1,1)[0]),e+=c[b]+d[b];return e+c[c.length-1]}};f.fn._t=function(a,d){return f(this).text(f.i18n._(a,d))}})(jQuery);