remram44 / pybabel-godot

Plugin for Babel to support Godot scene files (.tscn)
Other
14 stars 11 forks source link

Matching tr() in built-in scripts #5

Open h0lley opened 3 years ago

h0lley commented 3 years ago

In built-in scripts, the code is stored in the tscn file and the " are escaped like so:

func _ready():
    print(tr(\"lalala\"))

would be cool if pybabel-godot could pick up those tr's as well.

remram44 commented 3 years ago

I've never used those but maybe we can support them. The problem is that we'd have to replicate a lot of work Babel already knows how to do for source files...

I don't know if this is worth it, but thanks for bringing those to my attention! I had actually never noticed this option at all.

h0lley commented 3 years ago

I see. I imagined it might be an easy fix like adding a \ to a regular expression, but if it's something more complex it's probably not worth it. I encountered this issue while testing my pybabel setup, but haven't actually been in a situation yet where I'd need support for built-in scripts myself.