Translation issue

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
ebi-hime
Veteran
Posts: 382
Joined: Sat Aug 24, 2013 8:18 pm
Completed: The Way We All Go, Asphyxia, Strawberry Vinegar, etc
Tumblr: ebi-hime
itch: ebihime
Contact:

Translation issue

#1 Post by ebi-hime » Wed Nov 13, 2019 3:38 pm

Hi,

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.")),
                        FileSaveName(number))

    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.
I have a lot of free & commercial VNs available on Steam here if you want to check them out! ☆

philat
Eileen-Class Veteran
Posts: 1654
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Translation issue

#2 Post by philat » Thu Nov 14, 2019 2:21 am

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

                    button:
                        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.

User avatar
ebi-hime
Veteran
Posts: 382
Joined: Sat Aug 24, 2013 8:18 pm
Completed: The Way We All Go, Asphyxia, Strawberry Vinegar, etc
Tumblr: ebi-hime
itch: ebihime
Contact:

Re: Translation issue

#3 Post by ebi-hime » Thu Nov 14, 2019 2:36 pm

@ 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.
I have a lot of free & commercial VNs available on Steam here if you want to check them out! ☆

Post Reply

Who is online

Users browsing this forum: deltadidirac, Google [Bot]