-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
'Editor Settings','Project Settings','Property Name' display translation #45365
Conversation
editor/editor_inspector.cpp
Outdated
@@ -1939,7 +1940,7 @@ void EditorInspector::update_tree() { | |||
ep->set_label(F->get().label); | |||
} else { | |||
//use existin one | |||
ep->set_label(name); | |||
ep->set_label(TTR(name)); |
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.
TTR()
shouldn't be used with variable names as there will be no way for the PO file generation script to pick up strings to generate. TTR()
should only contain string literals, optionally using vformat()
to replace placeholders.
Also, it's debated whether property names should be translated as it will make it more difficult for newcomers to find which properties to edit when reading tutorials. |
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.
Also, it's debated whether property names should be translated as it will make it more difficult for newcomers to find which properties to edit when reading tutorials.
Add a switch to solve the problem
// Editor
_initial_set("interface/editor/property_name_translation", false);
I edit extract.py |
1b8e41d
to
392fa4b
Compare
I think this is a useful feature that we should support to be more accessible to users who are not comfortable with English. There are drawbacks as any translation means departing away from something which is easy to match with the scripting API (which should not be translated), but I think the gains outweigh the drawbacks, at least as long as this is optional (for users who would want the interface in their language but the property names matching the scripting API). I'm just mentioning this for context, I see the PR already implements this as an option.
Indeed, the current I see that you started modifying
If we want to go this route, it might be better to add relevant macros to define the English names that should be extracted and can be translated, e.g.:
The last one shows examples where the automatic capitalization of property paths done by the editor can also give bad results in English, and where having the possibility to set the name explicitly can improve the experience even in English (currently that last one shows as "Rendering > Vram Compression > Import S 3 Tc"). That's something that #32734 tries to improve with a hardcoded list of exceptions, but if we want full translation support, we might as well specify all names explicitly and remove the need for exceptions. Note that the API proposed above is only for discussion, I don't expect you to implement it now, we should first agree on what's the best approach. |
Implemented with plug-in. This PR is not required. |
Thanks for the link! I still think this might be interesting to implement in the engine, but I want to have a closer look at it myself to evaluate the impact and how to do it properly. I'll keep this PR and your plugin as reference. |
You're welcome. I didn't write this plugin. I just found it. |
(English from Google Translate)
'Editor Settings','Project Settings','Property Name' display translation
.po add msg
'set_tooltip' is added to show the original text
把原来没翻译的地方,让其可以翻译.
添加了几个set_tooltip,用来显示英文原文
编辑器设置中添加了'property_name_translation'属性,用来开启是否翻译这些英文
extract.py现在可以提取 _initial_set 和 GLOBAL_DEF 的文本了
3.2 #45383