Page 1 of 1
Text in screens
Posted: Sun Oct 30, 2022 5:09 pm
by Triority
Is there a way of extracting text (for translation or otherwise) from inside screen() functions? I use something like text __('Text') but it wont extract
Re: Text in screens
Posted: Sun Oct 30, 2022 6:02 pm
by Ocelot
Can you show an example of what does not work?
Generally "Mark string as translateable" (_()) and "translate immideately" (__()) are enough if the rest of code is translation-friendly.
Re: Text in screens
Posted: Mon Oct 31, 2022 10:38 am
by Triority
One example would be :
screen parentDialogue_S_1():
text "{font="+persistent.pref_text_font+"}{size=+0}{color=#d10aab}"+__('As requested, here\'s your report.')+"{/color}{/size}{/font}" at alpha_dissolve xpos MESSAGE_LEFT xanchor 0.0 ypos BASEMESSAGE_YPOS+(MESSAGE_YPOS*0.0) yanchor 0.0
Re: Text in screens
Posted: Mon Oct 31, 2022 10:49 am
by Ocelot
__() should add string in list of transaltable strings. Did you regenerate translation file after adding it? Did you check whole translate strings statement that was generated? Sometimes string you want is hidden between unrelated strings.
Re: Text in screens
Posted: Mon Oct 31, 2022 3:41 pm
by Triority
Ah, yes. Found it in the translated files. That's good.
Thanks for your help!