I18n: allow translation of mouse events in the keymap preferences #116390

Open
Damien Picard wants to merge 1 commits from pioverfour/blender:dp_mouse_types into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

Mouse events are defined in two enums: event_mouse_type_items and
rna_enum_event_type_items. Their names were not in sync, which meant
they were impossible to translate in the "Type of event" menu from the
keymap preferences.

This commit brings the two enums in sync.


Before After
English before_en.png after_en.png
French before_fr.png after_fr.png
Mouse events are defined in two enums: `event_mouse_type_items` and `rna_enum_event_type_items`. Their names were not in sync, which meant they were impossible to translate in the "Type of event" menu from the keymap preferences. This commit brings the two enums in sync. ----- | | Before | After | | -------- | -------- | -------- | | English | ![before_en.png](/attachments/2f2c4a05-d514-43d2-bdfe-03ed9a7ccdf7) | ![after_en.png](/attachments/8a55d2b3-1dcc-4111-9ffb-7f2874b82e7c) | | French | ![before_fr.png](/attachments/2b708f82-5e33-4df5-95e6-eae20f0df522) | ![after_fr.png](/attachments/af71b7a1-fc0e-4aba-bd64-6350d709579c) |
Damien Picard added the
Module
User Interface
Interest
Translations
labels 2023-12-20 18:54:20 +01:00
Damien Picard added 1 commit 2023-12-20 18:54:29 +01:00
efed8ef78b I18n: allow translation of mouse events in the keymap preferences
Mouse events are defined in two enums: `event_mouse_type_items` and
`rna_enum_event_type_items`. Their names were not in sync, which meant
they were impossible to translate in the "Type of event" menu from the
keymap preferences.

This commit brings the two enums in sync.
Damien Picard requested review from Bastien Montagne 2023-12-20 18:55:18 +01:00
Bastien Montagne reviewed 2023-12-21 17:31:06 +01:00
Bastien Montagne left a comment
Owner

We should not have the same info defined in two different places really...

Will try and change this I think, such that we only have one big rna_enum_event_type_items enum instead.

We should not have the same info defined in two different places really... Will try and change this I think, such that we only have one big `rna_enum_event_type_items` enum instead.

UUuhhhh... Actually...

So, I spent some time moving all this to only use one enum items (refactoring rna_KeyMapItem_type_itemf and some more code)... Current patch (!116442) is not yet fully functional, but I realized we actually probably do not want to get rid of these.

The main reason is that these specialized RNA enum items are shown in an already defined context (Mouse, NDOF, etc.), so adding these to the items' labels is needlessly verbose in the UI.

While am not happy with having that same data in two places, think for now it's better to keep them separated, and manually tag the strings in the specialized enums for translations (N_() macro). :|

@JulianEisel or @ideasman42 maybe have other/better ideas here?

UUuhhhh... Actually... So, I spent some time moving all this to only use one enum items (refactoring `rna_KeyMapItem_type_itemf` and some more code)... Current patch (!116442) is not yet fully functional, but I realized we actually probably do not want to get rid of these. The main reason is that these specialized RNA enum items are shown in an already defined context (Mouse, NDOF, etc.), so adding these to the items' labels is needlessly verbose in the UI. While am not happy with having that same data in two places, think for now it's better to keep them separated, and manually tag the strings in the specialized enums for translations (`N_()` macro). :| @JulianEisel or @ideasman42 maybe have other/better ideas here?
Merge conflict checking is in progress. Try again in few moments.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u dp_mouse_types:pioverfour-dp_mouse_types
git checkout pioverfour-dp_mouse_types
Sign in to join this conversation.
No reviewers
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
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#116390
No description provided.