Version 1.0 Post Mortem


With the German translation finally implemented and uploaded, I'll be putting the mortem in this post (ha ha ha...).

Introduction

This was my first time working with translation files, and I can't thank arty enough for being patient with me as I continued programming the game during NaNoRenO 2020+. Ren'Py, primarily being a Visual Novel engine, attempts to make translation as streamlined as possible. For most intents and purposes, it conveniently splits up each line of dialogue into its original language behind a comment for reference, and a new string for the corresponding translation.

translate german start_8fc1e793:
    # nar_nvl "Then one night, I decided to take a walk around the nearby forest."
    nar_nvl "Eines Nachts beschloss ich, einen Spaziergang in den naheliegenden Wald zu machen."

This makes it easy for translators to keep track of which line they're working on.

As far as non-dialogue strings such as menu labels and buttons, this is what that typically looks like:

    old "Advances dialogue without selecting choices."
    new "Setzt Dialog fort, ohne Entscheidungen zu treffen."

What Went Wrong

Of course, I wouldn't write a whole post like this just to say that things went smoothly. No. Things went very wrong.

You see, I hadn't anticipated some of the translated words to be so long, and also completely forgot that some of the "images" in the game were text displayables.

image discretion = Text("{size=90}{color=#fff}Please be mindful of the following content:\n\nMentions of Suicide Attempts\nParental Violence\nTransphobia\n\nPlayer's discretion is advised.{/color}{/size}", text_align=0.5)

Ren'Py didn't pick up on these text strings at all, because they're images (which are actually just text). Asking arty to do these lines was simple enough, but the problem came with implementing them back into the game with the correct variable to reflect the language selection the player made. I could have simply changed them back into dialogue strings for the splashscreen, but then players would have to click to advance to the next line of dialogue.

        show lang_select:
            xalign 0.5
            yalign 0.08
        menu:
            "English":
                $ renpy.change_language(None, force=True)
            "Deutsch":
                $ renpy.change_language("german", force=True)
        hide lang_select

After the player selects their language, the splashscreen proceeds to the next setting.

        show sound_cap_g:
            xalign 0.5
            yalign 0.15
    # Do you want audio captions on? They describe music in text.
        menu:
            "On":
                $ persistent.sound_captions = True
            "Off":
                pass

Remember, this was my first time working with two languages, so I wasn't sure how to make Ren'Py remember whether the player selected English or German.

My first thought was to add a $ persistent.language = "german" to the Deutsch choice. This worked! ... Until I got to the menus, where I turned the language from German back to English to test things out.

        if persistent.language == "german":
            textbutton _("Erinnerungen") action ShowMenu("replay_gallery") xoffset 70
        else:
            textbutton _("Memories") action ShowMenu("replay_gallery") xoffset 125

The button would still read "Erinnerugen" despite the rest of the game having been translated back into English. This was when I realized that  $ renpy.change_language wasn't tying it to any existing variable; I accidentally made a completely new variable that was only available if the player chose Deutsch the first time they opened the game.

So I changed it to config.language, as I had read in the documentation.

If config.language is set, that language is used.

I probably should have read further, because while config.language seemed to work for the menus in the user interface, it was no longer working with the splashscreen...

The Headache

I had already done a lot of work adjusting screens to accommodate for some longer words. The GUI I did for Distortion Nation is pretty stylized in that the titles and a lot of buttons are tilted at an angle, which while very cool, was a pain to align the first time in English.

screen preferences():
    tag menu
    use game_menu(_(""), scroll="viewport"):
     ## Contents of the preferences screen
    label _("PREFERENCES") at titletilt:
        text_size 200
        xpos 250
        ypos -230
        text_outlines [ (absolute(4), "#000", absolute(0), absolute(0)) ]
        text_font "gui/fonts/ASTONISHED.ttf"
transform titletilt:
    rotate -3

For those familiar with Ren'Py, you'll notice that the string after game_menu is empty. Usually this is where the title of the screen goes so players know where they're at. They're not strictly necessary however, in case you wanted to use an image in place of it. In my case, I needed to make the titles tilted at an angle to fit better with the bandages in the navigation bar. Some of the screens with shorter names were fine using the default position, but ones with more characters in them would often appear above or below the bandage.

So keep all this in mind. Suddenly I need to do it again for German.

    old "Dev Notes"
    new "Entwicklernotizen"

This wasn't really gonna fly.

A Solution...?

As mentioned before, config.language wasn't the correct variable to check for when applying the translation. It was only after two hours of work that I noticed preferences.language was what I was looking for.

There are two language-related variables. One is config.language, which is used to change the default language of the game.
_preferences.language
The name of the current language, or None if the default language is being used. This should be treated as a read-only variable. To change the language, call renpy.change_language().

Because of course that's near the bottom of the page.

This is what I had working before.

    if config.language == "german":
        label _("OPTIONEN") at titletilt:
            text_size 200
            xpos 250
            ypos -100
            text_outlines [ (absolute(4), "#000", absolute(0), absolute(0)) ]
            text_font "gui/fonts/ASTONISHED.ttf"
    else:
        label _("PREFERENCES") at titletilt:
            text_size 200
            xpos 250
            ypos -230
            text_outlines [ (absolute(4), "#000", absolute(0), absolute(0)) ]
            text_font "gui/fonts/ASTONISHED.ttf"

Suddenly, the splashscreen worked but the menus stopped when I changed everything to preferences.language. Or maybe it didn't stop working and I'm just bad at keeping track of script changes, which is highly likely. In either case, I was already exhausted enough and needed to bruteforce something.

With the German translation now working properly, I went to those translation files directly to mess around with the new lines.

    old "PREFERENCES"
    new " {vspace=0}OPTIONEN{vspace=1} "

That's hideous, but it served its purpose.

    old "DEV NOTES"
    new "ENTWICKLERNOTIZEN\n\n\n\n\n"

Please don't ask me how or why this works, I don't know either and I'm tired of looking at it.

In Conclusion

I am very tired and gay and I'd like my cuddles with the moth gf. Thanks for coming to my TED Talk.

The Android version of the game will be in testing soon.

Files

DistortionNation-1.0-win.zip 60 MB
Apr 21, 2020
DistortionNation-1.0-mac.zip 59 MB
Apr 21, 2020
DistortionNation-1.0-linux.tar.bz2 65 MB
Apr 21, 2020

Get Distortion Nation

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.