Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

It's possible i18n with Inform 7

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.

like image 601
Vicente Avatar asked Mar 09 '11 15:03

Vicente


People also ask

Is Inform 7 open source?

About Inform Created in April 2006, it was open-sourced in April 2022.

What is inform7?

Inform 7 is a free, open-source tool for creating text-based interactive fiction (IF).


1 Answers

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.

like image 80
Jesse McGrew Avatar answered Sep 24 '22 21:09

Jesse McGrew