1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-01 23:38:37 +00:00

Update makefile and djangojs

This commit is contained in:
zhengxie 2015-04-22 12:08:19 +08:00 committed by Daniel Pan
parent c77585f9a1
commit fdb23d9ca2
2 changed files with 48 additions and 7 deletions

View File

@ -5,7 +5,7 @@ develop: setup-git
setup-git:
cd .git/hooks && ln -sf ../../hooks/* ./
dist: locale uglify statici18n collectstatic compressstatic
dist: locale uglify statici18n collectstatic
locale:
@echo "--> Compile locales"

View File

@ -5,17 +5,58 @@
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.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) {