Ren'Py Translator ToolKit

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Message
Author
User avatar
Beuc
Regular
Posts: 73
Joined: Sat Sep 29, 2018 3:38 pm
Contact:

Ren'Py Translator ToolKit

#1 Post by Beuc » Sun May 19, 2019 9:35 pm

renpy-ttk-1.4.png
The Ren'Py Translation ToolKit is a converter between the Ren'Py native translation format and a PO file, which is usable by editors such as Poedit.

Here's "The Question" imported in it:
poedit.png

The .po translation file can be easily synchronized whenever you want, including in the middle of game development.
Translations can then be injected back into your Ren'Py "tl" directory as needed.
To try it, unzip the following mini-"game" in your Ren'Py game folder and launch "renpy-ttk" (interface still in early phase, I know - I'm struggling with the Screen styles -_-'. Contributions welcome :)).
Or you can run the Python scripts directly for easy automation.

Download: https://renpy.beuc.net/download/renpy-ttk-latest.zip

Documentation and source code: https://www.beuc.net/renpy-ttk/
Last edited by Beuc on Sat May 30, 2020 6:46 am, edited 7 times in total.

User avatar
Andredron
Veteran
Posts: 402
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: Ren'Py Translator ToolKit

#2 Post by Andredron » Mon May 20, 2019 8:36 am

Cool!!!!
I know, I'm writing terribly in English.

I'm writing a Renpy textbook (in Russian). https://yadi.sk/d/ZX_DonP63USRru Update 22.06.18

Honest Critique

maxlefou
Newbie
Posts: 4
Joined: Thu May 23, 2019 4:02 pm
Contact:

Re: Ren'Py Translator ToolKit

#3 Post by maxlefou » Thu May 23, 2019 4:18 pm

This is awesome! exactly what i was looking for!

You should mirror your repo into github or gitlab tho, so people can track easier when there's updates

User avatar
Beuc
Regular
Posts: 73
Joined: Sat Sep 29, 2018 3:38 pm
Contact:

Re: Ren'Py Translator ToolKit

#4 Post by Beuc » Fri May 24, 2019 3:59 am

Glad it's being useful!

I pushed mirrors there, and there's always https://www.beuc.net/renpy-ttk/timeline.rss

maxlefou
Newbie
Posts: 4
Joined: Thu May 23, 2019 4:02 pm
Contact:

Re: Ren'Py Translator ToolKit

#5 Post by maxlefou » Thu May 30, 2019 10:54 am

Ok since I can't report errors in any places your repo is, i'll do it here:

First there's a very bad error in reconverting mo2tl.
When you have voice commands with lines, you get something like this, for instance:

Code: Select all

# game/script_21_1320.rpy:8
translate japanese scene_21_1320_06a49170:

    # voice "path/to/file"
    # a "text"
    voice "path/to/file"
    a "translated text"
but when converted with your tool, it becomes something like this:

Code: Select all

# game/script_21_1320.rpy:8
translate japanese scene_21_1320_06a49170:

    # voice "text"
    # a "text"
    voice "translated text"
    a "translated text"
and that's veeerery bad for voiced games. :p

Also, another error with the commit a919022399 I get this error, no matter what command i use:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/screens.rpy", line 30, in __call__
    import tl2pot
ImportError: No module named rttk.run

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script
    python hide:
  File "C:\renpy\renpy\ast.py", line 900, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\renpy\renpy\python.py", line 1930, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in <module>
    python hide:
  File "renpy/common/_layout/screen_main_menu.rpym", line 35, in _execute_python_hide
    ui.interact()
  File "C:\renpy\renpy\ui.py", line 289, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\renpy\renpy\display\core.py", line 2690, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\renpy\renpy\display\core.py", line 3493, in interact_core
    rv = root_widget.event(ev, x, y, 0)
  File "C:\renpy\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\renpy\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\renpy\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\renpy\renpy\display\screen.py", line 697, in event
    rv = self.child.event(ev, x, y, st)
  File "C:\renpy\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\renpy\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\renpy\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\renpy\renpy\display\behavior.py", line 923, in event
    return handle_click(self.clicked)
  File "C:\renpy\renpy\display\behavior.py", line 858, in handle_click
    rv = run(action)
  File "C:\renpy\renpy\display\behavior.py", line 320, in run
    return action(*args, **kwargs)
  File "game/screens.rpy", line 30, in __call__
    import tl2pot
  File "C:\Users\Max\Documents\renpygames\download\tl2pot.py", line 30, in <module>
    import rttk.run, rttk.tlparser
ImportError: No module named rttk.run

Windows-8-6.2.9200
Ren'Py 7.2.2.491
Ren'Py Translator ToolKit 1.1
Thu May 30 16:53:13 2019

User avatar
Beuc
Regular
Posts: 73
Joined: Sat Sep 29, 2018 3:38 pm
Contact:

Re: Ren'Py Translator ToolKit

#6 Post by Beuc » Thu May 30, 2019 1:38 pm

Hi,

Thanks for the detailed report!
Here is fine, by e-mail too.

I added support for voice statements :)

I also fixed the ImportError thing (though to be fair that was in the development version and not the latest release ;) Still, good thing you identified this early.).

maxlefou
Newbie
Posts: 4
Joined: Thu May 23, 2019 4:02 pm
Contact:

Re: Ren'Py Translator ToolKit

#7 Post by maxlefou » Fri May 31, 2019 5:24 am

great ^^ now it all works.

Except that now, only instances that are not spoken by characters are translated. like in:

Code: Select all

# game/script_11_1420.rpy:11
translate japanese scene_11_1420_ac044f2f:

    # voice "voice/bbb0344.ogg"
    # b "「But if you ever change your mind, feel free to ask me♪」"
    voice "voice/bbb0344.ogg"
    b "「But if you ever change your mind, feel free to ask me♪」"

# game/script_11_1420.rpy:16
translate japanese scene_11_1420_10696317:

    # "I wonder if turning him down was really the right choice?"
    "‥‥‥やっぱり、断らない方が\nよかったかなぁ?"
You don't happen to have discord btw? I'll be more free next week so if you need a beta tester and all... ;)

User avatar
Beuc
Regular
Posts: 73
Joined: Sat Sep 29, 2018 3:38 pm
Contact:

Re: Ren'Py Translator ToolKit

#8 Post by Beuc » Fri May 31, 2019 9:25 am

Thanks for finding another bug ;)
Problem was actually the 「♪」 characters in the original language.
More difficult to deal with, but should be fixed now.

Discord's offline notifications are terribly delayed, so you'll have better luck by e-mail or here :)

User avatar
Beuc
Regular
Posts: 73
Joined: Sat Sep 29, 2018 3:38 pm
Contact:

Re: Ren'Py Translator ToolKit

#9 Post by Beuc » Sun Jun 30, 2019 3:54 pm

I added the above fixes:
- Don't translate voice statements
- Support unicode in original language
as well as a few improvements:
- Better documentation
- Clarify GUI some more, and add some progress and error reporting

This is v1.2 :)

User avatar
Beuc
Regular
Posts: 73
Joined: Sat Sep 29, 2018 3:38 pm
Contact:

Re: Ren'Py Translator ToolKit

#10 Post by Beuc » Sat Apr 25, 2020 11:52 am

I clarified some bits in the doc, and marked obsolete translations in the tl/*.rpy files.
This is v1.3 :)

User avatar
isobellesophia
Miko-Class Veteran
Posts: 976
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Ren'Py Translator ToolKit

#11 Post by isobellesophia » Sat May 02, 2020 12:21 am

Thank you so much of this! Can you also add a Japanese translation for a chance? I really want this but thanks, i'll be glad if there is a japanese.
I am a friendly user, please respect and have a good day.


Image

Image


User avatar
Beuc
Regular
Posts: 73
Joined: Sat Sep 29, 2018 3:38 pm
Contact:

Re: Ren'Py Translator ToolKit

#12 Post by Beuc » Sat May 02, 2020 4:58 am

Hi!

This works for Japanese :)

What do you mean by "add a Japanese translation"?

User avatar
isobellesophia
Miko-Class Veteran
Posts: 976
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Ren'Py Translator ToolKit

#13 Post by isobellesophia » Sat May 02, 2020 5:29 am

Oops sorry, i mean a japanese language available to translate, is there? Or not yet?
I am a friendly user, please respect and have a good day.


Image

Image


User avatar
Beuc
Regular
Posts: 73
Joined: Sat Sep 29, 2018 3:38 pm
Contact:

Re: Ren'Py Translator ToolKit

#14 Post by Beuc » Sat May 02, 2020 7:47 am

I am not entirely sure I understand, but to clarify:

- you can add any target language you want (e.g. English -> Japanese): you create a new game translation using the Ren'Py launcher, then when you run renpy-ttk the new language can be selected

- renpy-ttk would also work for translating a Japanese game to another language (e.g. Japanese -> English).

SileNTViP
Newbie
Posts: 1
Joined: Sat May 23, 2020 4:34 pm
Contact:

Re: Ren'Py Translator ToolKit

#15 Post by SileNTViP » Sat May 23, 2020 4:42 pm

Hey. Thank you for the program. There's a problem that it doesn't pull out a piece of text.

Code: Select all

# game/scripts/locations/rump/lobby/dialogue.rpy:151
translate russian con02_rump_lobby_delivery_95be89c3:

    # consuela "What am I supposed to do now?" (show_native="?Que se supone que debo hacer ahora?")
    consuela "What am I supposed to do now?" (show_native="?Que se supone que debo hacer ahora?")
program extract in .po and .pot files only: "?Que se supone que debo hacer ahora?" without string "What am I supposed to do now?"...

Post Reply

Who is online

Users browsing this forum: No registered users