Nodes: make node searches use both translated and original names #108681

Open
lictex_ wants to merge 4 commits from lictex/blender:search into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
First-time contributor

makes the english name of nodes always available for add node search & drag link search, regardless of the interface language

typing a name with IMEs isnt that fast. when using searching as a shortcut, some interface lang (like chinese) users might be slower than an english user

(however to avoid bloating the ui, the english name wont show up. so users might not be able to directly find out what english name of a node is.. consider this is a somewhat advanced operation i think its acceptable)

also a rcs request about this: https://blender.community/c/rightclickselect/sFcbbc


makes the english name of nodes always available for add node search & drag link search, regardless of the interface language typing a name with IMEs isnt that fast. when using searching as a shortcut, some interface lang (like chinese) users might be slower than an english user (however to avoid bloating the ui, the english name wont show up. so users might not be able to directly find out what english name of a node is.. consider this is a somewhat advanced operation i think its acceptable) also a rcs request about this: https://blender.community/c/rightclickselect/sFcbbc ---- <video src="/attachments/7841d105-f876-484c-8395-214cf665abc8" title="0.webm" controls></video>
258 KiB
lictex_ added 1 commit 2023-06-06 23:02:21 +02:00
Member

This makes sense, but there are a few issues:

  • Some translations are associated with a context. After this change, those are no longer used. For example, try searching for "Ceil" or any operation from the Math node. The search comes up with items in English instead of the local language. In this capture, Ceil is supposed to be translated to "Plafond" in French:
    image
  • Many translation macros (IFACE_()) were removed, so these messages are no longer extracted to the .po files after applying this PR, and they become untranslatable:
"End (Length)"
"Factor (Non-Uniform)"
"End (Factor)"
"Add a new simulation input and output nodes to the node tree"
"Start (Length)"
"Start (Factor)"

To fix this, the translation macros can be replaced by simple extraction macros N_(), or new extraction regexes can be introduced for add_item(), in the same style as 6d39ba7b41.

This makes sense, but there are a few issues: - Some translations are associated with a context. After this change, those are no longer used. For example, try searching for "Ceil" or any operation from the Math node. The search comes up with items in English instead of the local language. In this capture, Ceil is supposed to be translated to "Plafond" in French: ![image](/attachments/2aa0cb98-a0bd-43bf-823f-1587192e243b) - Many translation macros (`IFACE_()`) were removed, so these messages are no longer extracted to the .po files after applying this PR, and they become untranslatable: ``` "End (Length)" "Factor (Non-Uniform)" "End (Factor)" "Add a new simulation input and output nodes to the node tree" "Start (Length)" "Start (Factor)" ``` To fix this, the translation macros can be replaced by simple extraction macros `N_()`, or new extraction regexes can be introduced for `add_item()`, in the same style as 6d39ba7b41d.
lictex_ added 3 commits 2023-07-04 10:11:51 +02:00
Author
First-time contributor

think they should work well now

functions like add_item() however seem to be difficult to match by regexes, as some more complex args are there (like closures)..

think they should work well now functions like `add_item()` however seem to be difficult to match by regexes, as some more complex args are there (like closures)..
Member

Looks better, but some markers are now useless. N() is only useful with a literal inside, so it has no effect on things like N_(item->name), N_(name.c_str()), etc.

(There is still an issue with the "Ceil" from vector maths, but it was already there before and can be fixed separately.)

Looks better, but some markers are now useless. `N()` is only useful with a literal inside, so it has no effect on things like `N_(item->name)`, `N_(name.c_str())`, etc. (There is still an issue with the "Ceil" from vector maths, but it was already there before and can be fixed separately.)
Damien Picard requested review from Bastien Montagne 2023-07-05 22:52:27 +02:00

This is a fairly big change to our UI, think it needs design validation from the UI team first. Among other questions, I would expect such issue to be present in any type of search menu over items with translated names? This is also not really needed in many languages (all the roman-based one e.g.) I believe, so probably would need to be an opt-in option, maybe with default ON in case detected language of the user matches a certain set of these?

This is a fairly big change to our UI, think it needs design validation from the UI team first. Among other questions, I would expect such issue to be present in any type of search menu over items with translated names? This is also not really needed in many languages (all the roman-based one e.g.) I believe, so probably would need to be an opt-in option, maybe with default ON in case detected language of the user matches a certain set of these?
Bastien Montagne refused to review 2023-07-06 10:26:52 +02:00
Bastien Montagne added
Module
User Interface
and removed
Interest
User Interface
labels 2023-07-06 10:27:13 +02:00
This pull request has changes conflicting with the target branch.
  • source/blender/editors/space_node/add_node_search.cc
  • source/blender/editors/space_node/link_drag_search.cc
  • source/blender/nodes/NOD_add_node_search.hh
  • source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc
  • source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc
  • source/blender/nodes/geometry/nodes/node_geo_sample_volume.cc
  • source/blender/nodes/geometry/nodes/node_geo_simulation_output.cc
  • source/blender/nodes/intern/add_node_search.cc
  • source/blender/nodes/intern/socket_search_link.cc
  • source/blender/nodes/shader/nodes/node_shader_mix.cc

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u search:lictex-search
git checkout lictex-search
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
Asset Browser Project
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
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#108681
No description provided.