Fix #105548: I18n: many keymap sections cannot be translated #116299
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#116299
Loading…
Reference in New Issue
No description provided.
Delete Branch "pioverfour:dp_fix_105548"
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?
In the keymap user preferences, shortcuts are grouped according to a
hierarchy of topics. Some of them cannot be translated, as they do not
get extracted by the i18n script. The issue happens in
walk_keymap_hierarchy()
. If the item in the hierarchy is not astring, it is skipped. This happens for tools defining their own
keymap, because they use a function instead of a string as the name.
In turn, the issue is in
keymap_hierarchy.generate()
. If run in theinterface, the hierarchy will contain only strings as topic names.
However, if run in the background, some of them will still be
functions, because they are not initialized.
This commit makes keyconfig initialization run in the background as
well.
I’m not entirely sure this is the proper fix.
WM_check()
is called when a file is opened or when a new window is created, but I’m not sure why the keyconfig init must be run at that point and not on startup. The current fix is simply to moveWM_keyconfig_init()
outside of the background check but maybe it should be moved somewhere else entirely?This seems to make sense to me, but would also get @ideasman42 review here.
From my understanding,
WM_keyconfig_init
get called first as part of theWM_init
process, but indeed needs to be called again once the startup file is read, which happens through theWM_check
call. Im current code, that second call would be skipped in background case.Not entirely sure though if call should be dependent on the
WM_INIT_FLAG_KEYCONFIG
flag here? Would rather keep the existing behavior for non-background case (i.e. check onWM_INIT_FLAG_WINDOW
). And also becauseWM_keyconfig_init
does some work, even ifWM_INIT_FLAG_KEYCONFIG
is set.While this fix seems reasonable, it changes the assumption that key-maps wont exist on startup in background mode (for add-on registration for e.g.). many add-ons have something like this:
It turns out this assumption has already been unintentionally violated - as part of other changes, this PR goes further to ensure the keyconfigs are initialized in background mode.
So I'd rather resolve this in a more isolated change, preparing an alternative fix.
I see, I wasn’t even aware of this assumption. Thanks for looking into it!
Committed alternative fix
c59b9ff9c2
.Pull request closed