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:
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:
Is there are any way of translating the English strings for the $ save_name text?
Translating save names [solved]
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.
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.
- 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]
Last edited by ebi-hime on Thu Dec 21, 2017 3:29 pm, edited 1 time in total.
- 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
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)
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:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
- 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
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!
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.
- Ocelot
- Lemma-Class Veteran
- Posts: 2384
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Translating save names
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?
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 > >
- 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]
Glad you got it working ... Just do not ask for an explanation of why it works
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
- 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]
Yes, sometimes I'm glad something works, even if I can't understand how it works.
viewtopic.php?f=8&t=46032
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)
TOIRE NO HANAKO (A Story About Fear)
Who is online
Users browsing this forum: Google [Bot]