diff options
author | Dusty Phillips <buchuki@gmail.com> | 2009-08-18 10:31:18 -0600 |
---|---|---|
committer | Dusty Phillips <buchuki@gmail.com> | 2009-08-18 10:31:18 -0600 |
commit | a885c3d9b695a3743cd5c76ddc4708c2987b1020 (patch) | |
tree | 2a8062419cb336558326d22bfd7e91552c3897c9 | |
parent | 0d475997680e16014777b05c243b82fdd64e3c2b (diff) |
Apparently you couldn't view the packages page if the user wasn't logged into the admin.
-rw-r--r-- | media/django-jsi18n.js | 35 | ||||
-rw-r--r-- | templates/packages/search.html | 2 |
2 files changed, 36 insertions, 1 deletions
diff --git a/media/django-jsi18n.js b/media/django-jsi18n.js new file mode 100644 index 00000000..83562c1a --- /dev/null +++ b/media/django-jsi18n.js @@ -0,0 +1,35 @@ + +/* gettext library */ + +var catalog = new Array(); + +function pluralidx(count) { return (count == 1) ? 0 : 1; } + + +function gettext(msgid) { + var value = catalog[msgid]; + if (typeof(value) == 'undefined') { + return msgid; + } else { + return (typeof(value) == 'string') ? value : value[0]; + } +} + +function ngettext(singular, plural, count) { + value = catalog[singular]; + if (typeof(value) == 'undefined') { + return (count == 1) ? singular : plural; + } else { + return value[pluralidx(count)]; + } +} + +function gettext_noop(msgid) { return msgid; } + +function interpolate(fmt, obj, named) { + if (named) { + return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])}); + } else { + return fmt.replace(/%s/g, function(match){return String(obj.shift())}); + } +} diff --git a/templates/packages/search.html b/templates/packages/search.html index 62e4c676..37ee3bc6 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -2,7 +2,7 @@ {% load package_extras %} {% block title %}Arch Linux - Package Search{% endblock %} {% block head %} -<script type="text/javascript" src="/admin/jsi18n/"></script> +<script type="text/javascript" src="/media/django-jsi18n.js"></script> <script type="text/javascript" src="/media/admin_media/js/core.js"></script> {{search_form.media}} {% endblock %} |