+1 vote
by (710 points)
I am unable to find the right string code.

l10nStrings.Title, l10nStrings.StoryTitle, l10nStrings.storyTitle, l10nStrings.labelstoryTitle...

Can they be localized or do I simply waste my time on something that can t be done?

1 Answer

+1 vote
by (68.6k points)
selected by
 
Best answer

There is no such property in the l10nStrings object.  If you don't see a property in that source file, then it doesn't exist—well, there are a few exceptions, but those are for dialogs.  The story title is handled either by the StoryTitle special passage, in Twine 1, or as part of the data chunk, in Twine 2.

You should never attempt to introduce any kind of dynamism directly into the story title.  SugarCube uses the story's title as part of its storage keys, so altering the story title during play can result in loss of player data.  That said, you can still achieve your goal of translating the visible title in the UI bar by using a different special passage—there are several in that space which are normally unused.

The following example builds on my answer to the Possible to do a language switch option with Twine 1.4 and Sugarcube? Q&A.  The StoryMenu bits should largely be self-explanatory, the title is handled by hiding the display element for StoryTitle and populating StoryBanner with your internationalized titles.

Example: (in Twee notation)

:: Title & Menu Stylesheet [stylesheet]
#story-banner {
	font-size: 162.5%;
	font-weight: bold;
	margin: 0;
}
#story-title {
	display: none;
}



:: StoryBanner [nobr]
<<switch setup.i18n.langs[settings.lang]>>
<<case "de">>Deutsche Story
<<case "en">>English Story
<<case "fr">>Français Story
<</switch>>



:: StoryMenu [nobr]
<<switch setup.i18n.langs[settings.lang]>>
<<case "de">>
[[Deutsche Menu 1 (passage based)|Menu 1]]
<<link "Deutsche Menu 2 (macro based)">>
	/* code */
<</link>>
<<case "en">>
[[English Menu 1 (passage based)|Menu 1]]
<<link "English Menu 2 (macro based)">>
	/* code */
<</link>>
<<case "fr">>
[[Français Menu 1 (passage based)|Menu 1]]
<<link "Français Menu 2 (macro based)">>
	/* code */
<</link>>
<</switch>>



:: Menu 1



:: Menu 1_de
Deutsche Menu 1



:: Menu 1_en
English Menu 1



:: Menu 1_fr
Français Menu 1



 

EDIT: I realize that the current situation with the story title is not ideal and could be improved, so that you don't have to resort to workarounds—like using StoryBanner.  It's something on my TODO list.

 

by (710 points)
This is amazing. I have no coding skills and I got no idea you could de so much with Twine. A huge thanks.
...