2 Replies Latest reply on Mar 12, 2009 3:33 AM by Kasyan Servetsky

    [JS CS3 Mac&Pc] Enabling automatic localization problem

    Kasyan Servetsky Level 5
      Hi all,

      I’m trying to enable automatic localization in my script, as described in ‘Localization in ScriptUI Objects’ section of ‘JavaScript Tools Guide’ for CS3 (pages 87-88).

      I try the first example and it works as expected:
      $.locale = "fr";
      
      w = new Window('dialog', 'Test');
      btnText = { en: "Yes", de: "Ja", fr: "Oui", ru: "Да" };
      b1 = w.add ( "button", undefined, localize(btnText) );
      w.show();


      Then I read the following:
      >If you do not need variable replacement, you can use automatic localization. To turn on automatic
      >localization, set the global value:
      >$.localization=true

      I really don’t need variable replacement in my script and don’t want to type localize() around every string over and over again, because there are countless numbers of them.
      So automatic localization is just what the doctor ordered. I try the second example, but instead of the localized string I get ‘Object’.
      $.locale = "fr";
      
      $.localize = true;
      w = new Window('dialog', 'Test');
      btnText = { en: "Yes", de: "Ja", fr: "Oui", ru: "Да" };
      b1 = w.add ( "button", undefined, btnText );
      w.show();



      Any1 have any ideas?

      Kasyan