I18n: extract and disambiguate a few messages #115963

Merged
Bastien Montagne merged 3 commits from pioverfour/blender:dp_disambiguate into main 2023-12-19 18:41:19 +01:00
Member

Extract:

  • Compositor error messages.
  • bUnitDefs were broken after cleanup commit 2b77cd726d. Since each
    unit's "display name" is now preceded by a consistent "name_display"
    comment, the regex which extracts the unit is greatly simplified.
    It now relies on the presence of the comment instead of the struct
    order.
  • "Preset" menu and "Apply Preset" button from the curveprofile
    template.
  • Operator labels from the catalog context menu.

Disambiguate:

  • "Bake Data": can mean "Which data to bake" (verb), or "The data that
    were baked" (noun).
  • "Cache" in the Simulation Nodes panel is a verb, not a noun.
  • "Mix" in the snapping menu is a noun, not a verb.
  • "Top" and "Bottom" can mean the upper part of an object or the
    highest point or element of something like a menu or list.
Extract: - Compositor error messages. - `bUnitDef`s were broken after cleanup commit 2b77cd726d. Since each unit's "display name" is now preceded by a consistent "name_display" comment, the regex which extracts the unit is greatly simplified. It now relies on the presence of the comment instead of the struct order. - "Preset" menu and "Apply Preset" button from the curveprofile template. - Operator labels from the catalog context menu. Disambiguate: - "Bake Data": can mean "Which data to bake" (verb), or "The data that were baked" (noun). - "Cache" in the Simulation Nodes panel is a verb, not a noun. - "Mix" in the snapping menu is a noun, not a verb. - "Top" and "Bottom" can mean the upper part of an object or the highest point or element of something like a menu or list.
Damien Picard added the
Module
User Interface
Interest
Translations
labels 2023-12-09 00:39:00 +01:00
Damien Picard added 1 commit 2023-12-09 00:39:08 +01:00
d2f55b8a88 I18n: extract and disambiguate a few messages
Extract:
- Compositor error messages.
- `bUnitDef`s were broken after cleanup commit 2b77cd726d. Since each
  unit's "display name" is now preceded by a consistent "name_display"
  comment, the regex which extracts the unit is greatly simplified.
  It now relies on the presence of the comment instead of the struct
  order.
- "Preset" menu and "Apply Preset" button from the curveprofile
  template.
- Operator labels from the catalog context menu.

Disambiguate:
- "Bake Data" can mean "Which data to bake" (verb), or "The data that
  were baked" (noun).
- "Cache" in the Simulation Nodes panel is a verb, not a noun.
- "Mix" in the snapping menu is a noun, not a verb.
- "Top" and "Bottom" can mean the upper part of an object or the
  highest point or element of something like a menu or list.
Damien Picard requested review from Bastien Montagne 2023-12-09 01:02:08 +01:00
Bastien Montagne requested changes 2023-12-19 11:42:09 +01:00
Bastien Montagne left a comment
Owner

Generally LGTM, besides small note below.


Think am going to have a bit of 'fun project' during the upcoming weeks to try and test libclang (and its python binding) to extract strings from C/C++. Our regexes were an okay solution in C, but I suspect in C++ they will become more and more fragile and/or painful to create and maintain.

Generally LGTM, besides small note below. -------------------- Think am going to have a bit of 'fun project' during the upcoming weeks to try and test libclang (and its python binding) to extract strings from C/C++. Our regexes were an okay solution in C, but I suspect in C++ they will become more and more fragile and/or painful to create and maintain.
@ -305,2 +306,2 @@
_msg_re + r"\s*,(?:(?:\s*\"[^\"',]+\"\s*,)|(?:\s*nullptr\s*,))(?:[^,]+,){2}"
+ "(?:\|?\s*B_UNIT_DEF_[_A-Z]+\s*)+\}"),) +
# bUnitDef unit names
((r"/\*name_display\*/\s*" + _msg_re + r"\s*,"),) +

This change feels weak... But then our whole handling of C/C++ code is weak, any change to the formatting can break these regexes. :(

I think for the time being this solution is OK, but would add a note in the definitions of these units that changing format should also check with this script.

This change feels weak... But then our whole handling of C/C++ code is weak, any change to the formatting can break these regexes. :( I think for the time being this solution is OK, but would add a note in the definitions of these units that changing format should also check with this script.
Author
Member

This change feels weak... But then our whole handling of C/C++ code is weak, any change to the formatting can break these regexes. :(

Yes, IIRC it’s second time it’s been broken this year, and I’m not particularly fond of this new regex either…

would add a note in the definitions of these units

Will do!

> This change feels weak... But then our whole handling of C/C++ code is weak, any change to the formatting can break these regexes. :( Yes, IIRC it’s second time it’s been broken this year, and I’m not particularly fond of this new regex either… > would add a note in the definitions of these units Will do!
pioverfour marked this conversation as resolved
Damien Picard added 2 commits 2023-12-19 16:11:56 +01:00
Bastien Montagne approved these changes 2023-12-19 18:40:47 +01:00
Bastien Montagne merged commit faefaa4447 into main 2023-12-19 18:41:19 +01:00
Bastien Montagne deleted branch dp_disambiguate 2023-12-19 18:41:21 +01:00
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#115963
No description provided.