Delores: Italian translation

Yesterday I played around a bit with the engine and decided to start the Italian translation.

But since I’m a programmer, I didn’t want to just translate the .tsv file and plug it in, so I also tried to make the language selection extensible.

As shown in Just released adventure games I could add a new “slider” to the options screen that changes the language value.

First thing I did was creating a setting object in Settings.dinky under player options, which defaults to “en” if not present

SETTING(language) <- getSetting(“language”,“en”)

And enabling save in onRefreshPrefs() so you don’t have to change it every time you start the game :smiley:

setUserPrefs(“language”,SETTING(language))

And in Boot.dinky, instead of just uncommenting useTranslation(“en”), I rewrote it as useTranslation(SETTING(language)).

The selection was a bit trickier. I used the same sliders Options.dinky has for volume and text speed, hard-binding integers to the languages I had available. I’d like to make it dynamic for more languages, but for now it’s fine. The slider has an integer value where 0 is assigned to a string “en” and 1 to “it”, and circular value reset (if v < 0 goes back to 1).

line += 1
makeSlider(point(0, linePos(line)), "", 185, 1.0, 0.0, @(inc_dec){
 local s = SETTING(language)
 local v = 0
 if (s == "en" ) v = 0 else
 if (s == "it" ) v = 1 

 if (inc_dec < 0) v -= 1
 if (inc_dec > 0) v += 1

 if (v < 0) v = 1
 if (v > 1) v = 0

 local p = "en"
 if (v == 0) { p = "en" }
 if (v == 1) { p = "it" }

 SETTING(language) <- p
 useTranslation(p);
 onRefreshPrefs()

 local langname = TR(TEXT(10000,"English"))
 return format(TR(TEXT(12355,"Language: %s")),langname)
})

Then language turned out to be Engish (sic), because there’s a typo in the translation file.

While doing so I also noticed that the text speeds are hardcoded (i.e., untranslatable).
So I added new text entries to the .tsv values and encapsulated them with TR() calls.

if (v == 7) { t = TR(TEXT(12356,“slowest”)); p = 2.0 }
if (v == 6) { t = TR(TEXT(12357,“slower”)); p = 1.5 }
if (v == 5) { t = TR(TEXT(12358,“slow”)); p = 1.25 }
if (v == 4) { t = TR(TEXT(12359,“normal”)); p = 1.0 }
if (v == 3) { t = TR(TEXT(12360,“fast”)); p = 0.75 }
if (v == 2) { t = TR(TEXT(12361,“faster”)); p = 0.5 }
if (v == 1) { t = TR(TEXT(12362,“fastest”)); p = 0.25 }

The only thing I didn’t manage was changing the whole UI on the fly when changing language. But if you close the options and turn them on again, or change the text speed, you’ll get that sweet sweet Italian text you’re craving for.

I could also change the spritesheet for the title cards room, creating a new texture for the Italian title text and show it dynamically if the current language is “it”.

I created a new room object, but now that I think of it, I could have extended the pre-existing object adding a new state. I’ll probably change that later. I want to do the same work for all image texts.

8 Likes

A lot of time to change the text on the start page.

And then I noticed I didn’t save the right part. So now I have to change it again :stuck_out_tongue: whoa

5 Likes

image

The Quickie Pal already had the Italian images, so it was easy here. I also found a more elegant way of changing the language dependent objects.

I manually edited the .wimpy files (I find it quicker than understanding Wimpy for such small tasks) to add the frames and added a _en and _it suffix to the states:

{
    name: "on_en"
    frames: [
        "front_signs_neon_text_en"
    ]
}
{
    name: "on_it"
    frames: [
        "front_signs_neon_text_it"
    ]
}

Then, in the code where it calls objectState(openSign, “on”) I changed to objectState(openSign, “on_”+SETTING(language)).

But that creates a problem. If I change language while on the room, the flashing sign changes to the current language (which is cool) but the background, unlit sign stays the same. In TWP, the graphics don’t change on the fly, so now I save the language at room enter with local onState = “on_”+SETTING(language) and then change the state to onState in the script.

I think this is the last room with translated images. The newspapers in the Nickel News have actual text.

A tip for those who want to translate to other languages: in the debugger, call openDebugOptions() and check the “translation markers”. It adds an asterisk in front of the text that can be translated.

That’s helpful, especially because if you see text that has no asterisk, it means that you have to wrap it in TR() and create a new text entry if you want to translate it.

2 Likes

The TWP engine would automatically see images with _en, _de, etc and use them as the languages changed. All the code is still in there, but I didn’t expose a way to set the language at the system level.

If you changed language in TWP, none of the art would change until you left the room. Also, the language change would not take effect until you left the Options. This is so if someone is skipping through languages, the option text don’t immediately change, leaving them potentially lost with everything in Chinese.

4 Likes

@ZakPhoenixMcKracken will be helping me in translating the lines. I’ll focus on adapting the script where needed (e.g. we need to add diacritics in the speech font), but if enough people collaborate to the file (@ema? @gffp? @seguso?) we’ll have a full Italian version very soon :smiley:

1 Like

If you explain to me what to do like I’m a monkey, I’ll see what I can do…

Just stop playing piano, freeze and wait …

btw: Great work @Guga and @ZakPhoenixMcKracken! :smiley:

1 Like

In Delores there are 1/10 of the Thimbleweed Park lines.
I’m confident we’ll translate the text lines soon, furthermore @Guga will replace the text in the graphics.

2 Likes

If I have time I’ll do an Italian version of other signs, like Willie’s shop.

1 Like

As soon as I can download the game from GOG, I’ll try to find a way to solve the compatibility issues (maybe on a different machine) and play the game. Then I will be able to help you out with the translation. Otherwise I could misinterpret some dialogue lines :slightly_smiling_face:

3 Likes

We’re already halfway there (woo ooooh livin’ on a prayer :musical_note:). We’ll probably finish by this weekend if we keep on like that :stuck_out_tongue: so take your time.

2 Likes

If you’re going to translate the graphics and want them to make it into a shipping version of the game you MUST put them into the .psd file and they MUST be named correctly. I am going to release a new build of the engine to properly deals with graphics. For the shipping game all the .png files are automatically exported from the .psd file, so if you have loose .png they will get deleted. More info when I post the new engine build.

3 Likes

Good, thanks. By now we’ll just work with extra .png files, then we can clean it up for a shippable version once we’re done.

@RonGilbert I think I found something wrong.

File Vista.Dinky, row 114.
sayLine(SAY(11691,“It’s nice to see the factory ramping up again to make PillowBears™.”, ONCE(SAY(0,“Looks like Dad is working late again.”))))

The parentheses are wrong. There should be a closing parenthesis after PillowBears. Instead, ONCE blah blah gets passed as a parameter to the first SAY.

In fact, not only “Looks like Dad” is never said in the DeloresDev (while it is in the Steam version), but the .tsv files have this entry:

11691 It’s nice to see the factory ramping up again to make PillowBears™.", ONCE(SAY(0,"Looks like Dad is working late again.

And there’s no text entry/ID for “Looks like Dad” etc etc.

Shall I fix it and send you a pull request, or given that it should create a new text entry and so on you’d rather not have it added by hand? I don’t know how the text stripping works on your toolchain.

1 Like

That’s a text wrapping issue. I need to fix it by hand so a new text id is created. Thanks.

If the ID is going to be 1+the last number of the .tsv, then I can send you my pull, I tested right now and it works

Already fixed. :slight_smile:

Aww snap, I wanted to leave my mark on the repo :stuck_out_tongue: ok, I can keep on translating then.

I have no idea how to deal with pull requests, so I probably would have screwed up anyway. :frowning:

Well, I was late in creating one because I was googling “difference between fork clone and branch” :laughing: I use git for myself but basically never used it in collaborative projects, so… well, I totally understand.