Ren'Py Ren'py game notification translation problem

Corkyiscool

New Member
Nov 10, 2021
1
0
I'm a translator, I want to translate a game made by Ren'Py. But I'm having trouble translating the notifications. I don't know where to translate

Code:
screen notify(message):

    zorder 100
    style_prefix "notify"

    frame at notify_appear:
        text "[message!tq]"

    timer 3.25 action Hide('notify')


transform notify_appear:
    on show:
        alpha 0
        linear .25 alpha 1.0
    on hide:
        linear .5 alpha 0.0


style notify_frame is empty
style notify_text is gui_text

style notify_frame:
    ypos gui.notify_ypos

    background Frame("gui/notify.png", gui.notify_frame_borders, tile=gui.frame_tile)
    padding gui.notify_frame_borders.padding

style notify_text:
    properties gui.text_properties("notify")
 
Last edited:

moskyx

Forum Fanatic
Jun 17, 2019
4,005
12,961
I'm suspecting you are not translating a game following Ren'Py translation method, but rewriting the original code in your own language instead. Of course you can do it as you want but I'd recommend you to at least take a look at the tutorial linked in my signature to know how it's supposed to be done.

The code you posted is the notification screen in the screens.rpy file, which is just a default 'container'. The text to be displayed is determined by this line: text "[message!tq]" so that "message" is a text variable that changes depending on what do you want to notify to players.

The pic shows the 'quit' notification, and you could find that exact string in the tl/None/common.rpy file. If you create a translation following 'the official' method, that file should appear in your language folder too, making things a bit easier for you
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,581
2,219
It looks to be using the standard RenPy notification system of $ renpy.notify("Your message here").

What you are missing is that RenPy doesn't automatically flag non-renpy code for translation. In this case, since the line likely starts $ - it's a native python command and the translator bypasses it.

What you have to do instead is force RenPy to look at it by wrapping the translatable text in _().

So if I rewrite my example above as:

$ renpy.notify(_("Your message here")).

The text will he marked for translation. This is going to be true in other places too. Like screen code.

Edit: Your screenshot is for a , not a notification. For the most part, it is used by internal RenPy functions/menus and not normally invoked directly by developer code, but in theory it could be. However, the text is part of the core RenPy code. So when you generate a translation, all these internal English language strings are written out to the /game/tl/{yourlangugage}/common.rpy file - and it's up to you to update all those to match the lanugage you are aiming for. (though being pretty standard, you could probably copy the common.rpy file from another game that has already been translated).

Assuming you've done the proper [Generate Translations] on the main RenPy launcher - the only piece of information you're missing is that you need to update the common.rpy translation file.
 
Last edited: