Fix #76101: I18n: add new preference to translate reports #116804
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#116804
Loading…
Reference in New Issue
No description provided.
Delete Branch "pioverfour/blender:dp_translate_report_76101"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Translation of the UI is currently split into 3 preferences:
interface, tooltips, and new data. The distinction between interface
and tooltips is currently unclear as tooltips also include a lot of
messages not displayed in the actual tooltips on mouse hover.
These include reports to the Info Editor, information in editor
headers and footers, and statuses in panels.
In order to limit the use of
TIP_()
to actual tooltips, this commitintroduces a new preference for this extra information: "Reports".
New translation macros are introduced:
RPT_()
andCTX_RPT_()
, aswell as their equivalent for the Python API,
pgettext_rpt_()
, to beimported as
rpt_()
.Existing usages of
TIP_()
andIFACE_()
were reviewed and replacedwith
RPT_()
when relevant.Generally looks good, my main disagreement here is with the decision to move some of the longer UI footer info back to
interface
, imho these are typical valid usecases forreport
.This patch is also missing the required updates for the i18n scripts (messages extraction regexes) I think?
@ -830,3 +831,3 @@
cache_info = scene.eevee.gi_cache_info
if cache_info:
col.label(text=cache_info)
col.label(text=rpt_(cache_info), translate=False)
Would not change this here, see comment later in eevee code itself.
The translation disabling tag is the only thing I would keep here.
@ -260,3 +260,3 @@
SNPRINTF(eevee->light_cache_info,
TIP_("%d Ref. Cubemaps, %d Irr. Samples (%s in memory)"),
RPT_("%d Ref. Cubemaps, %d Irr. Samples (%s in memory)"),
As you are translating already the message here in one case, you should do the translation in this code in all cases. Otherwise this case will get translation code called twice (once here, once in py UI code with already translated string).
Even though the likeliness of collision is essentially null in that case, it is better (and somewhat more efficient) to be fully consistent and only handle translation at one level.
It’s not ideal, but the reason I’m doing this currently is because of the string formatting which needs to happen at this stage, otherwise the string couldn’t be translated at all. The best fix would be to expose the 3 values to the Python API so that formatting can happen on display, but I’m not sure it’s worth it.
Sorry, I did not read that properly. I chose to translate on display rather than here for most strings, so that the messages is updated on language change, and isn’t stuck with what was defined on last light cache update.
I still think double translation for this specific string is slightly better than no translation update on language change, but I wouldn’t mind reverting.
Aaaah OK, now I understand why, and agree with the change. Think a comment here would be worth it then. :)
@ -6541,3 +6540,1 @@
WM_window_cursor_keymap_status_get(win, i, 0));
const char *msg_drag = CTX_TIP_(BLT_I18NCONTEXT_OPERATOR_DEFAULT,
WM_window_cursor_keymap_status_get(win, i, 1));
const char *msg = CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT,
I do not agree with this change, to me these strings are rather reports than labels?
I agree, I was testing various things but would have switched this and other messages to reports, as discussed in the issue. This is still WIP! ;)
@ -560,3 +560,3 @@
if (obedit) {
if (BKE_keyblock_from_object(obedit)) {
*ofs += BLI_strncpy_rlen(info + *ofs, TIP_("(Key) "), len - *ofs);
*ofs += BLI_strncpy_rlen(info + *ofs, IFACE_("(Key) "), len - *ofs);
Here as well, I'd rather consider these strings as reports than labels.
@ -1324,3 +1324,3 @@
USER_TR_TOOLTIPS = (1 << 0),
USER_TR_IFACE = (1 << 1),
USER_TR_UNUSED_2 = (1 << 2), /* cleared */
USER_TR_REPORTS = (1 << 2), /* cleared */
Well... this is not cleared anymore in current code.
@blender-bot build
WIP: Fix #76101: I18n: add new preference to translate reportsto Fix #76101: I18n: add new preference to translate reports@mont29 I went over the existing translations. It’s possible I missed some still, but I don’t think many. I noticed a few things needing fixing, which I’ll submit separately.
Do you want me to rebase this to split the changes to macros into their own commit?
LGTM.
Only quickly checked all the changes for the usages of the new 'reports' translations, generally looks fine, this we can always refine further in the future anyway.
But would indeed rather have the core changes committed separately from the updates to iface/tip/rpt usages, to reduce the verbosity of the 'riskier' commit and make things either to investigate in case of later issues.
a49d0ee3b3
to5ee180910f
Should be all right now, the first commit contains only the core changes.
@blender-bot build
Now the
Reports
checkbox translates all messages in the Status Bar.Because of this, there are two problems:
Therefore, translating operations in the Status Bar does not help, but can be more confusing.
I propose translate the names of operations when
Interface
is enabled,and translate the actions inside the operation when
Report
is enabled:Hi, thanks for the input. I’m not saying the situation is perfect but I don’t understand your proposition well. You mention three different areas:
What I understand is you suggest translating 1 and 3 through Interface, and 2 through Reports, is that correct?
But in my mind 1 and 2 are pretty much similar, shouldn’t they use the same translation setting?
My opinion would go slightly towards translating 1 and 2 (all operations) through Interface, and 3 through reports. I think the statistics are closer to being reports, and the available operations are kind of in the middle.
That's right.
For interface consistency, 1 should be translated when the
Interface
is enabled.If you think that 2 should be the same as 1, you can do the same, I don't mind.
At the moment, I don't see any problems with this being translated as
Reports
orInterface
.Words in statistics are basic terms (Vertices, Edges, Faces, ...), there is no need to translate them because all users understand them.
These terms are also used elsewhere in the interface and I think that for interface consistency, statistics should also be translated when
Interface
is enabled:Another place where it might be worth changing the translation from
Reports
toInterface
:The text in the upper left corner:
Understood. Honestly I wouldn’t mind this change. I’ll wait for @mont29 ’s input since he’s the one who decided on the interface / tip split originally.
The proposed change make sense to me. Even though these are 'technically' reports, practically I think it makes more sense to match them with the rest of the interface messages indeed.