Translating save names [solved]

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: 401
Joined: Sat Aug 24, 2013 8:18 pm
Completed: Asphyxia, Blackberry Honey, The Language of Love, etc
Tumblr: ebi-hime
itch: ebihime
Contact:

Translating save names [solved]

#1 Post by ebi-hime »

I've been working on a translation for one of my VNs, and I've been having some problems.
I defined save names that appear in the game's save slot when the player saves at certain points, and defined them in English like this:

$ save_name = ("{font=crim.ttf}{size=-4}Prologue:{vspace=1} Bell{/font}{/size}")

Which display like this:

Image

I wanted to translate these save names, so I redefined them like this:

$ save_name = (_("{font=crim.ttf}{size=-4}Prologue:{vspace=1} Bell{/font}{/size}"))

Which made the text that needs to be translated appear in the script.rpy translation file, like they should. However, even after these strings have been translated, the English version still shows in the TLed version, not the translation, like this:

Image

Is there are any way of translating the English strings for the $ save_name text?
Last edited by ebi-hime on Thu Dec 21, 2017 3:29 pm, edited 1 time in total.
I have a lot of free & commercial VNs available on Steam and itchio.io if you want to check them out! ☆

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Translating save names

#2 Post by Remix »

Though I do not have a TL based game to experiment on, a couple of possible options to test:

Maybe move the string outside of the set/tuple:
$ save_name_text = _("{font=crim.ttf}{size=-4}Prologue:{vspace=1} Bell{/font}{/size}")
$ save_name = ( save_name_text )

Maybe directly call renpy.substitute on the string:
$ save_name = ( renpy.substitute( __("..."), translate=True ) )

Double underscore function... __(s) ... should be easiest to test ;)
$ save_name = ( __( "{font=crim.ttf}{size=-4}Prologue:{vspace=1} Bell{/font}{/size}" ) )

If any work, could you let us know (to help others in future)
Frameworks & Scriptlets:

User avatar
ebi-hime
Veteran
Posts: 401
Joined: Sat Aug 24, 2013 8:18 pm
Completed: Asphyxia, Blackberry Honey, The Language of Love, etc
Tumblr: ebi-hime
itch: ebihime
Contact:

Re: Translating save names

#3 Post by ebi-hime »

Thank you for replying, but none of these workarounds helped. They didn't produce any error messages, but the save names remained in English even in the translated version.

I was looking around and haven't seen anybody else ask this question, so I'm beginning to think it might not be possible in Ren'py to translate the $save_name text string :/

edit: nvm, the third method you gave (doing the double underscore) seems to have worked. Thank you!
Last edited by ebi-hime on Thu Dec 21, 2017 3:09 pm, edited 1 time in total.
I have a lot of free & commercial VNs available on Steam and itchio.io if you want to check them out! ☆

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

Re: Translating save names

#4 Post by Ocelot »

I take it, that strings are saved within save file itself.

In this case, you should not translate strings which go into save file (do not translate save_name variable, or names for slots in load screen would be in whatever language you have saved particular file). You should thranslate them after you retrieve them for display (by code in your load screen).

Can you post load screen code here?
< < insert Rick Cook quote here > >

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Translating save names [solved]

#5 Post by Remix »

Glad you got it working :) ... Just do not ask for an explanation of why it works ;)
Frameworks & Scriptlets:

User avatar
Donmai
Eileen-Class Veteran
Posts: 1958
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Translating save names [solved]

#6 Post by Donmai »

Remix wrote: Thu Dec 21, 2017 5:14 pm Just do not ask for an explanation of why it works
Yes, sometimes I'm glad something works, even if I can't understand how it works.
viewtopic.php?f=8&t=46032
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Post Reply

Who is online

Users browsing this forum: Google [Bot]