Page 1 of 1

[SOLVED ]How to translate a save game date correctly?

Posted: Mon Apr 12, 2021 9:22 am
by facesit-inc
Hello,

I have a problem when translating strings that have a integrated parameter in them, for example:

# renpy/common/00action_file.rpy:26
old "{#weekday}Monday"
new "{#weekday}Понедельник"

The translated version doesn't show up, and it concerns all instances of translation strings that have { } brackets. All other translations seem to work fine. Am I missing something? Should I translate these parameters in some other file?

Currently, for example, save games in English show the date/time, and the Russian translation does not. It displays no text whatsoever.

Re: How to translate a save game date correctly?

Posted: Mon Apr 12, 2021 11:04 am
by Jackkel Dragon
Not sure if it's the case here, but one thing to keep in mind for translating strings with parameters is that the string only translates if the parameter exists in the line to be translated.

For instance, using the substitution you posted, I believe the results would be as follows:

"Monday night."
Monday night.

"{#weekday}Monday night."
Понедельник night.

I'm not familiar with the default code that creates timestamps for save files, though, so I'm not sure of what specifically may be wrong with the translation. I'd have assumed it would have the parameters, but maybe it doesn't...

Re: How to translate a save game date correctly?

Posted: Mon Apr 12, 2021 3:26 pm
by uncoded
Isn't the syntax as follows?

Code: Select all

old "[weekday!t]Monday"
new "[weekday!t]Понедельник"
As I understand the documentation, it seems the syntax you are using is meant to differentiate between labels that seems the same but for which translation can vary depending on the context they are used ...

Re: How to translate a save game date correctly?

Posted: Mon Apr 12, 2021 5:06 pm
by IrinaLazareva
facesit-inc wrote:
Mon Apr 12, 2021 9:22 am
Am I missing something? Should I translate these parameters in some other file?
Yes. I'm going to guess, that the solution of your problem not here.

Open the file screens.rpy ([yourproject]/game/tl/russian/screens.rpy)
Find the line:

Code: Select all

    old "{#file_time}%A, %B %d %Y, %H:%M"
    new ""
and replace

Code: Select all

    new "{#file_time}%A, %B %d %Y, %H:%M"

Re: How to translate a save game date correctly?

Posted: Tue Apr 13, 2021 7:57 am
by facesit-inc
Thank your all kindly for your answers, but this
IrinaLazareva wrote:
Mon Apr 12, 2021 5:06 pm

Open the file screens.rpy ([yourproject]/game/tl/russian/screens.rpy)
Find the line:

Code: Select all

    old "{#file_time}%A, %B %d %Y, %H:%M"
    new ""
and replace

Code: Select all

    new "{#file_time}%A, %B %d %Y, %H:%M"
actually worked.

It seems that having translated all date/time parameters, I missed the string, which was supposed to implement and show them.

Problem solved!