Allow translating the Acq Search dropdown class name abbreviations. user/paxed/i18n-acq-search-class-abbr
authorPasi Kallinen <pasi.kallinen@pttk.fi>
Tue, 28 May 2013 07:45:02 +0000 (10:45 +0300)
committerPasi Kallinen <pasi.kallinen@pttk.fi>
Tue, 28 May 2013 07:45:02 +0000 (10:45 +0300)
Signed-off-by: Pasi Kallinen <pasi.kallinen@pttk.fi>
Open-ILS/web/js/dojo/openils/acq/nls/acq.js
Open-ILS/web/js/ui/default/acq/search/unified.js

index d95fc4f..b9399ad 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 line items."
 }
index a59f4eb..3a7faec 100644 (file)
@@ -85,7 +85,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] != " ") {
@@ -218,7 +220,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)) {