Panels' title not long enough to store some translations #111927

Closed
opened 2023-09-04 13:59:06 +02:00 by Damien Picard · 8 comments
Member

System Information
Operating system: Linux-6.2.0-31-generic-x86_64-with-glibc2.37 64 Bits, X11 UI
Graphics card: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 535.86.05

Blender Version
Broken: version: 4.0.0 Alpha, branch: main, commit date: 2023-09-04 09:43, hash: 938d43c317b7
Worked: Likely never

Short description of error
The bl_label of panels is limited to 63-bytes strings. In English, that is 63 characters, which is plenty enough. In some scripts such as Georgian, each character takes up 3 bytes in UTF-8. This effectively reduces the number of characters to 21, not always quite enough.

It should in my opinion be at least doubled to allow localization to non-latin scripts.

Exact steps for others to reproduce the error

  • Open the User preferences
  • In the Translation panel, select Georgian as language
  • Go to the second tab (Themes)
    • The first panel (User Interface) is cut short (“მომხმარებლის ინტერფეიá” instead of “მომხმარებლის ინტერფეისი”)
  • Look at the Eevee render properties, Screen Space Reflections panel in Georgian
    • It reads “ეკრანის სივრცისეული არá” instead of “ეკრანის სივრცისეული არეკლვები”

image

Originally reported by @Tamuna in #43295.

**System Information** Operating system: Linux-6.2.0-31-generic-x86_64-with-glibc2.37 64 Bits, X11 UI Graphics card: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 535.86.05 **Blender Version** Broken: version: 4.0.0 Alpha, branch: main, commit date: 2023-09-04 09:43, hash: `938d43c317b7` Worked: Likely never **Short description of error** The `bl_label` of panels is limited to 63-bytes strings. In English, that is 63 characters, which is plenty enough. In some scripts such as Georgian, each character takes up 3 bytes in UTF-8. This effectively reduces the number of characters to 21, not always quite enough. It should in my opinion be at least doubled to allow localization to non-latin scripts. **Exact steps for others to reproduce the error** - Open the User preferences - In the Translation panel, select Georgian as language - Go to the second tab (Themes) - The first panel (User Interface) is cut short (“მომხმარებლის ინტერფეიá” instead of “მომხმარებლის ინტერფეისი”) - Look at the Eevee render properties, Screen Space Reflections panel in Georgian - It reads “ეკრანის სივრცისეული არá” instead of “ეკრანის სივრცისეული არეკლვები” ![image](/attachments/b5709569-ea89-4216-b978-54f75f69a679) Originally reported by @Tamuna in [#43295](https://projects.blender.org/blender/blender/issues/43295#issuecomment-1012619).
Damien Picard added the
Interest
Translations
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-09-04 13:59:07 +02:00
YimingWu added
Module
User Interface
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-09-04 14:59:59 +02:00
Author
Member

@ChengduLittleA Thanks. I’m not sure it’s only related to the user interface, it may involve the core module as well since the length of some properties is affected?

@ChengduLittleA Thanks. I’m not sure it’s only related to the user interface, it may involve the core module as well since the length of some properties is affected?
Member

@pioverfour also not necessarily. Developers will take a look at this.

The á character probably means the string is cut short in the middle of the character. Likely cause:

  • An encoding issue
  • or the 64 byte limit of char panelname[64]; in struct Panel,
  • Likely the limit in the drawing function too (UI_MAX_NAME_STR==128, see ui_def_but).
@pioverfour also not necessarily. Developers will take a look at this. The `á` character probably means the string is cut short in the middle of the character. Likely cause: - An encoding issue - or the 64 byte limit of `char panelname[64];` in `struct Panel`, - Likely the limit in the drawing function too (`UI_MAX_NAME_STR==128`, see `ui_def_but`).
Author
Member
  • or the 64 byte limit of char panelname[64]; in struct Panel,

It looks like setting char drawname[64]; to e. g.128 fixes the issue, but I don’t know what the consequences are.

> - or the 64 byte limit of `char panelname[64];` in `struct Panel`, It looks like setting `char drawname[64];` to e. g.`128` fixes the issue, but I don’t know what the consequences are.
YimingWu added
Status
Needs Info from Developers
and removed
Status
Confirmed
labels 2023-09-05 07:19:06 +02:00
Member

I'm honestly not sure, drawname seems to be runtime-only, shouldn't really cause a big problem, however UI_MAX_NAME_STR is 128 and from the look of it I can't tell whether it applies to the two string lengths combined. Need a UI dev to tell whether this is acceptable.

I'm honestly not sure, `drawname` seems to be runtime-only, shouldn't really cause a big problem, however `UI_MAX_NAME_STR` is 128 and from the look of it I can't tell whether it applies to the two string lengths combined. Need a UI dev to tell whether this is acceptable.
Member

Maybe @JulianEisel can shed some light here.

Any downsides you can think of if the length of the panels name (char drawname[64] in struct Panel) was increased, say to 128?

Maybe @JulianEisel can shed some light here. Any downsides you can think of if the length of the panels name (`char drawname[64]` in `struct Panel`) was increased, say to `128`?
Member

Increasing the buffer size would be fine, but this can just use a dynamic size.

Increasing the buffer size would be fine, but this can just use a dynamic size.
Member

Created a pull request and triggered test-builds. Once done they are available here. Could you let me know if this works as expected?

Created a pull request and triggered test-builds. [Once done](https://builder.blender.org/admin/#/builders/136/builds/2409) they are available [here](https://builder.blender.org/download/patch/PR111979/). Could you let me know if this works as expected?
Author
Member

I can’t read Georgian but it looks like it’s working!

I can’t read Georgian but it looks like it’s working!
Blender Bot added
Status
Resolved
and removed
Status
Needs Info from Developers
labels 2023-09-12 14:47:57 +02:00
Sign in to join this conversation.
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
4 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#111927
No description provided.