There are many extensions for Inform 7 which contain only a very small amount of player-visible text. For example, Emily Short’s Basic Screen Effects contains the single line “Please press SPACE to continue.”; the total prose in Jon Ingold’s Title Page is “Display help menu / Start the story - from the beginning / - from a saved position / Quit”; and Mark Tilford’s Simple Chat has only “(or 0 to say nothing)”.
Translating such an extension to another language is little work, and several of these translations can be found on the Inform 7 website. The translators have had to choose between two different possibilities:
- Making a new extension that is a copy of the extension to be translated, with the text changed. (Example: Effetti Visivi di Base)
- “Include”-ing the extension to be translated, and using “in place of” headings to replace those parts of the original that contain prose. (Example: German Basic Screen Effects)
Neither of these possibilities is ideal. The former option evidently leads to maintenance hell, as an extension with N translations needs to be updated by N translators every time a bug is fixed – even when the prose in the extension is not changed at all. The latter option may seem better, but in order to ensure compatibility between the translating extension and the original extension, the translating extension should ask for a specific version of the original extension (“Include version X of …”). This also leads to a minor maintenance hell, since a new version of the original extension requires an (albeit trivial) update of all the translating extensions.
With this rationale in mind, I tried to think of a more elegant solution, and I came up with the following extension:
[code]Multiple Language Framework by Victor Gijsbers begins here.
MLF-language is a kind of value. The MLF-languages are English, English US, French, German, Italian, Spanish, Russian and Dutch.
Game language is an MLF-language that varies. [Defaults to English.]
Multiple Language Framework ends here.[/code]
To use, the end user includes this extension and defines the language of his game with something like:
Game language is French.
Obviously, this extension does nothing by itself, but it does allow other extensions to non-invasively incorporate translations of themselves. Here is an example of an extension that would support multiple languages:
[code]MLF Test by Victor Gijsbers begins here.
Section - Code
Instead of singing:
say “[Happy song]”.
Section - Standard text (for use without Multiple Language Framework by Victor Gijsbers)
To say happy song:
say “You sing a happy song.”.
Section - MLF text (for use with Multiple Language Framework by Victor Gijsbers)
To say happy song:
if the game language is:
– English:
say “You sing a happy song.”;
– English US:
say “You sing a happy song.”;
– French:
say “Tu chantes une chanson heureuse.”;
– German:
say “Du singst ein heiteres Lied.”;
– Dutch:
say “Je zingt een vrolijk lied.”.
When play begins (this is the MLF Test language check rule):
unless game language is English or game language is English US or game language is French or game language is German or game language is Dutch:
say “The language you have chosen is [bold type]not supported[roman type] by the MLF Test extension. You can disable this warning with the line: ‘The MLF Test language check rule is not listed in any rulebook.’”.
MLF Test ends here.[/code]
As you can see, if Multiple Language Framework is not included by the game, it is just a normal extension. So there are no extra dependencies, and people who are not interested in other languages will notice no change. But if Multiple Language Framework is included by the game, the translations kick in. (Both the main “to say” rule and the “when play begins rule” – which is non-essential but nice to include – follow a standard format, and can be easily copy-pasted from example code that would be in the Multiple Language Framework documentation.)
An extension using MLF can be easily updated by the original author, without needing any further work by the translators. (Unless the prose of the extension changes, of course, but in that case you will always need further work by the translators.) There do not need to be multiple versions, and there can be no compatibility issues. Even adding further languages to the MLF extension would create no problems. So to me this seems to be a fairly elegant solution to the problem of translating minimal-prose-extensions without increasing the difficulty of supporting those extensions.
What do you think?