How is *.ts Crowdin files makes and FEM workbench translation anomaly.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
How is *.ts Crowdin files makes and FEM workbench translation anomaly.
It generated by scripts or maked manually? Why strings position aslo not syncronized with sourcecode?
Last edited by Evgeniy on Sat Sep 25, 2021 1:22 pm, edited 1 time in total.
Re: How is *.ts Crowdin files makes?
The TS files are generated by updatets.py (heads-up that that file is currently being worked on, you can see the PR with the revision in PR 5037).
Re: How is *.ts Crowdin files makes?
After that, they need to be committed to master, correct?
"fight the good fight"
Re: How is *.ts Crowdin files makes?
There's really a whole process that you can see via the updatecrowdin.py script. The base TS files are created and uploaded to CrowdIn, translators do their thing, then the completed translations are pulled down and committed. I don't know if we commit the first set of TS files, since we use the Python script to push directly to CrowdIn from the local working copy. Yorik or Kunda1 will know.
yorik wrote: *
Kunda1 wrote: *
Re: How is *.ts Crowdin files makes?
If any text in the *.cpp file is changed? Translate will be lost?
Re: How is *.ts Crowdin files makes?
Only that single changed string is lost, but yes, my understanding is that if we make any change to a translated string in the source code, translators get prompted to re-translate that string.
Re: How is *.ts Crowdin files makes?
Is it possible to somehow bind strings to some identifiers so that the translation is saved when the source string is changed?
I still don't understand how the strings go from source code into Crowdin
Is there some kind of scanner program of *.cpp *.py *.ui?
If this scaner application exist why are not all the lines available for translation in Crowdin? For example, this piece is not presnted inn Crowdin:
https://github.com/FreeCAD/FreeCAD/blob ... ch.cpp#L50
Where can I view the *.pro files of the FreeCAD project?
I still don't understand how the strings go from source code into Crowdin
Is there some kind of scanner program of *.cpp *.py *.ui?
If this scaner application exist why are not all the lines available for translation in Crowdin? For example, this piece is not presnted inn Crowdin:
https://github.com/FreeCAD/FreeCAD/blob ... ch.cpp#L50
Code: Select all
qApp->translate("Workbench", "FEM");
qApp->translate("Workbench", "&FEM");
//
qApp->translate("Workbench", "Model");
qApp->translate("Workbench", "M&odel");
qApp->translate("Workbench", "Materials");
qApp->translate("Workbench", "&Materials");
qApp->translate("Workbench", "Element Geometry");
qApp->translate("Workbench", "&Element Geometry");
qApp->translate("Workbench", "Electrostatic Constraints");
qApp->translate("Workbench", "&Electrostatic Constraints");
qApp->translate("Workbench", "Fluid Constraints");
qApp->translate("Workbench", "&Fluid Constraints");
qApp->translate("Workbench", "Geometrical Constraints");
qApp->translate("Workbench", "&Geometrical Constraints");
qApp->translate("Workbench", "Mechanical Constraints");
qApp->translate("Workbench", "&Mechanical Constraints");
qApp->translate("Workbench", "Thermal Constraints");
...
Re: How is *.ts Crowdin files makes?
Better links:chennes wrote: ↑Sat Sep 25, 2021 12:33 pm Have a look at https://doc.qt.io/qt-5/qtlinguist-index.html
https://doc.qt.io/qt-5/qtlinguist-hellotr-example.html
https://doc.qt.io/qt-5/i18n-source-translation.html
I'm look any doc's about QT translation, but im real not understand:
We have Command.cpp https://github.com/FreeCAD/FreeCAD/blob ... ommand.cpp
And we have updates.py https://github.com/FreeCAD/FreeCAD/blob ... pdatets.py
As far as I understood, lupdate utility used in updates.py should be automatilly extract all translatable strings from Command.cpp and save it in Fem.ts file. And then *.ts must somehow going into Crowdin.
But part of strings from Command.cpp is not presented Crowdin.
My question is: Why?
For this reason, it is not possible to translate part of the commands of the Fem workbench.
For exmple this part is not presented in Fem.ts:
Download fresh Fem.ts file of any language open it in notepad and find "Constraint contact" and you not find anything.CmdFemConstraintContact::CmdFemConstraintContact()
: Command("FEM_ConstraintContact")
{
sAppModule = "Fem";
sGroup = QT_TR_NOOP("Fem");
sMenuText = QT_TR_NOOP("Constraint contact");
sToolTipText = QT_TR_NOOP("Creates a FEM constraint for contact between faces");
Open Crowdin site and find "Constraint contact" in Fem.ts page and you not find anything.
Accordingly, this command and others too, cannot be translated into other languages.
Why did lupdate skip this?
Re: How is *.ts Crowdin files makes and FEM workbench translation anomaly.
That's the bug that's addressed by PR 5037 -- because FEM has both Python and C++, only the Python strings were being updated.