From: gfawcett Date: Tue, 29 Mar 2011 03:10:29 +0000 (+0000) Subject: Marked a bunch more texts for translation. (Needs testing.) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2c7839f2d70c93633eab0ff26aa8d100178053cb;p=Syrup.git Marked a bunch more texts for translation. (Needs testing.) Props to Emacs' po-mode, it made finding the texts really easy! http://www.gnu.org/software/hello/manual/gettext/Marking.html#Marking git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/branches/i18n@1293 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/conifer/integration/linktool/app.py b/conifer/integration/linktool/app.py index ee95124..e920748 100644 --- a/conifer/integration/linktool/app.py +++ b/conifer/integration/linktool/app.py @@ -17,7 +17,7 @@ g = TemplateSet([HERE('integration/linktool/templates'), def linktool_welcome(request): user = authenticate(request=request) if user is None: - return HttpResponseForbidden('You are not allowed here.') + return HttpResponseForbidden(_('You are not allowed here.')) else: login(request, user) _role = request.GET['role'] @@ -78,7 +78,7 @@ def linktool_new_site(request): extrole = request.session['clew-role'] assert extrole == 'INSTR' assert request.user.can_create_sites(), \ - 'Sorry, but you are not allowed to create sites.' + _('Sorry, but you are not allowed to create sites.') extsite = ExternalSiteInfo(request) extgroups = callhook('external_memberships', request.user.username) desk = models.ServiceDesk.default() @@ -100,17 +100,17 @@ def linktool_new_site(request): def linktool_associate(request): site = models.Site.objects.get(pk=request.GET['site']) assert site in request.user.sites(role='INSTR'), \ - 'Not an instructor on this site! Cannot copy.' + _('You are not an instructor on this site; you cannot copy it.') assert request.user.can_create_sites(), \ - 'Sorry, but you are not allowed to create sites.' + _('Sorry, but you are not allowed to create sites.') today = date.today() assert site.term.midpoint() >= today, \ - 'Sorry, but you cannot associate to such an old site.' + _('Sorry, but you cannot make an association to such an old site.') extsite = request.session['clew-site'] extrole = request.session['clew-role'] assert extrole == 'INSTR', \ - 'Sorry, you are not an instructor on this Sakai site.' + _('Sorry, you are not an instructor on this Sakai site.') group = models.Group.objects.create( site = site, external_id = extsite) @@ -123,14 +123,14 @@ def linktool_associate(request): def linktool_copy_old(request): oldsite = models.Site.objects.get(pk=request.GET['site']) assert oldsite in request.user.sites(role='INSTR'), \ - 'Not an instructor on this site! Cannot copy.' + _('You are not an instructor on this site; you cannot copy it.') assert request.user.can_create_sites(), \ - 'Sorry, but you are not allowed to create sites.' + _('Sorry, but you are not allowed to create sites.') extsite = request.session['clew-site'] extrole = request.session['clew-role'] assert extrole == 'INSTR', \ - 'Sorry, you are not an instructor on this Sakai site.' + _('Sorry, you are not an instructor on this Sakai site.') extgroups = callhook('external_memberships', request.user.username) extsite = [d for d in extgroups if d['group'] == extsite][0] diff --git a/conifer/integration/uwindsor.py b/conifer/integration/uwindsor.py index 3b7727a..aa97c99 100644 --- a/conifer/integration/uwindsor.py +++ b/conifer/integration/uwindsor.py @@ -211,10 +211,11 @@ def _item_status(bib_id): dueinfo = time.strftime(settings.DUE_FORMAT,earliestdue) callno = callnum - alldisplay = callnum + ' (Available)' + alldisplay = callnum + _(' (Available)') if circs and isinstance(circs, list): - alldisplay = '%s (DUE: %s)' % (callnum, time.strftime(settings.DUE_FORMAT,duetime)) + _duetime = time.strftime(settings.DUE_FORMAT,duetime) + alldisplay = _('%(callnum)s (DUE: %(_duetime)s)') % locals() alldues.append(alldisplay) diff --git a/conifer/libsystems/evergreen/item_status.py b/conifer/libsystems/evergreen/item_status.py index cd5b656..15be849 100644 --- a/conifer/libsystems/evergreen/item_status.py +++ b/conifer/libsystems/evergreen/item_status.py @@ -16,7 +16,7 @@ def bib_id_to_marcxml(bib_id): def url_to_marcxml(url): # this is a hack. Given a opac Title Details url, return marcxml. - assert support.BASE, 'no EG BASE. Did you call support.initialize()?' + assert support.BASE, _('no EG BASE. Did you call support.initialize()?') if url.startswith(support.BASE): if 'feed/bookbag' in url: #eg http://concat.ca/opac/extras/feed/bookbag/marcxml-full/60 diff --git a/conifer/libsystems/evergreen/startup.py b/conifer/libsystems/evergreen/startup.py index ec7dd4b..1077e28 100644 --- a/conifer/libsystems/evergreen/startup.py +++ b/conifer/libsystems/evergreen/startup.py @@ -36,10 +36,10 @@ def load_idl(osrf_http, gateway_server, idl_url): #no pass on these, updates are too critical to ever be out of sync except urllib2.URLError, exc: - print("Could not open URL to read IDL: %s", exc.code) + print(_("Could not open URL to read IDL: %s"), exc.code) except IOError, exc: - print("Could not write IDL to file: %s", exc.code) + print(_("Could not write IDL to file: %s"), exc.code) # parse the IDL parser.set_IDL(idlfile) diff --git a/conifer/locale/django.pot b/conifer/locale/django.pot index c9df9c3..b92690b 100644 --- a/conifer/locale/django.pot +++ b/conifer/locale/django.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Syrup Reserves 0.1\n" "Report-Msgid-Bugs-To: Graham Fawcett \n" -"POT-Creation-Date: 2011-03-28 21:49-0400\n" +"POT-Creation-Date: 2011-03-28 23:08-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -15,6 +15,36 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: 0.9.4\n" +#: integration/uwindsor.py:214 +msgid " (Available)" +msgstr "" + +#: integration/uwindsor.py:218 +#, python-format +msgid "%(callnum)s (DUE: %(_duetime)s)" +msgstr "" + +#: integration/linktool/app.py:20 +msgid "You are not allowed here." +msgstr "" + +#: integration/linktool/app.py:81 integration/linktool/app.py:105 +#: integration/linktool/app.py:128 +msgid "Sorry, but you are not allowed to create sites." +msgstr "" + +#: integration/linktool/app.py:103 integration/linktool/app.py:126 +msgid "You are not an instructor on this site; you cannot copy it." +msgstr "" + +#: integration/linktool/app.py:108 +msgid "Sorry, but you cannot make an association to such an old site." +msgstr "" + +#: integration/linktool/app.py:113 integration/linktool/app.py:133 +msgid "Sorry, you are not an instructor on this Sakai site." +msgstr "" + #: integration/linktool/templates/associate.xhtml:14 msgid "No associated reserves items." msgstr "" @@ -88,6 +118,20 @@ msgid "" "Please choose from the list below:" msgstr "" +#: libsystems/evergreen/item_status.py:19 +msgid "no EG BASE. Did you call support.initialize()?" +msgstr "" + +#: libsystems/evergreen/startup.py:39 +#, python-format +msgid "Could not open URL to read IDL: %s" +msgstr "" + +#: libsystems/evergreen/startup.py:42 +#, python-format +msgid "Could not write IDL to file: %s" +msgstr "" + #: syrup/models.py:133 msgid "ILS patron ID" msgstr "" @@ -178,9 +222,26 @@ msgid "Accessible to course-site members" msgstr "" #: syrup/models.py:251 +msgid "CLOSE" +msgstr "" + +#: syrup/models.py:251 msgid "Accessible only to course-site owners" msgstr "" +#: syrup/models.py:282 +msgid "The end-term cannot begin before the start-term." +msgstr "" + +#: syrup/models.py:430 +#, python-format +msgid "Cannot determine access level for user %s in site %s" +msgstr "" + +#: syrup/models.py:507 +msgid "(internal)" +msgstr "" + #: syrup/models.py:518 msgid "Instructor" msgstr "" @@ -219,6 +280,26 @@ msgstr "" msgid "MARCXML" msgstr "" +#: syrup/models.py:633 +msgid "unknown" +msgstr "" + +#: syrup/models.py:634 +msgid "fair dealing" +msgstr "" + +#: syrup/models.py:635 +msgid "permission granted" +msgstr "" + +#: syrup/models.py:636 +msgid "licensed content" +msgstr "" + +#: syrup/models.py:637 +msgid "available to students" +msgstr "" + #: syrup/models.py:646 msgid "Normal" msgstr "" @@ -323,6 +404,10 @@ msgstr "" msgid "The page you requested could not be found" msgstr "" +#: syrup/views/_generics.py:53 +msgid "Cannot be blank." +msgstr "" + #: syrup/views/admin.py:17 templates/courses.xhtml:1 #: templates/admin/index.xhtml:24 msgid "Courses" @@ -337,7 +422,7 @@ msgid "Terms" msgstr "" #: syrup/views/admin.py:60 -msgid "start must precede finish" +msgid "The term's start must precede its finish." msgstr "" #: syrup/views/admin.py:87 @@ -348,6 +433,29 @@ msgstr "" msgid "Configs" msgstr "" +#. I18N: a 'hook' in this context is a locally-defined function. +#: syrup/views/admin.py:124 syrup/views/admin.py:141 +#, python-format +msgid "Sorry, cannot perform this operation at this time: hook %r not found." +msgstr "" + +#: syrup/views/admin.py:134 +msgid "Courses and departments updated." +msgstr "" + +#: syrup/views/admin.py:152 +msgid "Terms updated." +msgstr "" + +#: syrup/views/admin.py:173 +msgid "No user was selected." +msgstr "" + +#: syrup/views/admin.py:176 +#, python-format +msgid "Staff user added: %s [%s]." +msgstr "" + #: syrup/views/auth.py:24 msgid "Invalid username or password. Please try again." msgstr "" @@ -366,6 +474,10 @@ msgstr "" msgid "Courses with Materials in %s" msgstr "" +#: syrup/views/items.py:47 +msgid "Items of this type are not downloadable." +msgstr "" + #: syrup/views/items.py:76 syrup/views/items.py:238 syrup/views/items.py:266 msgid "You can only add items to headings!" msgstr "" @@ -382,6 +494,14 @@ msgstr "" msgid "Sorry, only HEADINGs, URLs and ELECs can be added right now." msgstr "" +#: syrup/views/items.py:165 +msgid "The title and/or URL are missing." +msgstr "" + +#: syrup/views/items.py:316 syrup/views/items.py:329 +msgid "Untitled" +msgstr "" + #: syrup/views/items.py:395 msgid "Unable to update" msgstr "" @@ -406,6 +526,10 @@ msgstr "" msgid "You cannot make an item a descendant of itself!" msgstr "" +#: syrup/views/sites.py:16 +msgid "The end-term precedes the start-term." +msgstr "" + #: syrup/views/sites.py:34 msgid "You are not allowed to create sites." msgstr "" @@ -430,6 +554,34 @@ msgstr "" msgid "Instructors only: this site is closed." msgstr "" +#: syrup/views/sites.py:104 +msgid "Changes saved." +msgstr "" + +#: syrup/views/sites.py:110 +#, python-format +msgid "Security level changed to \"%s\"." +msgstr "" + +#: syrup/views/sites.py:126 +#, python-format +msgid "%s has been added as a member (role: %s)." +msgstr "" + +#: syrup/views/sites.py:131 +#, python-format +msgid "%s: role changed to %s." +msgstr "" + +#: syrup/views/sites.py:145 +msgid "No group code or section number provided." +msgstr "" + +#: syrup/views/sites.py:150 +#, python-format +msgid "Group %s added." +msgstr "" + #: syrup/views/sites.py:202 msgid "You cannot join this site." msgstr "" @@ -633,7 +785,7 @@ msgid "Term" msgstr "" #: templates/open_sites.xhtml:19 templates/search_results.xhtml:35 -#: templates/item/item_add_cat_search.xhtml:65 +#: templates/item/item_add_cat_search.xhtml:66 #: templates/item/item_delete_confirm.xhtml:28 #: templates/item/item_metadata.xhtml:46 msgid "Title" @@ -672,7 +824,7 @@ msgstr[0] "" msgstr[1] "" #: templates/search_results.xhtml:35 -#: templates/item/item_add_cat_search.xhtml:65 +#: templates/item/item_add_cat_search.xhtml:66 msgid "Author" msgstr "" @@ -1039,7 +1191,7 @@ msgid "Author #%(num)s" msgstr "" #: templates/item/common_metadata.xhtml:21 -#: templates/item/item_add_cat_search.xhtml:65 +#: templates/item/item_add_cat_search.xhtml:66 #: templates/item/item_metadata.xhtml:50 msgid "Publisher" msgstr "" @@ -1120,33 +1272,33 @@ msgid_plural "%(first)s–%(last)s of %(total)s results." msgstr[0] "" msgstr[1] "" -#: templates/item/item_add_cat_search.xhtml:54 +#: templates/item/item_add_cat_search.xhtml:55 #, python-format msgid "Previous %(count)s" msgstr "" -#: templates/item/item_add_cat_search.xhtml:58 +#: templates/item/item_add_cat_search.xhtml:59 #, python-format msgid "Next %(count)s" msgstr "" -#: templates/item/item_add_cat_search.xhtml:65 +#: templates/item/item_add_cat_search.xhtml:66 msgid "PubDate" msgstr "" -#: templates/item/item_add_cat_search.xhtml:73 +#: templates/item/item_add_cat_search.xhtml:74 msgid "details" msgstr "" -#: templates/item/item_add_cat_search.xhtml:74 +#: templates/item/item_add_cat_search.xhtml:75 msgid "Electronic resource." msgstr "" -#: templates/item/item_add_cat_search.xhtml:75 +#: templates/item/item_add_cat_search.xhtml:76 msgid "view" msgstr "" -#: templates/item/item_add_cat_search.xhtml:85 +#: templates/item/item_add_cat_search.xhtml:86 msgid "Pick this item" msgstr "" diff --git a/conifer/locale/en_CA/LC_MESSAGES/django.po b/conifer/locale/en_CA/LC_MESSAGES/django.po index 3cb8668..c646f2e 100644 --- a/conifer/locale/en_CA/LC_MESSAGES/django.po +++ b/conifer/locale/en_CA/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Syrup Reserves 0.1\n" "Report-Msgid-Bugs-To: Graham Fawcett \n" "POT-Creation-Date: 2011-03-28 20:22+0400\n" -"PO-Revision-Date: 2011-03-28 21:49-0400\n" +"PO-Revision-Date: 2011-03-28 23:08-0400\n" "Last-Translator: FULL NAME \n" "Language-Team: en_CA \n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" @@ -17,6 +17,36 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 0.9.4\n" +#: integration/uwindsor.py:214 +msgid " (Available)" +msgstr "" + +#: integration/uwindsor.py:218 +#, python-format +msgid "%(callnum)s (DUE: %(_duetime)s)" +msgstr "" + +#: integration/linktool/app.py:20 +msgid "You are not allowed here." +msgstr "" + +#: integration/linktool/app.py:81 integration/linktool/app.py:105 +#: integration/linktool/app.py:128 +msgid "Sorry, but you are not allowed to create sites." +msgstr "" + +#: integration/linktool/app.py:103 integration/linktool/app.py:126 +msgid "You are not an instructor on this site; you cannot copy it." +msgstr "" + +#: integration/linktool/app.py:108 +msgid "Sorry, but you cannot make an association to such an old site." +msgstr "" + +#: integration/linktool/app.py:113 integration/linktool/app.py:133 +msgid "Sorry, you are not an instructor on this Sakai site." +msgstr "" + #: integration/linktool/templates/associate.xhtml:14 msgid "No associated reserves items." msgstr "" @@ -90,6 +120,20 @@ msgid "" "Please choose from the list below:" msgstr "" +#: libsystems/evergreen/item_status.py:19 +msgid "no EG BASE. Did you call support.initialize()?" +msgstr "" + +#: libsystems/evergreen/startup.py:39 +#, python-format +msgid "Could not open URL to read IDL: %s" +msgstr "" + +#: libsystems/evergreen/startup.py:42 +#, python-format +msgid "Could not write IDL to file: %s" +msgstr "" + #: syrup/models.py:133 msgid "ILS patron ID" msgstr "" @@ -180,9 +224,26 @@ msgid "Accessible to course-site members" msgstr "" #: syrup/models.py:251 +msgid "CLOSE" +msgstr "" + +#: syrup/models.py:251 msgid "Accessible only to course-site owners" msgstr "" +#: syrup/models.py:282 +msgid "The end-term cannot begin before the start-term." +msgstr "" + +#: syrup/models.py:430 +#, python-format +msgid "Cannot determine access level for user %s in site %s" +msgstr "" + +#: syrup/models.py:507 +msgid "(internal)" +msgstr "" + #: syrup/models.py:518 msgid "Instructor" msgstr "" @@ -221,6 +282,26 @@ msgstr "" msgid "MARCXML" msgstr "" +#: syrup/models.py:633 +msgid "unknown" +msgstr "" + +#: syrup/models.py:634 +msgid "fair dealing" +msgstr "" + +#: syrup/models.py:635 +msgid "permission granted" +msgstr "" + +#: syrup/models.py:636 +msgid "licensed content" +msgstr "" + +#: syrup/models.py:637 +msgid "available to students" +msgstr "" + #: syrup/models.py:646 msgid "Normal" msgstr "" @@ -325,6 +406,10 @@ msgstr "" msgid "The page you requested could not be found" msgstr "" +#: syrup/views/_generics.py:53 +msgid "Cannot be blank." +msgstr "" + #: syrup/views/admin.py:17 templates/courses.xhtml:1 #: templates/admin/index.xhtml:24 msgid "Courses" @@ -339,7 +424,7 @@ msgid "Terms" msgstr "" #: syrup/views/admin.py:60 -msgid "start must precede finish" +msgid "The term's start must precede its finish." msgstr "" #: syrup/views/admin.py:87 @@ -350,6 +435,29 @@ msgstr "" msgid "Configs" msgstr "" +#. I18N: a 'hook' in this context is a locally-defined function. +#: syrup/views/admin.py:124 syrup/views/admin.py:141 +#, python-format +msgid "Sorry, cannot perform this operation at this time: hook %r not found." +msgstr "" + +#: syrup/views/admin.py:134 +msgid "Courses and departments updated." +msgstr "" + +#: syrup/views/admin.py:152 +msgid "Terms updated." +msgstr "" + +#: syrup/views/admin.py:173 +msgid "No user was selected." +msgstr "" + +#: syrup/views/admin.py:176 +#, python-format +msgid "Staff user added: %s [%s]." +msgstr "" + #: syrup/views/auth.py:24 msgid "Invalid username or password. Please try again." msgstr "" @@ -368,6 +476,10 @@ msgstr "" msgid "Courses with Materials in %s" msgstr "" +#: syrup/views/items.py:47 +msgid "Items of this type are not downloadable." +msgstr "" + #: syrup/views/items.py:76 syrup/views/items.py:238 syrup/views/items.py:266 msgid "You can only add items to headings!" msgstr "" @@ -384,6 +496,14 @@ msgstr "" msgid "Sorry, only HEADINGs, URLs and ELECs can be added right now." msgstr "" +#: syrup/views/items.py:165 +msgid "The title and/or URL are missing." +msgstr "" + +#: syrup/views/items.py:316 syrup/views/items.py:329 +msgid "Untitled" +msgstr "" + #: syrup/views/items.py:395 msgid "Unable to update" msgstr "" @@ -408,6 +528,10 @@ msgstr "" msgid "You cannot make an item a descendant of itself!" msgstr "" +#: syrup/views/sites.py:16 +msgid "The end-term precedes the start-term." +msgstr "" + #: syrup/views/sites.py:34 msgid "You are not allowed to create sites." msgstr "" @@ -432,6 +556,34 @@ msgstr "" msgid "Instructors only: this site is closed." msgstr "" +#: syrup/views/sites.py:104 +msgid "Changes saved." +msgstr "" + +#: syrup/views/sites.py:110 +#, python-format +msgid "Security level changed to \"%s\"." +msgstr "" + +#: syrup/views/sites.py:126 +#, python-format +msgid "%s has been added as a member (role: %s)." +msgstr "" + +#: syrup/views/sites.py:131 +#, python-format +msgid "%s: role changed to %s." +msgstr "" + +#: syrup/views/sites.py:145 +msgid "No group code or section number provided." +msgstr "" + +#: syrup/views/sites.py:150 +#, python-format +msgid "Group %s added." +msgstr "" + #: syrup/views/sites.py:202 msgid "You cannot join this site." msgstr "" @@ -635,7 +787,7 @@ msgid "Term" msgstr "" #: templates/open_sites.xhtml:19 templates/search_results.xhtml:35 -#: templates/item/item_add_cat_search.xhtml:65 +#: templates/item/item_add_cat_search.xhtml:66 #: templates/item/item_delete_confirm.xhtml:28 #: templates/item/item_metadata.xhtml:46 msgid "Title" @@ -674,7 +826,7 @@ msgstr[0] "" msgstr[1] "" #: templates/search_results.xhtml:35 -#: templates/item/item_add_cat_search.xhtml:65 +#: templates/item/item_add_cat_search.xhtml:66 msgid "Author" msgstr "" @@ -1041,7 +1193,7 @@ msgid "Author #%(num)s" msgstr "" #: templates/item/common_metadata.xhtml:21 -#: templates/item/item_add_cat_search.xhtml:65 +#: templates/item/item_add_cat_search.xhtml:66 #: templates/item/item_metadata.xhtml:50 msgid "Publisher" msgstr "" @@ -1122,33 +1274,33 @@ msgid_plural "%(first)s–%(last)s of %(total)s results." msgstr[0] "" msgstr[1] "" -#: templates/item/item_add_cat_search.xhtml:54 +#: templates/item/item_add_cat_search.xhtml:55 #, python-format msgid "Previous %(count)s" msgstr "" -#: templates/item/item_add_cat_search.xhtml:58 +#: templates/item/item_add_cat_search.xhtml:59 #, python-format msgid "Next %(count)s" msgstr "" -#: templates/item/item_add_cat_search.xhtml:65 +#: templates/item/item_add_cat_search.xhtml:66 msgid "PubDate" msgstr "" -#: templates/item/item_add_cat_search.xhtml:73 +#: templates/item/item_add_cat_search.xhtml:74 msgid "details" msgstr "" -#: templates/item/item_add_cat_search.xhtml:74 +#: templates/item/item_add_cat_search.xhtml:75 msgid "Electronic resource." msgstr "" -#: templates/item/item_add_cat_search.xhtml:75 +#: templates/item/item_add_cat_search.xhtml:76 msgid "view" msgstr "" -#: templates/item/item_add_cat_search.xhtml:85 +#: templates/item/item_add_cat_search.xhtml:86 msgid "Pick this item" msgstr "" diff --git a/conifer/locale/eo/LC_MESSAGES/django.po b/conifer/locale/eo/LC_MESSAGES/django.po index 214df61..6a67c9c 100644 --- a/conifer/locale/eo/LC_MESSAGES/django.po +++ b/conifer/locale/eo/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Syrup Reserves 0.1\n" "Report-Msgid-Bugs-To: Graham Fawcett \n" "POT-Creation-Date: 2011-03-28 20:22+0400\n" -"PO-Revision-Date: 2011-03-28 21:49-0400\n" +"PO-Revision-Date: 2011-03-28 23:08-0400\n" "Last-Translator: FULL NAME \n" "Language-Team: eo \n" "MIME-Version: 1.0\n" @@ -17,6 +17,36 @@ msgstr "" "Generated-By: Babel 0.9.4\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" +#: integration/uwindsor.py:214 +msgid " (Available)" +msgstr " (avAIlAblE)" + +#: integration/uwindsor.py:218 +#, python-format +msgid "%(callnum)s (DUE: %(_duetime)s)" +msgstr "%(callnum)s (Due: %(_duetime)s)" + +#: integration/linktool/app.py:20 +msgid "You are not allowed here." +msgstr "YOU ArE nOt AllOwEd hErE." + +#: integration/linktool/app.py:81 integration/linktool/app.py:105 +#: integration/linktool/app.py:128 +msgid "Sorry, but you are not allowed to create sites." +msgstr "SOrry, bUt yOU ArE nOt AllOwEd tO crEAtE sItEs." + +#: integration/linktool/app.py:103 integration/linktool/app.py:126 +msgid "You are not an instructor on this site; you cannot copy it." +msgstr "YOU ArE nOt An InstrUctOr On thIs sItE; yOU cAnnOt cOpy It." + +#: integration/linktool/app.py:108 +msgid "Sorry, but you cannot make an association to such an old site." +msgstr "SOrry, bUt yOU cAnnOt mAkE An AssOcIAtIOn tO sUch An Old sItE." + +#: integration/linktool/app.py:113 integration/linktool/app.py:133 +msgid "Sorry, you are not an instructor on this Sakai site." +msgstr "SOrry, yOU ArE nOt An InstrUctOr On thIs SAkAI sItE." + #: integration/linktool/templates/associate.xhtml:14 msgid "No associated reserves items." msgstr "NO AssOcIAtEd rEsErvEs ItEms." @@ -99,6 +129,20 @@ msgstr "" "ThErE Is mOrE thAn OnE sEt Of rEsErvEs mAtErIAls rElAtEd tO thIs sItE. " "PlEAsE chOOsE frOm thE lIst bElOw:" +#: libsystems/evergreen/item_status.py:19 +msgid "no EG BASE. Did you call support.initialize()?" +msgstr "nO eG BaSe. DId yOU cAll sUppOrt.InItIAlIzE()?" + +#: libsystems/evergreen/startup.py:39 +#, python-format +msgid "Could not open URL to read IDL: %s" +msgstr "COUld nOt OpEn uRL tO rEAd iDL: %s" + +#: libsystems/evergreen/startup.py:42 +#, python-format +msgid "Could not write IDL to file: %s" +msgstr "COUld nOt wrItE iDL tO fIlE: %s" + #: syrup/models.py:133 msgid "ILS patron ID" msgstr "iLS pAtrOn iD" @@ -191,9 +235,26 @@ msgid "Accessible to course-site members" msgstr "accEssIblE tO cOUrsE-sItE mEmbErs" #: syrup/models.py:251 +msgid "CLOSE" +msgstr "CLoSe" + +#: syrup/models.py:251 msgid "Accessible only to course-site owners" msgstr "accEssIblE Only tO cOUrsE-sItE OwnErs" +#: syrup/models.py:282 +msgid "The end-term cannot begin before the start-term." +msgstr "ThE End-tErm cAnnOt bEgIn bEfOrE thE stArt-tErm." + +#: syrup/models.py:430 +#, python-format +msgid "Cannot determine access level for user %s in site %s" +msgstr "CAnnOt dEtErmInE AccEss lEvEl fOr UsEr %s In sItE %s" + +#: syrup/models.py:507 +msgid "(internal)" +msgstr "(IntErnAl)" + #: syrup/models.py:518 msgid "Instructor" msgstr "instrUctOr" @@ -232,6 +293,26 @@ msgstr "BIb REcOrd iD" msgid "MARCXML" msgstr "MaRCXML" +#: syrup/models.py:633 +msgid "unknown" +msgstr "UnknOwn" + +#: syrup/models.py:634 +msgid "fair dealing" +msgstr "fAIr dEAlIng" + +#: syrup/models.py:635 +msgid "permission granted" +msgstr "pErmIssIOn grAntEd" + +#: syrup/models.py:636 +msgid "licensed content" +msgstr "lIcEnsEd cOntEnt" + +#: syrup/models.py:637 +msgid "available to students" +msgstr "AvAIlAblE tO stUdEnts" + #: syrup/models.py:646 msgid "Normal" msgstr "NOrmAl" @@ -338,6 +419,10 @@ msgstr "NOt fOUnd" msgid "The page you requested could not be found" msgstr "ThE pAgE yOU rEqUEstEd cOUld nOt bE fOUnd" +#: syrup/views/_generics.py:53 +msgid "Cannot be blank." +msgstr "CAnnOt bE blAnk." + #: syrup/views/admin.py:17 templates/courses.xhtml:1 #: templates/admin/index.xhtml:24 msgid "Courses" @@ -352,8 +437,8 @@ msgid "Terms" msgstr "TErms" #: syrup/views/admin.py:60 -msgid "start must precede finish" -msgstr "stArt mUst prEcEdE fInIsh" +msgid "The term's start must precede its finish." +msgstr "ThE tErm's stArt mUst prEcEdE Its fInIsh." #: syrup/views/admin.py:87 msgid "Targets" @@ -363,6 +448,29 @@ msgstr "TArgEts" msgid "Configs" msgstr "COnfIgs" +#. I18N: a 'hook' in this context is a locally-defined function. +#: syrup/views/admin.py:124 syrup/views/admin.py:141 +#, python-format +msgid "Sorry, cannot perform this operation at this time: hook %r not found." +msgstr "SOrry, cAnnOt pErfOrm thIs OpErAtIOn At thIs tImE: hOOk %r nOt fOUnd." + +#: syrup/views/admin.py:134 +msgid "Courses and departments updated." +msgstr "COUrsEs And dEpArtmEnts UpdAtEd." + +#: syrup/views/admin.py:152 +msgid "Terms updated." +msgstr "TErms UpdAtEd." + +#: syrup/views/admin.py:173 +msgid "No user was selected." +msgstr "NO UsEr wAs sElEctEd." + +#: syrup/views/admin.py:176 +#, python-format +msgid "Staff user added: %s [%s]." +msgstr "StAff UsEr AddEd: %s [%s]." + #: syrup/views/auth.py:24 msgid "Invalid username or password. Please try again." msgstr "invAlId UsErnAmE Or pAsswOrd. PlEAsE try AgAIn." @@ -381,6 +489,10 @@ msgstr "COUrsEs tAUght by %s" msgid "Courses with Materials in %s" msgstr "COUrsEs wIth MAtErIAls In %s" +#: syrup/views/items.py:47 +msgid "Items of this type are not downloadable." +msgstr "itEms Of thIs typE ArE nOt dOwnlOAdAblE." + #: syrup/views/items.py:76 syrup/views/items.py:238 syrup/views/items.py:266 msgid "You can only add items to headings!" msgstr "YOU cAn Only Add ItEms tO hEAdIngs!" @@ -397,6 +509,14 @@ msgstr "NO ItEm_typE pArAmEtEr wAs prOvIdEd." msgid "Sorry, only HEADINGs, URLs and ELECs can be added right now." msgstr "SOrry, Only HeaDiNGs, uRLs And eLeCs cAn bE AddEd rIght nOw." +#: syrup/views/items.py:165 +msgid "The title and/or URL are missing." +msgstr "ThE tItlE And/Or uRL ArE mIssIng." + +#: syrup/views/items.py:316 syrup/views/items.py:329 +msgid "Untitled" +msgstr "untItlEd" + #: syrup/views/items.py:395 msgid "Unable to update" msgstr "unAblE tO UpdAtE" @@ -421,6 +541,10 @@ msgstr "impOssIblE ItEm-mOvE!" msgid "You cannot make an item a descendant of itself!" msgstr "YOU cAnnOt mAkE An ItEm A dEscEndAnt Of ItsElf!" +#: syrup/views/sites.py:16 +msgid "The end-term precedes the start-term." +msgstr "ThE End-tErm prEcEdEs thE stArt-tErm." + #: syrup/views/sites.py:34 msgid "You are not allowed to create sites." msgstr "YOU ArE nOt AllOwEd tO crEAtE sItEs." @@ -445,6 +569,34 @@ msgstr "MEmbErs Only." msgid "Instructors only: this site is closed." msgstr "instrUctOrs Only: thIs sItE Is clOsEd." +#: syrup/views/sites.py:104 +msgid "Changes saved." +msgstr "ChAngEs sAvEd." + +#: syrup/views/sites.py:110 +#, python-format +msgid "Security level changed to \"%s\"." +msgstr "SEcUrIty lEvEl chAngEd tO \"%s\"." + +#: syrup/views/sites.py:126 +#, python-format +msgid "%s has been added as a member (role: %s)." +msgstr "%s hAs bEEn AddEd As A mEmbEr (rOlE: %s)." + +#: syrup/views/sites.py:131 +#, python-format +msgid "%s: role changed to %s." +msgstr "%s: rOlE chAngEd tO %s." + +#: syrup/views/sites.py:145 +msgid "No group code or section number provided." +msgstr "NO grOUp cOdE Or sEctIOn nUmbEr prOvIdEd." + +#: syrup/views/sites.py:150 +#, python-format +msgid "Group %s added." +msgstr "GrOUp %s AddEd." + #: syrup/views/sites.py:202 msgid "You cannot join this site." msgstr "YOU cAnnOt jOIn thIs sItE." @@ -649,7 +801,7 @@ msgid "Term" msgstr "TErm" #: templates/open_sites.xhtml:19 templates/search_results.xhtml:35 -#: templates/item/item_add_cat_search.xhtml:65 +#: templates/item/item_add_cat_search.xhtml:66 #: templates/item/item_delete_confirm.xhtml:28 #: templates/item/item_metadata.xhtml:46 msgid "Title" @@ -688,7 +840,7 @@ msgstr[0] "FOUnd %(num)s mAtch." msgstr[1] "FOUnd %(num)s mAtchEs." #: templates/search_results.xhtml:35 -#: templates/item/item_add_cat_search.xhtml:65 +#: templates/item/item_add_cat_search.xhtml:66 msgid "Author" msgstr "aUthOr" @@ -1063,7 +1215,7 @@ msgid "Author #%(num)s" msgstr "aUthOr #%(num)s" #: templates/item/common_metadata.xhtml:21 -#: templates/item/item_add_cat_search.xhtml:65 +#: templates/item/item_add_cat_search.xhtml:66 #: templates/item/item_metadata.xhtml:50 msgid "Publisher" msgstr "PUblIshEr" @@ -1144,33 +1296,33 @@ msgid_plural "%(first)s–%(last)s of %(total)s results." msgstr[0] "%(first)s rEsUlt." msgstr[1] "%(first)s–%(last)s Of %(total)s rEsUlts." -#: templates/item/item_add_cat_search.xhtml:54 +#: templates/item/item_add_cat_search.xhtml:55 #, python-format msgid "Previous %(count)s" msgstr "PrEvIOUs %(count)s" -#: templates/item/item_add_cat_search.xhtml:58 +#: templates/item/item_add_cat_search.xhtml:59 #, python-format msgid "Next %(count)s" msgstr "NExt %(count)s" -#: templates/item/item_add_cat_search.xhtml:65 +#: templates/item/item_add_cat_search.xhtml:66 msgid "PubDate" msgstr "PUbDAtE" -#: templates/item/item_add_cat_search.xhtml:73 +#: templates/item/item_add_cat_search.xhtml:74 msgid "details" msgstr "dEtAIls" -#: templates/item/item_add_cat_search.xhtml:74 +#: templates/item/item_add_cat_search.xhtml:75 msgid "Electronic resource." msgstr "elEctrOnIc rEsOUrcE." -#: templates/item/item_add_cat_search.xhtml:75 +#: templates/item/item_add_cat_search.xhtml:76 msgid "view" msgstr "vIEw" -#: templates/item/item_add_cat_search.xhtml:85 +#: templates/item/item_add_cat_search.xhtml:86 msgid "Pick this item" msgstr "PIck thIs ItEm" diff --git a/conifer/locale/fr_CA/LC_MESSAGES/django.po b/conifer/locale/fr_CA/LC_MESSAGES/django.po index 68e4347..03d78da 100644 --- a/conifer/locale/fr_CA/LC_MESSAGES/django.po +++ b/conifer/locale/fr_CA/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Syrup Reserves 0.1\n" "Report-Msgid-Bugs-To: Graham Fawcett \n" "POT-Creation-Date: 2011-03-28 20:22+0400\n" -"PO-Revision-Date: 2011-03-28 21:49-0400\n" +"PO-Revision-Date: 2011-03-28 23:08-0400\n" "Last-Translator: FULL NAME \n" "Language-Team: fr_CA \n" "Plural-Forms: nplurals=2; plural=(n > 1)\n" @@ -17,6 +17,36 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 0.9.4\n" +#: integration/uwindsor.py:214 +msgid " (Available)" +msgstr "" + +#: integration/uwindsor.py:218 +#, python-format +msgid "%(callnum)s (DUE: %(_duetime)s)" +msgstr "" + +#: integration/linktool/app.py:20 +msgid "You are not allowed here." +msgstr "" + +#: integration/linktool/app.py:81 integration/linktool/app.py:105 +#: integration/linktool/app.py:128 +msgid "Sorry, but you are not allowed to create sites." +msgstr "" + +#: integration/linktool/app.py:103 integration/linktool/app.py:126 +msgid "You are not an instructor on this site; you cannot copy it." +msgstr "" + +#: integration/linktool/app.py:108 +msgid "Sorry, but you cannot make an association to such an old site." +msgstr "" + +#: integration/linktool/app.py:113 integration/linktool/app.py:133 +msgid "Sorry, you are not an instructor on this Sakai site." +msgstr "" + #: integration/linktool/templates/associate.xhtml:14 msgid "No associated reserves items." msgstr "" @@ -90,6 +120,20 @@ msgid "" "Please choose from the list below:" msgstr "" +#: libsystems/evergreen/item_status.py:19 +msgid "no EG BASE. Did you call support.initialize()?" +msgstr "" + +#: libsystems/evergreen/startup.py:39 +#, python-format +msgid "Could not open URL to read IDL: %s" +msgstr "" + +#: libsystems/evergreen/startup.py:42 +#, python-format +msgid "Could not write IDL to file: %s" +msgstr "" + #: syrup/models.py:133 msgid "ILS patron ID" msgstr "" @@ -180,9 +224,26 @@ msgid "Accessible to course-site members" msgstr "" #: syrup/models.py:251 +msgid "CLOSE" +msgstr "" + +#: syrup/models.py:251 msgid "Accessible only to course-site owners" msgstr "" +#: syrup/models.py:282 +msgid "The end-term cannot begin before the start-term." +msgstr "" + +#: syrup/models.py:430 +#, python-format +msgid "Cannot determine access level for user %s in site %s" +msgstr "" + +#: syrup/models.py:507 +msgid "(internal)" +msgstr "" + #: syrup/models.py:518 msgid "Instructor" msgstr "" @@ -221,6 +282,26 @@ msgstr "" msgid "MARCXML" msgstr "" +#: syrup/models.py:633 +msgid "unknown" +msgstr "" + +#: syrup/models.py:634 +msgid "fair dealing" +msgstr "" + +#: syrup/models.py:635 +msgid "permission granted" +msgstr "" + +#: syrup/models.py:636 +msgid "licensed content" +msgstr "" + +#: syrup/models.py:637 +msgid "available to students" +msgstr "" + #: syrup/models.py:646 msgid "Normal" msgstr "" @@ -325,6 +406,10 @@ msgstr "" msgid "The page you requested could not be found" msgstr "" +#: syrup/views/_generics.py:53 +msgid "Cannot be blank." +msgstr "" + #: syrup/views/admin.py:17 templates/courses.xhtml:1 #: templates/admin/index.xhtml:24 msgid "Courses" @@ -339,7 +424,7 @@ msgid "Terms" msgstr "" #: syrup/views/admin.py:60 -msgid "start must precede finish" +msgid "The term's start must precede its finish." msgstr "" #: syrup/views/admin.py:87 @@ -350,6 +435,29 @@ msgstr "" msgid "Configs" msgstr "" +#. I18N: a 'hook' in this context is a locally-defined function. +#: syrup/views/admin.py:124 syrup/views/admin.py:141 +#, python-format +msgid "Sorry, cannot perform this operation at this time: hook %r not found." +msgstr "" + +#: syrup/views/admin.py:134 +msgid "Courses and departments updated." +msgstr "" + +#: syrup/views/admin.py:152 +msgid "Terms updated." +msgstr "" + +#: syrup/views/admin.py:173 +msgid "No user was selected." +msgstr "" + +#: syrup/views/admin.py:176 +#, python-format +msgid "Staff user added: %s [%s]." +msgstr "" + #: syrup/views/auth.py:24 msgid "Invalid username or password. Please try again." msgstr "" @@ -368,6 +476,10 @@ msgstr "" msgid "Courses with Materials in %s" msgstr "" +#: syrup/views/items.py:47 +msgid "Items of this type are not downloadable." +msgstr "" + #: syrup/views/items.py:76 syrup/views/items.py:238 syrup/views/items.py:266 msgid "You can only add items to headings!" msgstr "" @@ -384,6 +496,14 @@ msgstr "" msgid "Sorry, only HEADINGs, URLs and ELECs can be added right now." msgstr "" +#: syrup/views/items.py:165 +msgid "The title and/or URL are missing." +msgstr "" + +#: syrup/views/items.py:316 syrup/views/items.py:329 +msgid "Untitled" +msgstr "" + #: syrup/views/items.py:395 msgid "Unable to update" msgstr "" @@ -408,6 +528,10 @@ msgstr "" msgid "You cannot make an item a descendant of itself!" msgstr "" +#: syrup/views/sites.py:16 +msgid "The end-term precedes the start-term." +msgstr "" + #: syrup/views/sites.py:34 msgid "You are not allowed to create sites." msgstr "" @@ -432,6 +556,34 @@ msgstr "" msgid "Instructors only: this site is closed." msgstr "" +#: syrup/views/sites.py:104 +msgid "Changes saved." +msgstr "" + +#: syrup/views/sites.py:110 +#, python-format +msgid "Security level changed to \"%s\"." +msgstr "" + +#: syrup/views/sites.py:126 +#, python-format +msgid "%s has been added as a member (role: %s)." +msgstr "" + +#: syrup/views/sites.py:131 +#, python-format +msgid "%s: role changed to %s." +msgstr "" + +#: syrup/views/sites.py:145 +msgid "No group code or section number provided." +msgstr "" + +#: syrup/views/sites.py:150 +#, python-format +msgid "Group %s added." +msgstr "" + #: syrup/views/sites.py:202 msgid "You cannot join this site." msgstr "" @@ -635,7 +787,7 @@ msgid "Term" msgstr "" #: templates/open_sites.xhtml:19 templates/search_results.xhtml:35 -#: templates/item/item_add_cat_search.xhtml:65 +#: templates/item/item_add_cat_search.xhtml:66 #: templates/item/item_delete_confirm.xhtml:28 #: templates/item/item_metadata.xhtml:46 msgid "Title" @@ -674,7 +826,7 @@ msgstr[0] "" msgstr[1] "" #: templates/search_results.xhtml:35 -#: templates/item/item_add_cat_search.xhtml:65 +#: templates/item/item_add_cat_search.xhtml:66 msgid "Author" msgstr "" @@ -1041,7 +1193,7 @@ msgid "Author #%(num)s" msgstr "" #: templates/item/common_metadata.xhtml:21 -#: templates/item/item_add_cat_search.xhtml:65 +#: templates/item/item_add_cat_search.xhtml:66 #: templates/item/item_metadata.xhtml:50 msgid "Publisher" msgstr "" @@ -1122,33 +1274,33 @@ msgid_plural "%(first)s–%(last)s of %(total)s results." msgstr[0] "" msgstr[1] "" -#: templates/item/item_add_cat_search.xhtml:54 +#: templates/item/item_add_cat_search.xhtml:55 #, python-format msgid "Previous %(count)s" msgstr "" -#: templates/item/item_add_cat_search.xhtml:58 +#: templates/item/item_add_cat_search.xhtml:59 #, python-format msgid "Next %(count)s" msgstr "" -#: templates/item/item_add_cat_search.xhtml:65 +#: templates/item/item_add_cat_search.xhtml:66 msgid "PubDate" msgstr "" -#: templates/item/item_add_cat_search.xhtml:73 +#: templates/item/item_add_cat_search.xhtml:74 msgid "details" msgstr "" -#: templates/item/item_add_cat_search.xhtml:74 +#: templates/item/item_add_cat_search.xhtml:75 msgid "Electronic resource." msgstr "" -#: templates/item/item_add_cat_search.xhtml:75 +#: templates/item/item_add_cat_search.xhtml:76 msgid "view" msgstr "" -#: templates/item/item_add_cat_search.xhtml:85 +#: templates/item/item_add_cat_search.xhtml:86 msgid "Pick this item" msgstr "" diff --git a/conifer/pybabel-extract b/conifer/pybabel-extract index b6b07d4..f9889b0 100755 --- a/conifer/pybabel-extract +++ b/conifer/pybabel-extract @@ -131,6 +131,7 @@ if 'extract' in commands: os.system(('pybabel extract ' '-F babel.cfg ' '--omit-header ' + '-c I18N ' '-o %(POTFILE)s .' ) % vars()) diff --git a/conifer/syrup/models.py b/conifer/syrup/models.py index fb2e070..52274c8 100644 --- a/conifer/syrup/models.py +++ b/conifer/syrup/models.py @@ -248,7 +248,7 @@ class Site(BaseModel): ('LOGIN', _('Accessible to all logged-in users')), ('RESTR', _('Accessible to all logged-in users, but only course-site members can read electronic documents.')), ('MEMBR', _('Accessible to course-site members')), - ('CLOSE', _('Accessible only to course-site owners'))] + (_('CLOSE'), _('Accessible only to course-site owners'))] ACCESS_DEFAULT = getattr(settings, 'SITE_DEFAULT_ACCESS_LEVEL', 'ANON') assert ACCESS_DEFAULT in [x[0] for x in ACCESS_CHOICES] @@ -279,7 +279,7 @@ class Site(BaseModel): def save(self, *args, **kwargs): # Assert that the term-order is logical. assert self.start_term.start <= self.end_term.start, \ - 'The end-term cannot begin before the start-term.' + _('The end-term cannot begin before the start-term.') # Ensure there is always an internal Group. super(Site, self).save(*args, **kwargs) internal, just_created = Group.objects.get_or_create( @@ -427,8 +427,8 @@ class Site(BaseModel): elif level == u'MEMBR': return True else: - raise Exception('Cannot determine access level ' - 'for user %s in site %s' % (user, self)) + raise Exception(_('Cannot determine access level ' + 'for user %s in site %s') % (user, self)) def allows_downloads_to(self, user): """ @@ -504,7 +504,7 @@ class Group(BaseModel): def __unicode__(self): return u"Group('%s', '%s')" % (self.site, - self.external_id or '(internal)') + self.external_id or _('(internal)')) class Membership(BaseModel): @@ -630,11 +630,11 @@ class Item(BaseModel): # As per discussion with Art Rhyno and Joan Dalton, Leddy Library. COPYRIGHT_STATUS_CHOICES = [ - ('UK', 'unknown'), - ('FD', 'fair dealing'), - ('PG', 'permission granted'), - ('LC', 'licensed content'), - ('AV', 'available to students'), + ('UK', _('unknown')), + ('FD', _('fair dealing')), + ('PG', _('permission granted')), + ('LC', _('licensed content')), + ('AV', _('available to students')), ] copyright_status = m.CharField(max_length=2, diff --git a/conifer/syrup/views/_generics.py b/conifer/syrup/views/_generics.py index deddb03..e8f3f8a 100644 --- a/conifer/syrup/views/_generics.py +++ b/conifer/syrup/views/_generics.py @@ -50,6 +50,6 @@ def strip_and_nonblank(fieldname): def clean(self): v = self.cleaned_data.get(fieldname) or '' if not v.strip(): - raise ValidationError('Cannot be blank.') + raise ValidationError(_('Cannot be blank.')) return v.strip() return clean diff --git a/conifer/syrup/views/admin.py b/conifer/syrup/views/admin.py index aa34964..9b00a08 100644 --- a/conifer/syrup/views/admin.py +++ b/conifer/syrup/views/admin.py @@ -57,7 +57,7 @@ class TermForm(ModelForm): cd = self.cleaned_data s, f = cd.get('start'), cd.get('finish') if (s and f) and s >= f: - raise ValidationError, _('start must precede finish') + raise ValidationError, _('The term\'s start must precede its finish.') return cd admin_terms = generic_handler(TermForm, decorator=admin_only) @@ -120,8 +120,9 @@ def admin_update_depts_courses(request): if catalogue is None: return HttpResponse( - 'Sorry, cannot perform this operation at this time: ' - 'hook %r not found.' % HOOKNAME) + # I18N: a 'hook' in this context is a locally-defined function. + _('Sorry, cannot perform this operation at this time: ' + 'hook %r not found.') % HOOKNAME) else: for deptname, ccode, cname in catalogue: if not (deptname.strip() and ccode.strip() and cname.strip()): @@ -130,15 +131,15 @@ def admin_update_depts_courses(request): name=deptname, defaults={'service_desk': desk}) models.Course.objects.get_or_create( code=ccode, defaults={'department': dept, 'name': cname}) - return simple_message('Courses and departments updated.', '') + return simple_message(_('Courses and departments updated.'), '') def admin_update_terms(request): HOOKNAME = 'term_catalogue' catalogue = callhook(HOOKNAME) if catalogue is None: return HttpResponse( - 'Sorry, cannot perform this operation at this time: ' - 'hook %r not found.' % HOOKNAME) + _('Sorry, cannot perform this operation at this time: ' + 'hook %r not found.') % HOOKNAME) else: for tcode, tname, start, finish in catalogue: tcode = tcode.strip(); tname = tname.strip() @@ -148,7 +149,7 @@ def admin_update_terms(request): models.Term.objects.get_or_create( code = tcode, defaults = dict(name=tname, start=start, finish=finish)) - return simple_message('Terms updated.', '') + return simple_message(_('Terms updated.'\), '') @admin_only def admin_staff_add(request): @@ -169,10 +170,10 @@ def admin_staff_add(request): user.save() if not userid: - message = 'No user selected.' + message = _('No user was selected.') message_continue = False else: - message = 'Staff user added: %s [%s].' % (user.get_full_name(), user.username) + message = _('Staff user added: %s [%s].') % (user.get_full_name(), user.username) return g.render('admin/staff_add.xhtml', **locals()) diff --git a/conifer/syrup/views/items.py b/conifer/syrup/views/items.py index d728bea..c7bd762 100644 --- a/conifer/syrup/views/items.py +++ b/conifer/syrup/views/items.py @@ -44,7 +44,7 @@ def item_declaration(request, site_id, item_id): assert request.method == 'POST' item = get_object_or_404(models.Item, pk=item_id, site__id=site_id) if item.item_type != 'ELEC': - return HttpResponseNotFound('Items of this type are not downloadable.') + return HttpResponseNotFound(_('Items of this type are not downloadable.')) else: # we don't actually need the declaration object for anything; we just # need to ensure one exists. @@ -162,7 +162,7 @@ def item_add(request, site_id, item_id): publisher = clean('publisher') published = clean('published') if not (title and url): - raise Exception('Missing title and/or URL.') + raise Exception(_('The title and/or URL are missing.')) else: item = models.Item( site=site, @@ -313,7 +313,7 @@ def item_add_cat_search(request, site_id, item_id): if bibid > 0: item = site.item_set.create(parent_heading=parent_item, - title=dublin.get('dc:title','Untitled'), + title=dublin.get('dc:title',_('Untitled')), author=dublin.get('dc:creator'), publisher=dublin.get('dc:publisher',''), published=pubdate, @@ -326,7 +326,7 @@ def item_add_cat_search(request, site_id, item_id): **dct) else: item = site.item_set.create(parent_heading=parent_item, - title=dublin.get('dc:title','Untitled'), + title=dublin.get('dc:title',_('Untitled')), author=dublin.get('dc:creator'), publisher=dublin.get('dc:publisher',''), published=pubdate, diff --git a/conifer/syrup/views/sites.py b/conifer/syrup/views/sites.py index 7af9c35..8e0374f 100644 --- a/conifer/syrup/views/sites.py +++ b/conifer/syrup/views/sites.py @@ -13,7 +13,7 @@ class NewSiteForm(ModelForm): cd = self.cleaned_data if cd['start_term'].start > cd['end_term'].start: raise ValidationError( - 'The end-term precedes the start-term.') + _('The end-term precedes the start-term.')) return cd['end_term'] def __init__(self, *args, **kwargs): @@ -101,13 +101,13 @@ def edit_site_permissions(request, site_id): return g.render('edit_site_permissions.xhtml', **locals()) else: POST = request.POST - message = 'Changes saved.' # default + message = _('Changes saved.') # default message_iserror = False if 'action_access_level' in POST: access = POST.get('access') site.access = access - message = 'Security level changed: "%s"' % dict(choices)[access] + message = _('Security level changed to "%s".') % dict(choices)[access] elif 'action_add_member' in POST: userid = request.POST.get('userid') @@ -123,12 +123,12 @@ def edit_site_permissions(request, site_id): mbr, created = models.Membership.objects.get_or_create( group=group, user=user, defaults=dict(role=role)) if created: - message = '%s has been added as a member (role: %s).' % ( + message = _('%s has been added as a member (role: %s).') % ( user.get_full_name() or user.username, mbr.get_role_display()) else: mbr.role = role mbr.save() - message = '%s: role changed to %s.' % ( + message = _('%s: role changed to %s.') % ( user.get_full_name() or user.username, mbr.get_role_display()) @@ -142,12 +142,12 @@ def edit_site_permissions(request, site_id): groupcode = POST.get('groupcode','').strip() if not groupcode: - message = 'No group code or section number provided.' + message = _('No group code or section number provided.') message_iserror = True else: group, created = models.Group.objects.get_or_create( site=site, external_id=groupcode) - message = 'Group %s added.' % groupcode + message = _('Group %s added.') % groupcode site.save() return g.render('edit_site_permissions.xhtml', **locals())