From 796ed67e12b1aa5cb88a8519e2e8228fbfa2726c Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 28 May 2013 10:45:02 +0300 Subject: [PATCH] LP#1184885 ACQ: i18n for search abbreviations Allow translating the Acq Search dropdown class name abbreviations. Signed-off-by: Pasi Kallinen Signed-off-by: Jeff Godin --- Open-ILS/web/js/dojo/openils/acq/nls/acq.js | 6 ++++++ Open-ILS/web/js/ui/default/acq/search/unified.js | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js index c7e0bd3b32..11267742f5 100644 --- a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js +++ b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js @@ -93,5 +93,11 @@ "INVOICE_COPY_COUNT_INFO": "Copies received on this invoice: ${0} out of ${1}.", "INVOICE_IDENT_COLLIDE": "There is already an invoice in the system with the given combination of 'Vendor Invoice ID' and 'Provider,' which is not allowed.", "NEW_INVOICE": "New Invoice", + "ACQ_SEARCH_CLASS_ABBR_jub": "LI", + "ACQ_SEARCH_CLASS_ABBR_acqpl": "SL", + "ACQ_SEARCH_CLASS_ABBR_acqpo": "PO", + "ACQ_SEARCH_CLASS_ABBR_acqinv": "I", + "ACQ_SEARCH_CLASS_ABBR_acqlid": "LID", + "ACQ_SEARCH_CLASS_ABBR_acqlia": "LIA", "NO_LI_GENERAL" : "You have not selected any (suitable) line items." } diff --git a/Open-ILS/web/js/ui/default/acq/search/unified.js b/Open-ILS/web/js/ui/default/acq/search/unified.js index 926662fa1f..3aa07c099b 100644 --- a/Open-ILS/web/js/ui/default/acq/search/unified.js +++ b/Open-ILS/web/js/ui/default/acq/search/unified.js @@ -87,7 +87,9 @@ function TermSelectorFactory(terms) { /* Create abbreviations for class names to make field categories * more readable in field selector control. */ - this._abbreviate = function(s) { + this._abbreviate = function(t, s) { + var ca = "ACQ_SEARCH_CLASS_ABBR_" + t; + if (localeStrings[ca]) return localeStrings[ca]; var last, result; for (var i = 0; i < s.length; i++) { if (s[i] != " ") { @@ -226,7 +228,7 @@ function TermSelectorFactory(terms) { var optgroup = dojo.create( "optgroup", {"value": "", "label": this.terms[hint].__label} ); - var prefix = this._abbreviate(this.terms[hint].__label); + var prefix = this._abbreviate(hint, this.terms[hint].__label); for (var field in this.terms[hint]) { if (!/^__/.test(field)) { -- 2.43.2