Page 1 of 1

Translation issue

Posted: Wed Nov 13, 2019 3:38 pm
by ebi-hime

I've been working w/ Ren'py for a while, and a few of my VNs have been translated into other languages. The translation process is generally simple, but there's one consistent issue I've run into over the last year or so.
I can translate all the English strings in my scripts except for the 'Empty Slot.' string that shows up in the save/load menu. I've never been able to translate this string, across about 4-5 different projects and about 2 years.

Here's a snippet of the save/load code from my current project (where the 'Empty Slot.' text is defined:

Code: Select all

screen load_save_slot:

    $ file_text = "%2s. %s\n  %s" % (
                        FileSlotName(number, 6),
                        FileTime(number, empty=_("Empty Slot.")),

    add FileScreenshot(number) xpos 20 ypos 24
    text file_text xpos 120 ypos 230 size 20 color "#9c95a0"
And here's the corresponding screens.rpy translation file:

Code: Select all

translate german strings:

    # game/screens.rpy:262
    old "Empty Slot."
    new "Leer."
The 'Empty Slot.' text has been extracted as a viable translation string by Ren'py itself, and it's been translated, but the 'Empty Slot.' text still displays in English. All the other menu text displays in German like it should (including all the other text in the save/load menu).
Here's a screenshot of the issue.

Has anybody run into this before, and does anybody know what the problem might be? Thank you.

Re: Translation issue

Posted: Thu Nov 14, 2019 2:21 am
by philat
Storing the thing in file_text seems to be the issue, as it works fine if accessed directly (see the following from a clean new project in latest renpy):

Code: Select all

 # ignoring other stuff
                for i in range(gui.file_slot_cols * gui.file_slot_rows):

                    $ slot = i + 1

                        action FileAction(slot)

                        has vbox

                        add FileScreenshot(slot) xalign 0.5

                        text FileTime(slot, format=_("{#file_time}%A, %B %d %Y, %H:%M"), empty=_("empty slot")): ## this "empty slot" is correctly translated. using an interim variable file_text causes translation to break
                            style "slot_time_text" 

                        text FileSaveName(slot):
                            style "slot_name_text"

                        key "save_delete" action FileDelete(slot)
Not knowledgeable enough to offer why that's the case, but in any case it doesn't seem like it would be particularly difficult to just access it directly.

Re: Translation issue

Posted: Thu Nov 14, 2019 2:36 pm
by ebi-hime
@ pilat
Thanks for the reply. You're right, it was defining the text as $ file_text that was the issue. By rewriting the code somewhat, I was able to translate the 'Empty Slot.', but doing so broke some of the existing save/load code (it stopped numbering the save/load slots).
I could probably fix it with a bit more tinkering, but I don't want to rewrite the whole save/load code for such a minor issue. I'll probably leave it the way it is, with the untranslated string. Thanks for the help, though.