$ msg(_("my test message"))
I guess you are saying to do it like in the following code block, but that is not what I wanted to ask:
Code: Select all
label start:
scene bg room
show eileen happy
"Welcome"
$ msg(_("my test message"))
I don't want to pass the
already "registered for translation" string (the one between brackets and underscore) to my python defined function as a parameter,
I was trying to ask if there is a way to make the python defined function to handle the string and register it for translation inside itself: something like I asked before:
Code: Select all
def msg(test):
t = _(test) #register the string for "export/translation".
#do other stuff with t, but first ADD this string to the translatable strings list.
Since it's python (which I am still learning) I thought I could do this somehow, but I can't simply write it
plain as I expected, because the function
_(s) seems to just return the same exact string without adding it to the list of translatable strings: I tried to generate translations several times, but my test strings were never added.
Now I guess this might be part of some complex encoding process done by renpy itself and it's not possible to do otherwise.
The reason to do this is to explore the possibility of renpy, which seems much capable already, and I have a VN idea where there might be a lot of stuff to translate that has to be "outside of the standard elements", and if I could handle the "translation stuff" through a function I would avoid a lot of underscore and brackets, let the function decide what should and should not be translatable, and make things easier for the people who might join to help me.
For example I could write:
Code: Select all
#release(label, title, author, content) label must not be translated.
newspaper.release("december", "title", "author", "a lot of rain came lorem ipsun dolor etc...." )
instead of:
newspaper.release("december", _("title"), _("author"), _("a lot of rain came lorem ipsun dolor etc....") )
I know that there are workarounds and this is only an example scenario: I would prewrite a dictionary in this specific one, anyway..
I hope I made sense this time. Thank you