The other day I localized a small game (Grouper) and came up with
Spanish, French and German versions.  Since there's not a whole lot of
information on how to do this I thought I'd post my results here (and
to pilot.programmer.gcc), in case anyone's interested.

   It's really not that difficult, and I'm surprised that more apps
(and not just big names) aren't localized.  Including code changes
like taking hard-coded strings out of the source, the entire project
took about a day's worth of effort for 3 languages.

   Here are the steps I found I had to go through:
   1. Strip any hard-coded strings out of the source and create string
resource in PilRC instead.  (You can easily grab a pointer to them
with SysCopyStringResource.)

   2. I went a step further and declared a global Char and a wrapper
function, GetString, to easily return a string.
   Char gString[32];   // util global for localized strings

   static CharPtr GetString(Word idString) {
      SysCopyStringResource(gString, idString);

      return gString;
   }

   3. In the app's .rcp file I created translations with the TRANSLATION
keyword.  It helped to create an "ENGLISH" translation to translate
some of the longer sentences into a shorter identifier, e.g.,
   "StringClear" = "Are you sure you want to clear all high scores?"

   4. Grouper uses numericSpaceChr after the end of the longest menu
item string to provide spacing between the menu item and the shortcut
character.  I used translations here so I could later pick the longest
localized string and append the space character (\200) to it, e.g.,
   TRANSLATION "ENGLISH"
   "Preferences..." = "Preferences...\200"
   ...
   TRANSLATION "FRENCH"
   "High Scores..." = "Meilleurs Scores...\200"
   "Preferences..." = "Pr�f�rences..."

   However, this may or may not be a good idea since OS 3.1 changes
the location of numericSpaceChr in the fonts.  Grouper seems to look
fine on OS 3.1.

   5. It's also possible to change the shortcut characters with the
following:
   TRANSLATION "FRENCH"
   "U" = "R"
   "Undo" = "Reprendre"
   ...
   MENU ID idMenuGrouper
   ...
      MENUITEM "Undo" idMenuItemUndo "U"

   I'm not sure that Wes Cherry ever intended this and I haven't seen
it done before, but it works.  (Note that certain context shortcuts
for editing shouldn't be overridden with your own.  This probably also
applies for localized versions of the ROM.)

   6. Other languages are generally not as concise in computing areas,
so translations tend to be longer.  YMMV, but for the most part this
holds true.  Consequently, I ended up having to widen popup lists,
move labels much farther to the left, come up with different terms,
etc.  It's just something to consider if you're building your app from
the ground up and want to support localized versions.

   7.  That said, You can _really_ take advantages of the CENTER@ and
RIGHT@ keywords with position coordinates.  I only wish I had re-read
the docs and found out about them sooner.  In German, "Punkte:" is much
longer than the English "Score:", and PilRC allowed me to use RIGHT@125
to right-align both labels up to where Grouper was drawing the score.

   8.  The translation: you can get a rough idea of the general
translation at http://babelfish.altavista.com, which will do English
to German, Spanish and French for starters (and vice versa).  The
translated versions are rather formal and homonyms in English might
come out wrong.  For example, "Deal" translated to French came out
"Affaire" (let's make a deal) instead of "Donner" (deal the card).
   You'll probably still want to do the leg-work yourself, unless you
have a really excited user who doesn't mind doing it.  It took about
twenty minutes to translate 65 strings into 3 languages.  Then I posted
a "looking for translation" message to these newsgroups:
   news://pilot.programmer
   news://comp.sys.palmtops.pilot
A CSPP reader also suggested I try
   news://fr.comp.sys.palm-pilot

   It didn't take long before I had 3 offers to translate the strings
into French (I had already worked out the German and Spanish versions).
   Also, if you can find a translator who is already familiar with
your software it's a great advantage.

   (I'm of course assuming that the developer isn't bilingual; but if
you are you've probably thought about localization issues all along.)

   9.  Everything was done, so I posted "Grouper en fran�ais" to
PilotGear.  "Grouper ein deutsch" and "Grouper en espanol" (if I've
translated that correctly) will follow shortly.
   If you're interested, the source code for this project and all this
translation stuff is available at
     http://ourworld.compuserve.com/homepages/mcdan/palm/Gr14Src.zip

Regards,
Daniel.




Reply via email to