Translating Sloodle objects in Second Life

From SLIS Second Life Wiki

Revision as of 21:21, 29 August 2009 by Fire (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Note: the method of translating in-world Sloodle objects will change in Sloodle 0.3.

There are many Sloodle objects in Second Life, and they are all initially developed in English. Unfortunately, LSL is much slower than PHP, and so the same localization facilities are not available in-world as in Moodle. Additionally, some aspects could not work in that way. As such, we typically need to maintain different objects for different translations.

Please note: whenever you do translation work for Sloodle, it would be useful if you could provide a list of words/phrases/sentences you have translated, where they occurred, the object versions, and what the original text was (the list could be provided on the forums or the wiki). This would allow programmers to re-use your translations in future versions, without requiring you to go back through the same objects multiple times.


Contents

Before you start

To avoid duplication of effort, please report your interest in translating a particular object by posting on the Sloodle.org forums. You can hopefully also find collaborators, so that the translation work can be shared among several people.


What to translate

Textures

All Sloodle objects have textures on them, and there are often words or phrases on these textures (such as buttons or instructions). We will try to make all images available so that you can download the original as a JPG or PNG or similar, edit it, and re-upload it into Second Life (note: the Sloodle project cannot offer reimbursement of upload fees). The placement, colour and style of text on these textures if often very important, so please try to match your translations as closely as possible to the originals.


Notecards

We do not use notecards much (except the configuration notecards, 'sloodle_config' and 'sloodle_config_sample', which do not need translated). However, notecards may be used to provide instructions in future, in which case assistance in translating them would be much appreciated.


Scripts

The translation of scripts is a very big task, and you will definitely need some knowledge of LSL to do it. Most of the contents of the script should not be translated, as it must remain readable for the programmers! However, the scripts will often provide instructions or information to the user, and it would be useful to translate these items of text. You are generally looking to translate text output with the following LSL functions:

  • llSetText
  • llWhisper {channel 0}
  • llSay {channel 0}
  • llDialog

Sloodle LSL Translation Code

  1. ) Include the following constants in your LSL Code:

// Translation output methods string SLOODLE_TRANSLATE_LINK = "link"; // No output parameters - simply returns the translation on SLOODLE_TRANSLATION_RESPONSE link message channel string SLOODLE_TRANSLATE_SAY = "say"; // 1 output parameter: chat channel number string SLOODLE_TRANSLATE_WHISPER = "whisper"; // 1 output parameter: chat channel number string SLOODLE_TRANSLATE_SHOUT = "shout"; // 1 output parameter: chat channel number string SLOODLE_TRANSLATE_REGION_SAY = "regionsay"; // 1 output parameter: chat channel number string SLOODLE_TRANSLATE_OWNER_SAY = "ownersay"; // No output parameters string SLOODLE_TRANSLATE_DIALOG = "dialog"; // Recipient avatar should be identified in link message keyval. At least 2 output parameters: first the channel number for the dialog, and then 1 to 12 button label strings. string SLOODLE_TRANSLATE_LOAD_URL = "loadurl"; // Recipient avatar should be identified in link message keyval. 1 output parameter giving URL to load. string SLOODLE_TRANSLATE_HOVER_TEXT = "hovertext"; // 2 output parameters: colour <r,g,b>, and alpha value string SLOODLE_TRANSLATE_IM = "instantmessage"; // Recipient avatar should be identified in link message keyval. No output parameters.


Translating llDialog

integer SLOODLE_CHANNEL_AVATAR_DIALOG = 6000000 + (integer)(llFrand( 6000001 )); //create a random channel to listen on so that your object doesnt cause another objects menu to appear!

list buttons = [BUTTON0, BUTTON1, BUTTON2, BUTTON3, BUTTON4, BUTTON5, BUTTON6, BUTTON7, BUTTON8, BUTTON9, BUTTON10, BUTTON11] //maximum of 12!

string translationLookup = "webintercom:ctrlmenu"; //"webintercom:ctrlmenu" is an example translation you can find in sloodle_translation_metagloss_en.lsl

list stringParams = ["Help", "Cancel"]; // these get inserted into the dialog text as variables ie: Please choose Template:0 or Template:1 will display: "Please choose Help or Cancel"

key uuidToSendDialogTo = llDetectedKey(0);

sloodle_translation_request(SLOODLE_TRANSLATE_DIALOG, [SLOODLE_CHANNEL_AVATAR_DIALOG]+buttons, translationLookup, stringParams, uuidToSendDialogTo, "webintercom");

Note: There may be other function used to output text, and strings may be stored prior to output with a function. You probably need to translate nearly any plain-text string.

Translating llLoadURL

string urltoload = "http://www.sloodle.org"; //the url to load
string transLookup = "userauthurl"; //the translation lookup as defined in your translation script which will be displayed on the dialog
key avuuid = ""; // this is the avatar the dialog will be displayed to
sloodle_translation_request(SLOODLE_TRANSLATE_LOAD_URL, [urltoload], transLookup , [], avuuid, "");

Translating llSay

Example Use:

list stringParams = ["1","2"];

string batch = "metagloss"; //the sloodle tool we are translating

integer channel = 0;

sloodle_translation_request(SLOODLE_TRANSLATE_OWNER_SAY, [channel], "metagloss:checkok", stringParams, NULL_KEY, batch);

What to do next

When you have finished translating an object, please pass a copy to a member of the core Sloodle team (with copy/modify permissions enabled on all items, including textures/scripts). "Pedro McMillan" should be able to handle this for you. The object will be tested, and if it works correctly and has the correct permissions, it will be added to the official Sloodle Distributor for use by other people.


This page is part of the Sloodle documentation
SloodleDocs Home | User Documentation | Administrator Documentation | Developer Documentation | Sloodle Wiki Home