I have the issue of getting the original untranslated game's text from a translated text that is passed to the say function. The problem is as follows. I created a hook to the say function like this:
Code: Select all
my_old_say = renpy.exports.say
def my_say(who, what, *args, **kwargs):
<do something specific with who, what and the arguments>
return my_old_say(who, what, *args, **kwargs)
renpy.exports.say = my_say
What I am doing is to trigger a lip synchronized talking animation of the character that is currently saying the text that is passed to the say function. This is working almost perfectly, and I do need the translated text for this because lip animation would be different for different languages. So far, so good.
Additionally, I am playing sound files for any text breadcrump enclosed in "*" symboles passed to the say function, i.e. for any text of format "*<some text>*" I play a file "_<some text>.mp3". This works as long as the text inside the "*" symbols is not translated.
Problem is that the translation is covering everything, including those text enclosed inside the "*" symbols. If I have
Code: Select all
old "*knock* *knock* -- Anybody home?"
new "*klopf* *klopf* -- Jemand zuhause?"
This is why I am asking if there is a possibility to get the old text if the new one is passed to the say function. And this should also work for the identifier based translations, not just string translations:
Code: Select all
translate de <label>_<hash>:
player_name"*klopf* *klopf* -- Jemand zuhause?"