SpreadSheet "Command" translation
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
SpreadSheet "Command" translation
For what is needs to translate strings with context "Command" and where this text will be displayed?
Is it something to do with programming?
Is it something to do with programming?
Last edited by Evgeniy on Tue Aug 24, 2021 7:29 am, edited 1 time in total.
Re: SpreadSheet "Command" translation
It most likely has to do with the programmer who coded this part of the code didn't add an appropriate context assigned the 'Command' context to it (which is quite common in the source code)
Code: Select all
translate("context", "My text")
Here it is in the code:
Code: Select all
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Clear cell(s)"));
Edit2: It seems like assigning 'Command' in the source as a context is quite common. Not sure why
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: SpreadSheet "Command" translation
Im see this source code on github.
Maybe this is some kind of mistake...
It is not clear why this should be translated.
Maybe this is some kind of mistake...
It is not clear why this should be translated.
Re: SpreadSheet "Command" translation
Oh I see, you think that the 'command' string is part of the translation?? If so then, no it's not!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: SpreadSheet "Command" translation
But in Crowdin are many of them. Look my screenshot in first message.
Code: Select all
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Left-align cell"));
String 290
Code: Select all
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Split cell"));
Code: Select all
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Set underline text"));
Yorik add these lines to Crowdin in December 2020.
But it is not clear for what purpose it is needs translated. And what it is used for. The context of the translation is not clear.
Maybe this for invoke python commands in any languages, but Python code:
Code: Select all
import Spreadsheet
from PySide.QtCore import QT_TRANSLATE_NOOP
FreeCADGui.runCommand(QT_TRANSLATE_NOOP("Command", "Center cell"));
When i tryed to complete the translation of the SpreadSheet, that confused me... Until there is a response from the developers, I think it's better not do the translate.
Last edited by Evgeniy on Tue Aug 24, 2021 6:46 pm, edited 1 time in total.
Re: SpreadSheet "Command" translation
We need a core dev to weigh in on this
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: SpreadSheet "Command" translation
Right -- the fact that it's called "openCommand()" might lead you to think it's trying to run the command that the string represents, in which case definitely the calls to translate would be wrong. But actually it's only using that text as the undo/redo string for the following lines of code. So in this case "Command" as the context is sort of ambiguous, but I don't know what would be better. Maybe we could use the disambiguation string argument to tr()? Does that show in CrowdIn?
Re: SpreadSheet "Command" translation
Yes, it would not hurt to correct the context. Just in case, I post a comment for string with this context in Crowdin.
Re: SpreadSheet "Command" translation
To be clear, I wasn't proposing to change the context (yet): I was suggesting we add an argument to tr(). It has an optional final argument that Qt calls the "disambiguation string". So we could write something like:
Code: Select all
Gui::Command::openCommand(QT_TRANSLATE_NOOP3("Command", "Left-align cell", "For undo/redo menu"));