Quick/Auto saves page's labels ignore translation files

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
Alem
Regular
Posts: 38
Joined: Wed Mar 15, 2017 7:53 am
Contact:

Quick/Auto saves page's labels ignore translation files

#1 Post by Alem » Wed Mar 15, 2017 8:05 am

Hello, I have a bit of a problem with translating labels for auto and quick saves pages. Translation files work everywhere else (characters, menu options, save dates, etc), except for these two labels.

I found the strings under tl/screens.rpy and double-checked their updated values. I also tried to change the original names, generate new translation strings for them - didn't help at all. I see the fresh translation strings, fix them with the new language and still have English text in labels.

Is it a bug or am I doing something wrong?

Ren'Py version 6.99.12.4.2187 - updated to the last version after encountering this strange behavior. Tried to generate fresh translation strings after installing, but it didn't help.

Alem
Regular
Posts: 38
Joined: Wed Mar 15, 2017 7:53 am
Contact:

Re: Quick/Auto saves page's labels ignore translation files

#2 Post by Alem » Fri Mar 17, 2017 11:20 am

Double checked everything, still can’t find a solution for this. So, I just leave all the relevant info here in hopes, that someone will help me.

One more time, Ren’Py ignores part of the translation config. Apart from two labels (quick and auto save screens) everything else works fine. Characters, menu buttons, dates, options, etc. I think the problem is based on this line of code from screens.rpy (I’m about zero level in coding, so pardon me, if this is not the case):

Code: Select all

screen file_slots(title):
    default page_name_value = FilePageNameInputValue(pattern=_("Page {}"), auto=_("Automatic saves"), quick=_("Quick saves"))
All three values are marked for translation and they could be found inside game/tl/language/screens.rpy. After translating all of them, I started the project to see how the new text looks. Pages label counter for regular saves was correctly translated and showed the new value. Quick and auto saves (accessed by clicking Q and A in the load/save menu) still held their original values.

I checked the screens.rpy inside the tl folder and found the untranslated bits inside:

Code: Select all

    # screens.rpy:597
    old "Automatic saves"
    new "X"

    # screens.rpy:597
    old "Quick saves"
    new "Y"
Tried different combinations of translations for these strings: shorter versions, longer versions, 1 word, 2 words, numbers. In all of these cases, the config was ignored and the game displayed default English values. I tried changing up the default name of the label inside the original screens.rpy (accessed directly from the Ren’Py launcher) and generating strings for it, like this:

Code: Select all

    # screens.rpy:597
    old "Auto saves"
    new "X"
The default label changed to a new value (from Automatic saves to Auto saves), but the translation is not displayed after switching the language. I use the standard language buttons from Lemma how-to’s:

Code: Select all

label _("Language")
                    hbox:   
                        textbutton "English" action Language(None)
                        textbutton "Test" action Language("test")
Aside from this snippet, I changed the color of in-game choice’s menu. Doubt it has any effect on the translation. All other changes were strictly for the script.rpy – the dialogues and so on.

Any thoughts? I’ve hit a brick wall and I can’t figure out a workaround :<

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1883
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Quick/Auto saves page's labels ignore translation files

#3 Post by Ocelot » Fri Mar 17, 2017 11:42 am

Please, show translate statements before those lines. It should be something like translate strings
< < insert Rick Cook quote here > >

Alem
Regular
Posts: 38
Joined: Wed Mar 15, 2017 7:53 am
Contact:

Re: Quick/Auto saves page's labels ignore translation files

#4 Post by Alem » Fri Mar 17, 2017 2:13 pm

Ocelot wrote:Please, show translate statements before those lines. It should be something like translate strings
Here's the full segment with my last try to translate. If you require full screens.rpy from the second language - I'll send it via attachment. Don't mind the "russian" instead of test, I switched the second language during the translation progress, and it's listed as russian both in Ren'Py config and translation folder.

Code: Select all

# TODO: Translation updated at 2017-03-15 13:50

translate russian strings:

    # screens.rpy:597
    old "Auto saves"
    new "Авто сохранения"

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: Quick/Auto saves page's labels ignore translation files

#5 Post by IrinaLazareva » Fri Mar 17, 2017 2:25 pm

I am not sure that it is...correct solution. But it seems works.

Code: Select all

translate russian python:
    config.translations['Automatic saves'] = u'Автоматические сохранения'    
    config.translations['Quick saves'] = u'Быстрые сохранения'
translate None python:
    config.translations['Automatic saves'] = 'Automatic saves'    
    config.translations['Quick saves'] = 'Quick saves'

Alem
Regular
Posts: 38
Joined: Wed Mar 15, 2017 7:53 am
Contact:

Re: Quick/Auto saves page's labels ignore translation files

#6 Post by Alem » Fri Mar 17, 2017 3:39 pm

IrinaLazareva wrote:I am not sure that it is...correct solution. But it seems works.

Code: Select all

translate russian python:
    config.translations['Automatic saves'] = u'Автоматические сохранения'    
    config.translations['Quick saves'] = u'Быстрые сохранения'
translate None python:
    config.translations['Automatic saves'] = 'Automatic saves'    
    config.translations['Quick saves'] = 'Quick saves'
Thank you very much! I don't really care about the "correct" coding as long as it works for me :>

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], span4ev