mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #9988 -- Added support for translation contexts. Thanks, Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14450 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -68,6 +68,8 @@ NullSource = """
|
||||
function gettext(msgid) { return msgid; }
|
||||
function ngettext(singular, plural, count) { return (count == 1) ? singular : plural; }
|
||||
function gettext_noop(msgid) { return msgid; }
|
||||
function pgettext(context, msgid) { return msgid; }
|
||||
function npgettext(context, singular, plural, count) { return (count == 1) ? singular : plural; }
|
||||
"""
|
||||
|
||||
LibHead = """
|
||||
@@ -98,6 +100,21 @@ function ngettext(singular, plural, count) {
|
||||
|
||||
function gettext_noop(msgid) { return msgid; }
|
||||
|
||||
function pgettext(context, msgid) {
|
||||
var value = gettext(context + '\x04' + msgid);
|
||||
if (value.indexOf('\x04') != -1) {
|
||||
value = msgid;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function npgettext(context, singular, plural, count) {
|
||||
var value = ngettext(context + '\x04' + singular, context + '\x04' + plural, count);
|
||||
if (value.indexOf('\x04') != -1) {
|
||||
value = ngettext(singular, plural, count);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
"""
|
||||
|
||||
LibFormatHead = """
|
||||
|
||||
Reference in New Issue
Block a user