renpy / renpy

The Ren'Py Visual Novel Engine
http://www.renpy.org/
4.95k stars 696 forks source link

get translation info with the id #5570

Closed Neyunse closed 3 months ago

Neyunse commented 3 months ago

Since renpy.get_translation_identifier() exists, I think it would be a good idea to add something like renpy.get_translation_info(id). This could be useful to use when debugging the project. The result of this could be something like this:

statement = renpy.get_translation_info("start_xxxxxx") # if the id is not specified it will use renpy.get_translation_identifier() instead for the current statement

print(statement)

{
   "id": "start_xxxxxx",
   "character": "e",
   "statement": "hola mundo.",
   "translation" "hello world.",
   "line": 6,
   "file: "script.rpy"
}

Basically, this would allow to display the details of a dialog using its id.

mal commented 3 months ago

Related to https://github.com/renpy/renpy/issues/5414.

renpytom commented 3 months ago

I don't think this is possible with the way Ren'Py's translation system is designed. The translation system maps a single line of dialogue onto multiple lines of Ren'Py script. And so a one-to-one mapping like this isn't possible.

I'm going to close this, as while #5414 is possible, this isn't.