Command Localisation

Home Features Release Notes Localisation

You can swap the set of English commands that come with ACSLogo for a set in your chosen language. This has always been done for French and German. When it's been done, the user has to choose that commands are translated using the Localisation pane in preferences:

Checking the switch will turn on localised commands if they exist (of course, the preferences panel will appear in the current language).

You can see the full list of commands that need to be translated and their equivalents in French and German in the command table.

Localising the commands involves creating a list of commands translated from the English ones. This creates a command mapping:

Each translated command maps to a single English command. More than one translated command can map to a particular English command as shown for AVANCE and its shortened form AV (i.e. you can have synonyms). Note that, as for CHAR, the command can be the same in both languages — but you still have to specify the command.

Specifying the mapping is done in an XML file called commandmap.plist.


Have a look at the commandmap.plist file in French.lproj. You can open it in two ways — as a text file or with the Property List Editor found in /Developer/Applications/Utilities. If you double-click the file, you should get the Property List Editor:

You can see that the property list contains one object, which it calls the Root. The object is a dictionary, which is a set of unique keys, each with an associated value. In this case the dictionary has 240 entries. If you click on the disclosure triangle to the left of the Root, you will see the keys and their values:

The keys are on the left. the values are on the right. For the ACSLogo command map, the values will always be strings, but for other plists the values could be arrays or even other dictionaries. The keys relate to the translated (localised) commands, and the values are the original (English) commands. You can change any of the keys or values by double-clicking on them and editing the text. A new entry can be added to the dictionary by choosing New Sibling (you have to select one of the existing rows first).

As I suggested earlier, the file can be edited as a text file. To see what it looks like as text, hit the Dump button:

The bottom pane shows the XML structure of the file. You can edit the file in text form using Xcode or Project Builder. Whichever method you use, you need to make sure that you've got localised entries for all of the English commands or the command will not be accessible.

Once you've done that and saved the file, start the program and see if your commands work.

That’s it for command localisation. All that's left now is the documentation side — Tutorials and Help.