mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-12 12:22:13 +00:00
Update makefile and djangojs
This commit is contained in:
parent
c77585f9a1
commit
fdb23d9ca2
2
Makefile
2
Makefile
@ -5,7 +5,7 @@ develop: setup-git
|
|||||||
setup-git:
|
setup-git:
|
||||||
cd .git/hooks && ln -sf ../../hooks/* ./
|
cd .git/hooks && ln -sf ../../hooks/* ./
|
||||||
|
|
||||||
dist: locale uglify statici18n collectstatic compressstatic
|
dist: locale uglify statici18n collectstatic
|
||||||
|
|
||||||
locale:
|
locale:
|
||||||
@echo "--> Compile locales"
|
@echo "--> Compile locales"
|
||||||
|
@ -5,17 +5,58 @@
|
|||||||
var django = globals.django || (globals.django = {});
|
var django = globals.django || (globals.django = {});
|
||||||
|
|
||||||
|
|
||||||
django.pluralidx = function (count) { return (count == 1) ? 0 : 1; };
|
django.pluralidx = function (n) {
|
||||||
|
var v=0;
|
||||||
|
if (typeof(v) == 'boolean') {
|
||||||
|
return v ? 1 : 0;
|
||||||
|
} else {
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* gettext identity library */
|
/* gettext library */
|
||||||
|
|
||||||
|
django.catalog = {
|
||||||
|
"Really want to delete {lib_name}?": "\u786e\u5b9a\u8981\u5220\u9664 {lib_name} ?"
|
||||||
|
};
|
||||||
|
|
||||||
|
django.gettext = function (msgid) {
|
||||||
|
var value = django.catalog[msgid];
|
||||||
|
if (typeof(value) == 'undefined') {
|
||||||
|
return msgid;
|
||||||
|
} else {
|
||||||
|
return (typeof(value) == 'string') ? value : value[0];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
django.ngettext = function (singular, plural, count) {
|
||||||
|
var value = django.catalog[singular];
|
||||||
|
if (typeof(value) == 'undefined') {
|
||||||
|
return (count == 1) ? singular : plural;
|
||||||
|
} else {
|
||||||
|
return value[django.pluralidx(count)];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
django.gettext = function (msgid) { return msgid; };
|
|
||||||
django.ngettext = function (singular, plural, count) { return (count == 1) ? singular : plural; };
|
|
||||||
django.gettext_noop = function (msgid) { return msgid; };
|
django.gettext_noop = function (msgid) { return msgid; };
|
||||||
django.pgettext = function (context, msgid) { return msgid; };
|
|
||||||
django.npgettext = function (context, singular, plural, count) { return (count == 1) ? singular : plural; };
|
django.pgettext = function (context, msgid) {
|
||||||
|
var value = django.gettext(context + '\x04' + msgid);
|
||||||
|
if (value.indexOf('\x04') != -1) {
|
||||||
|
value = msgid;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
|
||||||
|
django.npgettext = function (context, singular, plural, count) {
|
||||||
|
var value = django.ngettext(context + '\x04' + singular, context + '\x04' + plural, count);
|
||||||
|
if (value.indexOf('\x04') != -1) {
|
||||||
|
value = django.ngettext(singular, plural, count);
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
django.interpolate = function (fmt, obj, named) {
|
django.interpolate = function (fmt, obj, named) {
|
||||||
|
Loading…
Reference in New Issue
Block a user