Create and Fuck your AI Slut -70% OFF
x

Tool Ren'Py Ren'py realtime translator Mod[v0.27.a]

Jul 28, 2025
160
56
28
update:10-09-2025
updated files:llmtransconfig.rpy realtimetrans.rpy transconfig.rpy
1-Tested the usage of the mod on the Android version, pasted the files to Android/data/{app name}/files/game, and created a the "game" folder if it does not exist.
2-You can use multi api_keys to reduce time_interval and avoid rate limit now.
In llmtransconfig.rpy
API_KEYS =["Your-API-Key1","Your-API-Key2"]#requests will use the key by turns to avoid rate limit
For example,if all your api rate limit is 20 repquests per min,you should set time_interval to more than 3 ;
now if you are using 3 same api_keys,you can set time_interval to more than 1 .
3-Add support for RTL.
In transconfig.rpy ENABLE_RTL=True
It will be helpful for languages writen from right to left ,such as arabic and hebrew.
 
  • Like
Reactions: Nobre and CAT0X0

AliVeli49

New Member
Dec 19, 2024
5
0
1
The app is really nice, thank you.

I have a few suggestions.

- Sometimes the automatic translation is poor, and I wonder what the English version is. It would be nice if we could stop the automatic translation by pressing a button and see the English version. Pressing the same button again could restart the translation, for example.

- The highlighted colored parts in the text merge with other words; it would be better if there were spaces between them.

- In the translation of quotation marks, ' appears. For example, {b}Diane's{/b} ==> {b}Diane'in{/b}. (TARGET_LANGUAGE = "tr")
 
Jul 28, 2025
160
56
28
The app is really nice, thank you.

I have a few suggestions.

- Sometimes the automatic translation is poor, and I wonder what the English version is. It would be nice if we could stop the automatic translation by pressing a button and see the English version. Pressing the same button again could restart the translation, for example.

- The highlighted colored parts in the text merge with other words; it would be better if there were spaces between them.

- In the translation of quotation marks, ' appears. For example, {b}Diane's{/b} ==> {b}Diane'in{/b}. (TARGET_LANGUAGE = "tr")
1-Config inside game will be available in next update
2-I am confused about the highlighted colored parts, the translation mod is not using that,maybe you should discuss that with the game developer.Or you could provide more details.
3-It seems to be an escape character issue,&#39 should be '
will be fixed in next update
 

AliVeli49

New Member
Dec 19, 2024
5
0
1
1-Config inside game will be available in next update
2-I am confused about the highlighted colored parts, the translation mod is not using that,maybe you should discuss that with the game developer.Or you could provide more details.
3-It seems to be an escape character issue,&#39 should be '
will be fixed in next update
Example for highlighted colored parts: (Maybe it's more accurate to say TAG instead of colorful.)
1. from translation_cache.json: ( (TARGET_LANGUAGE = "tr")
"If you’d like this textbox to be more {i}transparent{/i}, you can change that in the {b}Settings{/b} menu.": " Bu metin kutusunun daha{i}şeffaf{/i}olmasını istiyorsanız, bunu{b}Ayarlar{/b}menüsünden değiştirebilirsiniz."
on Screen: Bu metin kutusunun dahaşeffafolmasını istiyorsanız, bunuAyarlarmenüsünden değiştirebilirsiniz

2. another problem, first colored text, same with second colored text
from translation_cache.json: ( (TARGET_LANGUAGE = "tr")
"And {color=#831521}{b}Lucy{/b}{/color} and {color=#337e5f}{b}Emma{/b}{/color}...": " Ve{color=#831521}{b}Lucy{/b}{/color}ve{color=#337e5f}{b}Emma{/b}{/color}... "
on Screen: VeLucyveEmma...
 

cemo45

Newbie
May 29, 2018
17
1
126
According to your log file,Your api rate limit is
"X-RateLimit-Limit":"20" per min
Which means you can post no more than 20 requests per minute.
So the time_interval in transconfig.rpy should be equal or larger than 3.
How can we change this time? I bought 3 API KEYs, but there is still a time problem
 
Jul 28, 2025
160
56
28
Example for highlighted colored parts: (Maybe it's more accurate to say TAG instead of colorful.)
1. from translation_cache.json: ( (TARGET_LANGUAGE = "tr")
"If you’d like this textbox to be more {i}transparent{/i}, you can change that in the {b}Settings{/b} menu.": " Bu metin kutusunun daha{i}şeffaf{/i}olmasını istiyorsanız, bunu{b}Ayarlar{/b}menüsünden değiştirebilirsiniz."
on Screen: Bu metin kutusunun dahaşeffafolmasını istiyorsanız, bunuAyarlarmenüsünden değiştirebilirsiniz

2. another problem, first colored text, same with second colored text
from translation_cache.json: ( (TARGET_LANGUAGE = "tr")
"And {color=#831521}{b}Lucy{/b}{/color} and {color=#337e5f}{b}Emma{/b}{/color}...": " Ve{color=#831521}{b}Lucy{/b}{/color}ve{color=#337e5f}{b}Emma{/b}{/color}... "
on Screen: VeLucyveEmma...
Google translate could return translated text with unexpected space which results in tokenizing error and crushing the game.
So i simply removed the spaces around { and }.It seems to be the reason of this problem.
I will fix it in next update.
 
Jul 28, 2025
160
56
28
How can we change this time? I bought 3 API KEYs, but there is still a time problem
time_interval in transconfig.rpy
Attention that time_interval means the translate request interval and it is not the real time delay.
For llm translation the llm response delay is the main reason .
 
Last edited:

AliVeli49

New Member
Dec 19, 2024
5
0
1
If Custom Text Tags are used, it throws an error.


While processing text tag {urm_notl} in '{urm_notl}Okay{/urm_notl}'.:
File "game/scripts/script.rpy", line 12300, in script
call screen BedroomIn
File "renpy/common/000statements.rpy", line 671, in execute_call_screen
store._return = renpy.call_screen(name, *args, **kwargs)
File "game/realtimetrans.rpy", line 443, in hook_segment_trans
return original_cts(self, result_tokens, style, renders, text_displayable)
Exception: Unknown text tag 'urm_notl'
 
Jul 28, 2025
160
56
28
update:15-09-2025
updated files:realtimetrans.rpy,transconfig.rpy
removed file:llmtransconfig.rpy
1-Allow config inside game,go to preferences,click the translate settings in the lower right corner .
llm api-keys,base url,model name can not be set with game.
For details, read transconfig.rpy line25-line64.
The setting shoulf be persistent
2-Fix the space problem,the space numbers around the tag should be same before and after the translation.
3-html unescape is applied now,so &#39 should not appear again.
 
Last edited:
  • Like
Reactions: Nobre

Nobre

Member
Mar 12, 2022
234
191
166
I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/realtimetrans.rpy", line 449, in script
init python:
File "game/realtimetrans.rpy", line 451, in <module>
original_before_main_menu = renpy.get_label("before_main_menu")
^^^^^^^^^^^^^^^
AttributeError: module 'renpy.exports' has no attribute 'get_label'. Did you mean: 'has_label'?

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

Traceback (most recent call last):
File "game/realtimetrans.rpy", line 449, in script
init python:
File "renpy/ast.py", line 1187, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "renpy/python.py", line 1260, in py_exec_bytecode
exec(bytecode, globals, locals)
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "game/realtimetrans.rpy", line 451, in <module>
original_before_main_menu = renpy.get_label("before_main_menu")
^^^^^^^^^^^^^^^
AttributeError: module 'renpy.exports' has no attribute 'get_label'. Did you mean: 'has_label'?

Windows-11-10.0.22631-SP0 AMD64
Ren'Py 8.4.1.25072401
 

cemo45

Newbie
May 29, 2018
17
1
126
I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/realtimetrans.rpy", line 1, in script
init python:
File "game/realtimetrans.rpy", line 3, in <module>
import requests
ImportError: No module named requests

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

Full traceback:
File "game/realtimetrans.rpy", line 1, in script
init python:
File "C:\Users\Kerem\Downloads\DAST001-v2.0.0.P-pc\renpy\ast.py", line 900, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\Kerem\Downloads\DAST001-v2.0.0.P-pc\renpy\python.py", line 1930, in py_exec_bytecode
exec bytecode in globals, locals
File "game/realtimetrans.rpy", line 3, in <module>
import requests
ImportError: No module named requests
 
Jul 28, 2025
160
56
28
Update:18-09-2025
Updated files:realtimetrans.rpy transconfig.rpy
1-fix the get_label bug,replace it with functionn and quit_callbacks
2-Support for older Renpy7 lacking requests. Tested in Ren'py 7.2.2
 
  • Like
Reactions: CAT0X0 and Nobre

AliVeli49

New Member
Dec 19, 2024
5
0
1
I wrote something that turns the translation ON and OFF when you press the F2 key.
Maybe it will be useful to you.
 

trans1

Newbie
Jan 24, 2023
25
0
124
The realtime translator works very well so far, but every now and then I have lines that are not translated.
The log then shows the following:

Traceback (most recent call last):
File "C:\Prog\Games\ChasingSunsets-1.10-pc\renpy\exports.py", line 3766, in run
fn(*args, **kwargs)
File "game/realtimetrans.rpy", line 96, in translation_thread
translations = translate_batch(texts_to_translate,TARGET_LANGUAGE)
File "game/realtimetrans.rpy", line 574, in translate_batch
protected_text = COMBINED_PATTERN.sub(
TypeError: expected string or bytes-like object
 
Jul 28, 2025
160
56
28
I wrote something that turns the translation ON and OFF when you press the F2 key.
Maybe it will be useful to you.
You can swtich translation in preferences within game in current version.
And i assume that F2 key will not work on Android games.
Anyway, thanks for your advice.
 
Jul 28, 2025
160
56
28
update:22-09-2025
updated file:realtimetrans.rpy
1-Custom text tags are applyied now by simply adding

new_tokens= text_displayable.apply_custom_tags(new_tokens)

2-Add a random time interval (-0.05 to 0.05) for translation requeststime_interval
 
Jul 28, 2025
160
56
28
The realtime translator works very well so far, but every now and then I have lines that are not translated.
The log then shows the following:

Traceback (most recent call last):
File "C:\Prog\Games\ChasingSunsets-1.10-pc\renpy\exports.py", line 3766, in run
fn(*args, **kwargs)
File "game/realtimetrans.rpy", line 96, in translation_thread
translations = translate_batch(texts_to_translate,TARGET_LANGUAGE)
File "game/realtimetrans.rpy", line 574, in translate_batch
protected_text = COMBINED_PATTERN.sub(
TypeError: expected string or bytes-like object
I guess the Text is already tokenized ,so the texts_to_translate are tokens rather than strings.
I am trying to fix that by extract the tag==Text parts.