• Name Picker - The language on Name Picker buttons does not change with system language

    By Jan Christian Krüger 1 decade ago

    The language of the labels and buttons from the name picker dialog is the same as the system language when we use upgrade pack 1 (in our case german). But when we use a newer ExtLib version from openntf (actually ExtLib 20121022-1354) the labels are always in english.

    • translated files

      By Padraic Edwards 1 decade ago

      Hi Jan,

      The translated files for the pickers are only available in the IBM supported release of the Extension Library that was called UP1. The OpenNTF builds do not contain the translated files for the pickers. However you can use a technique that Julian Buss came up with:

      http://xpageswiki.com/web/youatnotes/wiki-xpages.nsf/dx/Work_with_Extension_Library

      I did have to modify it slightly but it did work.

      dojo.provide("yn.dijit.PickerName");
          dojo.declare(
              "yn.dijit.PickerName",
              [extlib.dijit.OneUIPickerName], {
                  postMixInProperties: function() {
                      this.inherited(arguments);
                      var t = this.templateString;
                      // change text in HTML
                      // change button labels, add ">" in regex to make sure to select a button and nothing else
                      // the "g" option in the regex leads to javascript errors at runtime
                      t = t.replace("${PickerName_Search}", 'suchen');
                      t = t.replace("${PickerName_Add}", 'hinzufügen');
                      t = t.replace("${PickerName_Remove}", 'entfernen');
                      t = t.replace("${PickerName_RemoveAll}", 'alle entfernen');
                      t = t.replace("${PickerName_Cancel}", 'Abbruch');
                      this.templateString = t;
                  },
               postCreate: function() {
                      this.inherited(arguments);
                      console.log(this.tdSearchIn.innerHTML);
                      this.tdSearchFor.innerHTML="Namen suchen :";
              }
          });
          
          var ynXSPSelectValue = XSP.selectValue;
          XSP.selectValue = function(t, vars) {
              if (t == "extlib.dijit.OneUIPickerName") {
                  ynXSPSelectValue("yn.dijit.PickerName", vars);
              } else {
                  ynXSPSelectValue(t, vars);
              }
          }

      thanks,

      Padraic
       

      • Thank you

        By Jan Christian Krüger 1 decade ago

        Hi Padraic,

        sorry for my late response and a big thank you for this workaround. It is not very comfortable to add this script on every page where I use name pickers, but it works.

        Jan