Incorrect translation context in Sketcher context menu #9584
Closed
chennes
started this conversation in
Code contribution discussions
Replies: 3 comments
-
I would go for option 3. After the release I think it's best to refactor the code and try to get rid of the macro. |
Beta Was this translation helpful? Give feedback.
0 replies
-
3 sounds best to me. That file will see a big refactor during the next development cycle. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Sounds good, I'll code that up. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working on addressing FreeCAD/FreeCAD-translations#219 -- an entire context menu that is basically untranslated. To that end, In TaskSketcherElements.cpp, we have a function...
FreeCAD/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp
Lines 459 to 520 in 063df70
That
CONTEXT_ITEM
macro is defined here:FreeCAD/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp
Lines 65 to 69 in 063df70
The macro calls
tr()
on the menu text, which won't work because the context of each of those commands, when originally created, is defined as the name of the command class itself (e.g. forConstraint_PointOnPoint
it isCmdSketcherConstrainCoincident
, etc.). And because the string is being passed through a macro, Qt's translation extraction won't see it as a new string, so the string MUST already be getting translated elsewhere.There are a few possible solutions, none of them perfectly pleasant:
#if 0
block with all the neededQT_TRANSLATE_NOOP
calls for these strings. Requires duplicating all of the strings, and doubles the translation work (each string will end up getting translated both here and for the CommandConstraints.cpp file).@wwmayer ,@abdullahtahiriyo, it looks like this is mostly your code. How would you prefer I handle it?
Beta Was this translation helpful? Give feedback.
All reactions