If i want my story to be playable in diverse languages, is there any way of "extracting" the text from the story in order to translate it to languages other than english ?
What i am thinking of would be something like the properties files in java web applications.
About Inform Created in April 2006, it was open-sourced in April 2022.
Inform 7 is a free, open-source tool for creating text-based interactive fiction (IF).
Not really. The Inform 7 compiler does some of this itself: when it translates the code to Inform 6, it pulls out all the string literals as Constant
directives in the generated code. But editing the generated code is just asking for trouble unless you're 100% sure that the game is finished and will never be edited in I7 again.
You could try internationalizing the game manually by moving all the string literals to substitution phrases. So instead of:
Home is a room. "This is your house."
You'd have:
Home is a room. "[home description]".
To say home description: say "This is your house."
Then you can put all those "to say" definitions in an extension, and localize the game by creating translated versions of the extension.
However, these substitutions only work for output. To internationalize text that's matched against player input -- such as object names, topics, and verb grammar -- you'll need to move the relevant definitions and rules into the extension.
For example, for an object name:
[in the main game code]
The widget is a thing. It is privately-named.
[in the English extension]
Understand "widget" as the widget.
Note the use of "privately-named" to stop Inform from using the object's source code name when matching player input, since you don't want the English name to match in the translated game.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With