-
-
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
[3.x] i18n: Make property paths and categories translatable #58634
Conversation
# fmt: off | ||
capitalized = " ".join( | ||
part.title() | ||
for part in capitalize_re.sub("_", name).replace("_", " ").split() | ||
) | ||
# fmt: on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I turned off black
for this block. Because it wants me to put these on a single line.
Keeping these in multiple lines is much more readable I think.
7d184ab
to
922e4d3
Compare
Updated the regular expression for |
3d4f9b0
to
dfd7785
Compare
editor/editor_string_processor.cpp
Outdated
String capitalized_string = p_name.capitalize(); | ||
|
||
// Fix the casing of a few strings commonly found in editor property/setting names | ||
for (Map<String, String>::Element *E = capitalize_string_remaps.front(); E; E = E->next()) { | ||
capitalized_string = capitalized_string.replace(E->key(), E->value()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels a bit hacky IMO to do replacements based on the wrongly capitalized output instead of handling the input directly (i.e. map the input s3tc
and not the output S 3 T C
to the correct form S3TC
), but I don't see how to do it without making things less efficient and more cumbersome, so I guess it's fine as is :)
Looks pretty good to me overall! Added some review comments, mostly nitpicks. I do think the general approach is good :) As a side note for the tooltips, it could be useful to have the full property paths (e.g. |
Co-Authored-By: Hugo Locurcio <hugo.locurcio@hugo.pro>
dfd7785
to
aaff2e3
Compare
Updated according to review and added some necessary remapping found during testing.
Checked the extracted messages, there are no false positives. |
@timothyqiu You can find more English remappings that would be useful to add here: #32734 |
@Calinou Yeah, those are what I used as the initial remappings. I saw that PR is several months old and some changes are required, so I did the changes here and listed you as the co-author :) |
Thanks! |
3.x
l10n is more complete thanmaster
, thus easier to test, so this PR targets3.x
. I'll do amaster
version after this is discussed :)I did some Ad-hoc localization for testing locally. When
interface/editor/translate_properties
is on, which is the default, the editor looks like this:msgid
s in thePOT
file easier to read. Capitalization logic is from (and thus supersedes) Improve editor property capitalization #32734.interface/editor/translate_properties
is on.translate_properties
is on, shows the original name.translate_properties
is off, shows the translated name.extract.py
:TTR()
single-line #58627.