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

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
facesit-inc
Newbie
Posts: 23
Joined: Wed Dec 09, 2020 4:04 pm
Contact:

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

#1 Post 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.
Last edited by facesit-inc on Tue Apr 13, 2021 7:58 am, edited 1 time in total.

User avatar
Jackkel Dragon
Veteran
Posts: 283
Joined: Mon Mar 31, 2014 7:17 pm
Organization: Nightshade, Team Despair
itch: jackkel-dragon
Location: USA
Contact:

Re: How to translate a save game date correctly?

#2 Post 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...
Main Website
Includes information about and links to many of my current and past projects.

Major Game Projects
[Nightshade] Eldritch Academy, Eldritch University, Blooming Nightshade, Flowering Nightshade, Life as Designed
[Team Despair] Corpse Party D2 series

uncoded
Regular
Posts: 27
Joined: Fri Apr 09, 2021 10:29 am
Contact:

Re: How to translate a save game date correctly?

#3 Post 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 ...
🐾

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

Re: How to translate a save game date correctly?

#4 Post 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"

facesit-inc
Newbie
Posts: 23
Joined: Wed Dec 09, 2020 4:04 pm
Contact:

Re: How to translate a save game date correctly?

#5 Post 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!

Post Reply

Who is online

Users browsing this forum: Google [Bot]