-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add script to generate translation catalog for the class reference #37114
Add script to generate translation catalog for the class reference #37114
Conversation
99e7b06
to
15f8994
Compare
I was finishing this T.T Good job anyway |
0e4913a
to
1f29e0a
Compare
8f17605
to
2fbe515
Compare
Looks pretty good already, good job! I left a few nitpicks on style. In the catalog you attached there's a mix of CR, LF and CRLF line endings, but I guess that's from your system/my download, the script itself doesn't seem to generate a mismatch in line endings. I'd place the file in Also a suggestion to make the commit log a bit more explicit:
|
71e87df
to
ec4d53c
Compare
ec4d53c
to
7fd0d5e
Compare
6df8b99
to
bce10c1
Compare
bce10c1
to
e817792
Compare
I've been testing the latest state of this PR together with #37164, and it seems to work great overall. There's one string however extracted from the classref which breaks the parsing of the resulting .po file (after copying the
That causes:
Here's the original unescaped string: https://github.com/godotengine/godot/blob/master/modules/regex/doc_classes/RegEx.xml#L6-L40 |
It's because of this line
the godot/core/io/translation_loader_po.cpp Line 125 in 1a532d5
possible fix (not tested!!) bool escape_next = false;
for (int i = 0; i < l.length(); i++) {
if (l[i] == '\\' && !escape_next){
escape_next = true;
continue;
}
if (l[i] == '"' && !escape_next) {
end_pos = i;
break;
}
escape_next = false;
} |
@ThakeeNathees Awesome, that works well! And I confirm that with my PR a translation for the RegEx description works too (I just added a single sentence at the beginning, but all the escaped text is properly matched): |
Thanks! |
See godotengine#37114 (comment) (cherry picked from commit 8c3ad2a)
See godotengine#37114 (comment) (cherry picked from commit 8c3ad2a)
See godotengine#37114 (comment) (cherry picked from commit 8c3ad2a)
Fix: #37109
the generated file (in *.txt format): translation_catalog.txt
EDITED
newer generated file :
translation_catalog.txt