Hello,
I'm trying to translate files from a video game created with the Ren'Py Visual Novel Engine (a software game engine with a programming language similar to Python). These files end with a .rpy extension and can be opened in any text editor. I have tried creating a new file type and defining a document structure. It works fine for the RPY files with a simpler structure, but I also have some more complex files and I haven't been able to find RegEx that seem to work. Here is an example:
# game/script/ch1.rpy:34
translate french ch1_308a744b:
# "This is example sentence 1."
"This is example sentence 1."
# game/script/ch1.rpy:38
translate french ch1_baea3297:
# "This is example sentence 2."
"This is example sentence 2."
# game/script/ch1.rpy:160
translate french ch1_7835ba72:
# sato vill cldo opes norm "Some sentences do \"this\" when the author wants to use quotation marks displayed in game."
sato vill cldo opes norm "Some sentences do \"this\" when the author wants to use quotation marks displayed in game."
# game/script/ch1.rpy:161
translate french ch1_fcb8c042:
# taku clot surp weeh "And a last example." with vpunch
taku clot surp weeh "And a last example." with vpunch
Sentences that need to be translated are always between quotation marks. Each sentence is repeated two times, first as a comment (lines starting with #), which must stay in the source language, then as an actual string I need to translate. Sometimes the strings are preceded or followed by a little bit of code (the way the code looks is a bit random).
If I say I only want to translate what's between quotation marks it doesn't work because the sentences in the comments also appears (which means each string appears two times while only one of the two must be translated). It also doesn't work with the \" that are sometimes found within the quotation marks.
I am using Trados Studio 2022 SR1 with the latest update.