Skip to content

Multi Language Menu

HowardBaxton edited this page Mar 27, 2020 · 1 revision

(experimental)(plain) Multi Language support for menus

You will need nPose V3.10 or newer to use this.

Steps to use this

  1. Set up your project as usual until you are fine with each and every detail.
  2. Copy all SET: NCs into your inventory.
  3. Rename all cards to the language of your choice. Also replace the SET prefix by the upper case 2 letter ISO 639-1 code of the desired language https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes .
    Example: if you want to implement a german menu, then rename the card SET:swim to DE:schwimmen. Also look inside the card if there is something to be replaced (for example the text of the MENUPROMPT)
  4. Copy all cards back to the object.
  5. Test your object. If you use the menu with a german viewer you should see the german menu. If your viewer uses any other language you should see the menu defined by the SET: cards. If you want to see a language but don't want to switch your viewer language you can force the menu to show that language by setting OPTION|autoLanguage=0|defaultLanguagePrefix=DE (exchange DE (german) by the language code of your choice). Remember to remove this line after you finished your test.
  6. If you want to add another language repeat the steps above.

Limitations

  • this approach is only suitable for menus with a small number of buttons (because of the LSL memory restrictions).
    Lead: numberOfAdditionalLanguages = RoundDown(300 / yourNumberOfSETCards) - 1
  • The language selection is done automatically. You cannot switch manually to another language (because of the LSL memory restrictions).
  • The selection is based on the language string of the viewer. The user can manipulate the string (via the debug settings of the viewer) in a way it becomes unreadable by the script. It will then fallback to the default language (SET: cards).
  • Users can also disallow scripts to read their language string, so the script will then fallback to the default language (SET: cards)
  • Some strings may be hardcoded into the scripts. They can't be translated.
  • The language detection is based on llGetAgentLanguage You may want to look at http://wiki.secondlife.com/wiki/LlGetAgentLanguage for some more limitations.