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: 363
Joined: Sat Aug 24, 2013 8:18 pm
Completed: The Way We All Go, Asphyxia, Strawberry Vinegar, etc
Tumblr: ebi-hime
Location: UK~
Contact:

Translating save names [solved]

#1 Post by ebi-hime » Thu Dec 21, 2017 3:17 am

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 commercial VNs available on Steam here if you wanna check! u///u
With a yandere dating sim, a moemoe moege about cute grills and food, a sad GxG story, a sad GxB story, there should be something for everyone <3

/ shameless plugging

User avatar
Remix
Miko-Class Veteran
Posts: 993
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 » Thu Dec 21, 2017 8:08 am

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)
Mad Scientist Todo List:
  • Finish Improved Event Handler
  • Implement DragonBones animation as a Creator Defined Container
  • Finish Catmull-Rom Spline pathing
  • Finish Bitmask collision and rebound vector system
  • Develop time based building mechanic
  • Others
  • *Find a superb artist and actually write a game*

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

Re: Translating save names

#3 Post by ebi-hime » Thu Dec 21, 2017 2:53 pm

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 commercial VNs available on Steam here if you wanna check! u///u
With a yandere dating sim, a moemoe moege about cute grills and food, a sad GxG story, a sad GxB story, there should be something for everyone <3

/ shameless plugging

User avatar
Ocelot
Miko-Class Veteran
Posts: 849
Joined: Tue Aug 23, 2016 10:35 am
Skype: miinipaa
Contact:

Re: Translating save names

#4 Post by Ocelot » Thu Dec 21, 2017 3:01 pm

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
Miko-Class Veteran
Posts: 993
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 » Thu Dec 21, 2017 5:14 pm

Glad you got it working :) ... Just do not ask for an explanation of why it works ;)
Mad Scientist Todo List:
  • Finish Improved Event Handler
  • Implement DragonBones animation as a Creator Defined Container
  • Finish Catmull-Rom Spline pathing
  • Finish Bitmask collision and rebound vector system
  • Develop time based building mechanic
  • Others
  • *Find a superb artist and actually write a game*

User avatar
Donmai
Eileen-Class Veteran
Posts: 1768
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
Projects: Slumberland
Location: Brazil
Contact:

Re: Translating save names [solved]

#6 Post by Donmai » Fri Dec 22, 2017 9:35 am

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: No registered users