Resource Editor: 5.1 Translating Text: Translating Via an ASCII File

Up: GEOS SDK TechDocs | Up | Prev: 5 Translating Text | Next: 5.2 Translating With ResEdit

Choose Other from the File menu; in the submenu that appears, choose Export Document. In the dialog that appears, choose a file location and name for the ASCII Translation File (ATF).

If you have already gone through the translation process once, and only wish the ASCII Translation File to contain entries for those chunks which have been translated, select the Export only changed chunks box.

Press the OK button.

You may now edit the ASCII file to translate strings.

The important lines of the file are of the form:

[keyword   ] data

There should always be one space between the keyword and the data. The following keywords appear in the header:

[ source ]
This is the long name of the geode.
[ path ]
This is the geode's path, relative to the Source directory. Applications will typically be in the WORLD path.
[ version ]
The geode's version number.
[ DOS name ]
The geode's DOS filename.

The ASCII Translation File then lists all resources in the geode, by means of [resource ] lines and [endrsrc ] lines. Do not change the text of these lines. If, examining a resource, you realize it contains no chunk entries you wish to change, you may delete it to make it easier to find the resources you do wish to change. To do so, delete the [resource ] line, the [endrsrc ] line, and all lines in between.

Within each resource, there may be one or more chunks containing localizable strings. For each such chunk, there will be five lines:

[chunk     ] chunkname
[original  ] {original text}
[localize  ] {instructions} max, min, type
[translate ] {translated text}
[mnemonic  ] mnemonic [shortcut  ] mods,shortcut

You will leave most of these fields alone, translating only the translated text , mnemonic , mods , and shortcut fields.

chunkname
The chunkname is a unique identifier for the chunk. Do not change this.
original text
The original text in the chunk. Do not change this. The text is delimited by curly braces ("{" and "}"). If any curly braces occur in the string, they will be represented by two curly braces.
instructions
Instructions to the person translating. Do not change this. These instructions are taken from the original-language geode. The geode's programmers specified the instructions by means of the @localize keyword in the source code files.
max
Maximum number of characters you may use in the translated text. Do not change this. The geode's programmers specified this number by means of the @ localize keyword.
min
Minimum number of characters you may use in the translated text. Do not change this. The geode's programmers specified this number by means of the @localize keyword.
type
The text's purpose in the program. Do not change this. A Text Moniker is the visible name of a gadget. A piece of Text appears in the program, but not as the name of a gadget.
translated text
This is how the text will appear in the translated geode. You'll probably want to change this text. The text is delimited by curly braces. If you want the translated string to contain curly braces, you should double them--use "{{" and "}}". E.g., to have translated text "moustache: :-{)", the line would read
	[translate ] {moustache: :-{{)}
If the original text looks like a shortcut key (e.g., "{(Physical Ctrl u)}", then to translate the keyboard shortcut, work with mods and shortcut (described below) and leave this field alone.
mnemonic
This is the character the user will use when navigating the translated geode's UI with keyboard navigation. Only Text Monikers may have mnemonics. The mnemonic should be either a character which occurs in the moniker, the keyword ESC or the keyword NIL (which signals that there is no mnemonic).
You must be careful not to assign the same mnemonic to two monikers whose gadgets are both in the active window at the same time. If there is such a conflict, only one of the two gadgets will be activated by this mnemonic. When you have created the translated executable, you should check that there are no conflicting mnemonics, and change any which overlap with others at the same level.
mods , shortcut
Together, mods and shortcut form a keyboard shortcut which the user may use to activate a UI gadget in the translated geode. For instance, Ctrl-S typically activates the Save item of the File menu. This shortcut would be represented by
	[shortcut] PC,s 

If, for some reason, the question mark were to be a shortcut, it would be represented by

	[shortcut	] ,?

Only monikers may have shortcuts. The lack of shortcut is represented by

	[shortcut] ,

Be careful when representing the lack of a shortcut: the carriage return or line feed at the end of the line must occur immediately following the comma. If there is an intervening space, ResEdit will think you want to use the space bar as a shortcut key.

The following mods are available: A (Alt), S (Shift), C (Ctrl), and P ("Physical"--Num Lock and Caps Lock state is disregarded). These modifiers may be combined as in the Ctrl-S example.
The shortcut should be a single character. If this character is a letter, pay attention to its case--it should probably be a lower-case letter.

If you will not need to translate a chunk, you may delete its entry to make it easier to find the chunks you do wish to translate. Delete the [chunk ] line and the [shortcut ] line and all lines in between.

To convert your ASCII Translation File into a regular Translation File, use ResEdit to import the file: either press the Import button in the dialog that appears when ResEdit starts up, or choose New/Open from the File menu, and then choose Import in the dialog that appears. In the dialog that appears, show ResEdit the location of both the ASCII Translation File and the Localization (.vm) File.

Press the OK button.

If your original-language geode has changed since the ASCII Translation File was created, ResEdit may present a warning dialog box at this point. Assuming the geode hasn't changed too much, it's probably safe to use the ASCII Translation File anyway. If you're hesitant, you can abort the import. You might then want to export another ASCII Translation File from the newer version of the geode.


Up: GEOS SDK TechDocs | Up | Prev: 5 Translating Text | Next: 5.2 Translating With ResEdit