bbepis / XUnity.AutoTranslator

MIT License
2.02k stars 293 forks source link

Need help for lines/words that contains everchanging number #609

Closed johnjaynesismanalo closed 3 weeks ago

johnjaynesismanalo commented 3 weeks ago

As the title says, I want to ask if there's a way to translate a line with something like a timer. For example, Battle starts in: 12:23:11.

For reference, here is one of the lines I wanted to translate. Please help. นับถอยหลังเริ่มท้าทาย : <color\=#f5b428>12 ชม.30 นาที45 วินาที</color>=Battle begins in: <color\=#f5b428>12 hours 30 minutes 45 seconds</color>

ManlyMarco commented 3 weeks ago

Use a regex translation.

johnjaynesismanalo commented 3 weeks ago

Use a regex translation.

I tried that, but I wasn't sure if I did it correctly.

sr:"^นับถอยหลังเริ่มท้าทาย : <color=#f5b428>(?<hours_i>[0-9]+) ชม\.(?<minutes_i>[0-9]+) นาที(?<seconds_i>[0-9]+) วินาที</color>$"=Battle begins in : <color=#f5b428>${hours_i} hour(s) ${minutes_i} minute(s) ${seconds_i} second(s)</color>

r:"^นับถอยหลังเริ่มท้าทาย : <color\=#f5b428>([0-9]+) ชม\.([0-9]+) นาที([0-9]+) วินาที</color>$"=Battle begins in : <color=#f5b428>$1 hour(s) $2 minute(s) $3 second(s)</color>

I tried this but it didn't work. This is what I was trying to translate. image

Atamg1994 commented 3 weeks ago

you need enable TemplateAllNumberAway=True

ManlyMarco commented 3 weeks ago

Did you put the regex in a regex.txt file?

johnjaynesismanalo commented 3 weeks ago

you need enable TemplateAllNumberAway=True

I bless you to the end of times and to all of your next lives, my good sir/mam. Thank you.

johnjaynesismanalo commented 3 weeks ago

Did you put the regex in a regex.txt file?

Honestly, I didn't know I had to put that in a RegEx.txt file. I'm sorry! >.<

johnjaynesismanalo commented 3 weeks ago

My request has been fulfilled, I shall close this now. Thank you so much, @ManlyMarco @Atamg1994 . May you both have a great day ahead of you.