I18n: translation does not occur when started from a thread which isn’t main #108206

Open
opened 2023-05-23 21:25:24 +02:00 by Damien Picard · 0 comments
Member

System Information
Operating system: Linux-6.2.0-20-generic-x86_64-with-glibc2.37 64 Bits, X11 UI

Blender Version
Broken: version: 3.6.0 Beta

Short description of error
In some circumstances, translation of a message is started from a secondary thread. But before translating, the BLT_translate() function checks that translation can proceed, in the following way:

bool BLT_translate(void)
{
#ifdef WITH_INTERNATIONAL
  return BLI_thread_is_main();
#else
  return false;
#endif
}

The result is that some messages will never be translated. So far I could locate two areas where this happens:

  1. in some geometry nodes socket tooltips, see !107260;
  2. in error reports from the USD exporter.

The decision comes from 2be1d8bbaf, which solves an issue with the boost::locale library (#56770). It is unclear whether this issue was solved since then. The ticket on Boost’s old tracker is here.

The commit did mention at the time:

This may be an annoying limit at some point, but doubt it will be any issue currently.

Exact steps for others to reproduce the error
To reproduce the issue with the USD exporter:

  • Choose a language that was recently translated (Catalan or French) from the User Preferences, after updating the translation MO files if needed

  • Open the attached blend file curve.blend (contains an object with one cyclic curve and one non-cyclic curve, which is unsupported by USD).

  • Export the object to USD

  • The following message appears: "Cannot export mixed cyclic and non-cyclic curves in the same Curves object", untranslated.

  • In BLT_translate(), change return BLI_thread_is_main(); to return true; and rebuild

  • Export the object again

  • The message appears again, but it is now translated.

**System Information** Operating system: Linux-6.2.0-20-generic-x86_64-with-glibc2.37 64 Bits, X11 UI **Blender Version** Broken: version: 3.6.0 Beta **Short description of error** In some circumstances, translation of a message is started from a secondary thread. But before translating, the `BLT_translate()` function checks that translation can proceed, in the following way: ```c bool BLT_translate(void) { #ifdef WITH_INTERNATIONAL return BLI_thread_is_main(); #else return false; #endif } ``` The result is that some messages will never be translated. So far I could locate two areas where this happens: 1. in some geometry nodes socket tooltips, see !107260; 2. in error reports from the USD exporter. The decision comes from 2be1d8bbaf, which solves an issue with the boost::locale library (#56770). It is unclear whether this issue was solved since then. The ticket on Boost’s old tracker is [here](http://trac.cpp.al/trac10/ticket/6320). The commit did mention at the time: > This *may* be an annoying limit at some point, but doubt it will be any issue currently. **Exact steps for others to reproduce the error** To reproduce the issue with the USD exporter: - Choose a language that was recently translated (Catalan or French) from the User Preferences, after updating the translation MO files if needed - Open the attached blend file [curve.blend](/attachments/e2f7219d-bf82-4844-a13f-d7f7b1a443a3) (contains an object with one cyclic curve and one non-cyclic curve, which is unsupported by USD). - Export the object to USD - The following message appears: "Cannot export mixed cyclic and non-cyclic curves in the same Curves object", untranslated. - In `BLT_translate()`, change `return BLI_thread_is_main();` to `return true;` and rebuild - Export the object again - The message appears again, but it is now translated.
Damien Picard added the
Type
Bug
Module
User Interface
Interest
Translations
labels 2023-05-23 21:25:25 +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
1 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#108206
No description provided.