From bd24a1c7db576a6f361266e26313a526da12aa41 Mon Sep 17 00:00:00 2001 From: dbs Date: Sat, 23 Apr 2011 05:22:05 +0000 Subject: [PATCH] Add i18n support to the User Editor / registration interface Per LP # 754898, the Register Patron interface currently contains many hardcoded strings. Given that the previous patron registration interface supported translation, this is a regression in 2.0. Accordingly, we extend the use of Dojo i18n support to provide the strings for buttons and a number of labels on the Register Patron interface. The bulk of the remaining text is provided by the fieldmapper definitions, which should in theory be translated automatically for us. git-svn-id: svn://svn.open-ils.org/ILS/trunk@20298 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../web/js/dojo/openils/actor/nls/register.js | 18 +++- .../web/js/ui/default/actor/user/register.js | 21 ++++- .../default/actor/user/register_table.tt2 | 30 +++--- build/i18n/po/register.js/register.js.pot | 94 ++++++++++++++++--- 4 files changed, 130 insertions(+), 33 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/actor/nls/register.js b/Open-ILS/web/js/dojo/openils/actor/nls/register.js index ab1150a96f..9a35b6c962 100644 --- a/Open-ILS/web/js/dojo/openils/actor/nls/register.js +++ b/Open-ILS/web/js/dojo/openils/actor/nls/register.js @@ -9,5 +9,21 @@ "DUPE_PATRON_ADDR" : "Found ${0} patron(s) with the same address", "REPLACED_ADDRESS" : "
Replaces address ${0}
${1} ${2}
${3}, ${4} ${5}
", "INVALID_FORM" : "Form is invalid. Please edit and try again.", - "EXAMPLE" : "Example: " + "EXAMPLE" : "Example: ", + "REPLACE_BARCODE" : "Replace Barcode", + "BARCODE_IN_USE" : "Barcode is already in use", + "SEE_ALL" : "See All", + "DUPE_USERNAME" : "Username is already in use", + "RESET_PASSWORD" : "Reset Password", + "VERIFY_PASSWORD" : "Verify Password", + "PARENT_OR_GUARDIAN" : "Parent/Guardian", + "USER_SETTINGS" : "User Settings", + "ADDRESS_HEADER" : "Address", + "ADDRESS_MAILING" : "Mailing", + "ADDRESS_BILLING" : "Billing", + "ADDRESS_PENDING" : "This is a pending address: ", + "ADDRESS_APPROVE" : "Approve Address", + "ADDRESS_OWNED" : "This address is owned by another user: ", + "ADDRESS_NEW" : "New Address", + "STAT_CATS" : "Statistical Categories" } diff --git a/Open-ILS/web/js/ui/default/actor/user/register.js b/Open-ILS/web/js/ui/default/actor/user/register.js index 71545939c2..658a6dd78b 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -61,6 +61,14 @@ function load() { var userId = cgi.param('usr'); var stageUname = cgi.param('stage'); + dojo.query("td[name='addressHeader']").forEach( function(item) { item.innerHTML = localeStrings.ADDRESS_HEADER; }); + dojo.query("span[name='mailingAddress']").forEach( function(item) { item.innerHTML = localeStrings.ADDRESS_MAILING; }); + dojo.query("span[name='billingAddress']").forEach( function(item) { item.innerHTML = localeStrings.ADDRESS_BILLING; }); + dojo.query("span[name='addressPending']").forEach( function(item) { item.innerHTML = localeStrings.ADDRESS_PENDING; }); + dojo.query("button[name='approve-button']").forEach( function(item) { item.innerHTML = localeStrings.ADDRESS_APPROVE; }); + dojo.query("span[name='address-already-owned']").forEach( function(item) { item.innerHTML = localeStrings.ADDRESS_OWNED; }); + dojo.query("button[name='addressNew']").forEach( function(item) { item.innerHTML = localeStrings.ADDRESS_NEW; }); + if(xulG) { if(xulG.ses) openils.User.authtoken = xulG.ses; if(typeof xulG.clone != 'undefined') cloneUser = xulG.clone; @@ -187,6 +195,17 @@ function load() { checkGrpAppPerm(); // to do the initial load loadStaticFields(); + + replaceBarcode.attr("label", localeStrings.REPLACE_BARCODE); + dojo.byId('uedit-dupe-barcode-warning').innerHTML = localeStrings.BARCODE_IN_USE; + allCards.attr("label", localeStrings.SEE_ALL); + dojo.byId('uedit-dupe-username-warning').innerHTML = localeStrings.DUPE_USERNAME; + generatePassword.attr("label", localeStrings.RESET_PASSWORD); + dojo.byId('verifyPassword').innerHTML = localeStrings.VERIFY_PASSWORD; + dojo.byId('parentGuardian').innerHTML = localeStrings.PARENT_OR_GUARDIAN; + dojo.byId('userSettings').innerHTML = localeStrings.USER_SETTINGS; + dojo.byId('statCats').innerHTML = localeStrings.STAT_CATS; + if(patron.isnew() && patron.addresses().length == 0) uEditNewAddr(null, uEditAddrVirtId, true); else loadAllAddrs(); @@ -1515,7 +1534,7 @@ function uEditNewAddr(evt, id, mkLinks) { } } else if(row.getAttribute('name') == 'uedit-addr-divider') { - // link up the billing/mailing address and give the inputs IDs so we can acces the later + // link up the billing/mailing address and give the inputs IDs so we can access the later // billing address var ba = getByName(row, 'billing_address'); diff --git a/Open-ILS/web/templates/default/actor/user/register_table.tt2 b/Open-ILS/web/templates/default/actor/user/register_table.tt2 index 711e56f72e..552825234c 100644 --- a/Open-ILS/web/templates/default/actor/user/register_table.tt2 +++ b/Open-ILS/web/templates/default/actor/user/register_table.tt2 @@ -2,30 +2,28 @@ - + - + - + - Verify Password + @@ -35,7 +33,7 @@ - Parent/Guardian + @@ -51,7 +49,7 @@ - User Settings + @@ -60,18 +58,18 @@ - Address + - Mailing - Billing + + - This is a pending address: - + +
@@ -80,7 +78,7 @@ - This address is owned by another user: + @@ -99,12 +97,12 @@ - + - Statistical Categories + diff --git a/build/i18n/po/register.js/register.js.pot b/build/i18n/po/register.js/register.js.pot index f2fc92d083..21f4cab94b 100644 --- a/build/i18n/po/register.js/register.js.pot +++ b/build/i18n/po/register.js/register.js.pot @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: Evergreen 1.4\n" "Report-Msgid-Bugs-To: open-ils-dev@list.georgialibraries.org\n" -"POT-Creation-Date: 2011-04-18 21:45:31-0400\n" +"POT-Creation-Date: 2011-04-23 01:19:52-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -11,28 +11,44 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8-bit\n" -#: register.js:DUPE_PATRON_ADDR -msgid "Found ${0} patron(s) with the same address" +#: register.js:USER_SETTINGS +msgid "User Settings" msgstr "" -#: register.js:INVALID_FORM -msgid "Form is invalid. Please edit and try again." +#: register.js:DUPE_PATRON_EMAIL +msgid "Found ${0} patron(s) with the same email address" msgstr "" -#: register.js:DUPE_PATRON_IDENT -msgid "Found ${0} patron(s) with the same identification" +#: register.js:ADDRESS_BILLING +msgid "Billing" msgstr "" -#: register.js:DELETE_ADDRESS -msgid "Delete address ${0}?" +#: register.js:SEE_ALL +msgid "See All" msgstr "" -#: register.js:DUPE_PATRON_EMAIL -msgid "Found ${0} patron(s) with the same email address" +#: register.js:BARCODE_IN_USE +msgid "Barcode is already in use" msgstr "" -#: register.js:DUPE_PATRON_NAME -msgid "Found ${0} patron(s) with the same name" +#: register.js:REPLACED_ADDRESS +msgid "
Replaces address ${0}
${1} ${2}
${3}, ${4} ${5}
" +msgstr "" + +#: register.js:DUPE_PATRON_ADDR +msgid "Found ${0} patron(s) with the same address" +msgstr "" + +#: register.js:DUPE_PATRON_IDENT +msgid "Found ${0} patron(s) with the same identification" +msgstr "" + +#: register.js:ADDRESS_MAILING +msgid "Mailing" +msgstr "" + +#: register.js:REPLACE_BARCODE +msgid "Replace Barcode" msgstr "" #: register.js:NEED_ADDRESS @@ -43,14 +59,62 @@ msgstr "" msgid "Example: " msgstr "" +#: register.js:ADDRESS_HEADER +msgid "Address" +msgstr "" + #: register.js:DUPE_PATRON_PHONE msgid "Found ${0} patron(s) with the same phone number" msgstr "" -#: register.js:REPLACED_ADDRESS -msgid "
Replaces address ${0}
${1} ${2}
${3}, ${4} ${5}
" +#: register.js:INVALID_FORM +msgid "Form is invalid. Please edit and try again." +msgstr "" + +#: register.js:PARENT_OR_GUARDIAN +msgid "Parent/Guardian" +msgstr "" + +#: register.js:DUPE_PATRON_NAME +msgid "Found ${0} patron(s) with the same name" +msgstr "" + +#: register.js:ADDRESS_PENDING +msgid "This is a pending address: " +msgstr "" + +#: register.js:DUPE_USERNAME +msgid "Username is already in use" msgstr "" #: register.js:DEFAULT_ADDRESS_TYPE msgid "MAILING" msgstr "" + +#: register.js:ADDRESS_APPROVE +msgid "Approve Address" +msgstr "" + +#: register.js:VERIFY_PASSWORD +msgid "Verify Password" +msgstr "" + +#: register.js:STAT_CATS +msgid "Statistical Categories" +msgstr "" + +#: register.js:ADDRESS_NEW +msgid "New Address" +msgstr "" + +#: register.js:RESET_PASSWORD +msgid "Reset Password" +msgstr "" + +#: register.js:ADDRESS_OWNED +msgid "This address is owned by another user: " +msgstr "" + +#: register.js:DELETE_ADDRESS +msgid "Delete address ${0}?" +msgstr "" -- 2.43.2