Worlds.com     |  Development Kit Table of Contents  |

Localization


Localizing WorldsPlayer

Written by Frank Kane

11/27/00

Follow these steps to create a localized version of WorldsPlayer:

1. Find the two-letter ISO country and language codes for the language and locale you wish to translate to. A list of language codes may be found at http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt and a list of country codes is at http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html. You will append the language and country codes, seperated by an underscore character, to all localized files. For exmaple, Korean would be ko_KO. Japanese would be ja_JP. If you do not want to produce different files for specific dialects of the same language, you may omit the country code. The suffix “ko” without the _KO would produce files used for any locale of Korean.

2. Create the localized versions of the user interface graphics. This is best done by editing the English versions of the .GIF files included with the WorldsPlayer to replace the English text within them. At present, these files include:

DYRWTQ.GIF

ACTT.GIF

EXPLORE.GIF

FRIENDS.GIF

RTPANEL.GIF

PWC.GIF

MFRIENDS.GIF

OPNSCRNC.GIF

QUIT.GIF

BACK.GIF

CHANGEAV.GIF

HANGON.GIF

MOREINFO.GIF

NOTAVAIL.GIF

Save the edited versions of the images with the locale-specific suffix you figured out in step 1. For example, RTPANEL.GIF would be saved as RTPANEL_ja_JP.GIF for a Japanese localization.

Be very careful to preserve the alignment of any images that contain multiple buttons in a single image.

3. Create localized text. All of the English text displayed by WorldsPlayer resides in the file “MessagesBundle.properties.” Create a copy of this file with the appropriate suffix, for example, MessagesBundle_ja_JP.properties for a Japanese localization. Open this file up with a text editor capable of editing the native language you are localizing to, for example, Microsoft Word installed on a Japanese version of Windows.

In general, you want to translate any text that follows an equals (=) sign in this file. There are some special cases to note:

- Make sure there is an entry for the language and country code that describes this localization in English. For example, ja_JP = Japanese. This will be used to display the language in the “switch language” menu.

- There are a series of lines for the various gif files that may be localized. Make sure these are modified to point to your new, localized user interface artwork. For example, rtpanel.gif = rtpanel_ja_JP.gif for a Japanese localization.

- At the end of the .properties file is a list of Windows Locale ID’s. Refer to Microsoft’s documentation at http://msdn.microsoft.com/library/books/devintl/S2595.HTM to find the locale ID that corresponds to your language and country code from step 1. Create an entry here, such as 411 = ja_JP.

- Also be careful with the “return” character. There is no need to break lines manually; this will only confuse our program. If you feel the need to break up long lines, do so by using a backslash (\) character at the end of the line you wish to continue on a new line.

4. Convert your .properties file to escaped-Unicode format. The easiest and most reliable way to do this is by using Microsoft Word to save your file as “UTF8” format. Then, use the command-line utility “native2ascii” to convert the utf8 file to escaped unicode. >From a command line, you would type something like

native2ascii -encoding UTF8 oldfile newfile

replacing “oldfile” with the name of our UTF8 encoded file and newfile to your final, converted file, which should ultimately named as described above (ie “MessagesBundle_ja_JP.properties” for Japanese.)

native2ascii is available as part of Sun’s Java Development Kit (JDK) which may be downloaded from java.sun.com, or we can email you a copy of it.

5. Test your changes. By placing all of the files you created into the installation directory of WorldsPlayer installed on an OS native to your target locale, you should now see your localized files in action.

6. Distribute. If all works as planned, send us your localized files so we may produce an installer that includes them for you.

Top of Page


Localizing Worlds Web Page Templates

 

Overview:
     The Gamma client invokes various CGI scripts to do things like  register new users, show them the status of their account, etc.  Originally, these CGI scripts generated HTML pages on the fly, assembling bits and pieces of text embedded in the Perl code. In order to make it possible to create localizations without having to be a Perl expert (and be intimately familiar with the internals of each Perl  script as well) the HTML text was extracted from the Perl code and put into separate template files.

     Some of the text must be modified by the Perl code at run time, so the templates have to incorporate placeholders that the Perl code can replace with the appropriate information.  These placeholders, or variables, look  like %%username%%.  Each CGI script has its own lists of variables that it  looks for and replaces in each template that it uses.

     When the Gamma client invokes a CGI script, it uses a name like register_zh_TW.pl, where _zh_TW specifies the language and character
encoding to use.  We could have separate copies of register.pl for each language, but instead, all the file names are linked to one physical copy of the file, so that only one copy of the code has to be maintained.  When  invoked, the CGI script checks for an underscore and a language specifier at the end of its name, and uses that to decide what set of templates to use.  By default, if no language is specified, it uses the "eng" templates.  Also, if it can't find a particular language-specific template, it will fall back to the "eng" version.

Perl Scripts (in /home/apache/cgi-bin):
- reg<product>_<lang>.pl is a link to register.pl, which looks at its name to determine which product to talk about and which template set to use. For example, regcokedown_zh_TW.pl would talk about the Coke downloadable  version, using the zh_TW templates.

- account_<lang>.pl is a link to account.pl, which will look at its name  to determine which templates to use. (NOT FINISHED YET)
- edit_<lang>.pl
- editbill_<lang>.pl
- changemail_<lang>.pl
- username_<lang>.pl
- passwd_<lang>.pl
- vip_<lang>.pl

Templates (in /home/apache/cgi-bin/templates):
     Templates have names like <script><part>_<lang>.html (or .txt, as appropriate).

     This list is just for the registration pages;
- regmain_eng.html - main registration form.
     %%product%%: The product name (e.g. WorldsInAsia).
     %%id%%: A hidden field to carry the internal ID number.
     %%reg%%: A hidden field used in debugging with regtest.pl.
     %%topmsgs%%: Any error messages displayed at the top of the form.
     %%emailwarn%%: A possible warning about an invalid e-mail address.
     %%vipBEGIN%%, %%vipEND%%: Used to comment out the VIP PIN field if it's not needed.
     %%msg_*%%: A set of error messages, one for each form field.

- regconf_eng.html - registration confirmation page.
     %%product%%: The product name (e.g. WorldsInAsia).
     %%id%%: A hidden field to carry the internal ID number.
     %%reg%%: A hidden field used in debugging with regtest.pl.
     %%currentemail%%: E-mail address to which the conf. message has been sent.
     %%bademail%%: A possible warning about an invalid e-mail address (same as %%emailwarn%% in regmain?).
     %%emailmsg%%: A more detailed error message (same as regmain's msg_E-Mail?).
     %%atcurrentemail%%: The phrase "at %%currentemail%%" (this probably needs to be the whole sentence, since composing phrases won't work).

- regconf2_eng.html - alternate registration confirmation page, for support of old clients.
     %%product%%: The product name (e.g. WorldsInAsia).
     %%id%%: A hidden field to cary the internal ID number.
     %%reg%%: A hidden field used in debugging with regtest.pl.
     %%currentemail%%: E-mail address to which the conf. message has been sent.

- regclose_eng.html - closes the browser window used for registration.
     %%product%%: The product name (e.g. WorldsInAsia).

- regmail_eng.txt - confirmation e-mail containing codeword.
     %%productcom%%: The .com name (e.g. WorldsInAsia.com).
     %%cw%%: The codeword.

- regmail2_eng.txt - confirmation e-mail containing serial number for support of old clients.
     %%product%%: The product name (e.g. WorldsInAsia).
     %%productcom%%: The .com name (e.g. WorldsInAsia.com).
     %%cw%%: The serial number.

- account_eng.html - account info page, incomplete; this list of variables will probably change.
     %%nick%%: The username.
     %%passwd%%: The password.
     %%vip%%: 'VIP' for a VIP, empty string for a non-VIP.
     %%email%%: The e-mail address associated with the account.
     %%balance%%: The bonus points associated with the account.
     %%billing%%: A string describing how they obtained their VIP status (prepaid, credit card, check, etc.)
     %%rows%%: The bonus point transactions for this user.


WorldsPlayer Web Pages Flow Chart

 

Buttons are represented in square brackets, viz. [Button Name].

 

Gamma Client:

    [Options]:

      Check Account Info -> account.pl

      Edit Personal Info -> edit.pl

    [VIP] -> vip.pl

    [Login Wizard] -> register.pl or one of its variants

 

account.pl (needs/gets Username&Password):

    [Renew subscription] -> vip.pl

    [Edit Personal Info] -> edit.pl

    [Edit Billing Info] -> editbill.pl

    [Become a VIP] (only for non-vips) -> vip.pl

 

edit.pl (needs/gets Username&Password):

    No links.

 

editbill.pl (needs/gets Username&Password):

    For all VIPs:

      [Renew VIP Subscription] -> vip.pl

    [Change e-mail address] -> changemail.pl

    [Change username] -> username.pl

    [Change Password] -> passwd.pl

    For all VIPs:

      [Close VIP account] -> mailto support

    For non-VIPs:

      [Become a VIP] -> vip.pl

 

changemail.pl (needs/gets Username&Password):

    No links.

 

username.pl (needs Username&Password):

    No links.

 

passwd.pl (needs Username&Password):

    No links.

 

vip.pl (needs/gets username):

    Currently no links.

 

register.pl:

    No links.

 

Top of Page