LP#1184885 ACQ: i18n for search abbreviations
authorPasi Kallinen <pasi.kallinen@pttk.fi>
Tue, 28 May 2013 07:45:02 +0000 (10:45 +0300)
committerJeff Godin <jgodin@tadl.org>
Tue, 18 Feb 2014 07:56:43 +0000 (02:56 -0500)
Allow translating the Acq Search dropdown class name abbreviations.

Signed-off-by: Pasi Kallinen <pasi.kallinen@pttk.fi>
Signed-off-by: Jeff Godin <jgodin@tadl.org>
Open-ILS/web/js/dojo/openils/acq/nls/acq.js
Open-ILS/web/js/ui/default/acq/search/unified.js

index c7e0bd3..1126774 100644 (file)
     "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."
 }
index 926662f..3aa07c0 100644 (file)
@@ -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)) {