Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continue translation support #211

Merged
merged 5 commits into from
Mar 12, 2024
Merged

Conversation

hasecilu
Copy link
Contributor

@hasecilu hasecilu commented Mar 10, 2024

On top on previous work made by @Kuzma30 here are some advancements.

I think the progress made until now is enough for a first attempt to translate the workbench.

There are hundreds of more strings that could be also translated but since all of them are sparsed around the code would be very hard to catch'em all any time soon.

  • 256 QtGui.QMessageBox.X(), 178 on .py files, 120 uncommented.
  • 1443 say()
  • 178 PrintMessage()
  • 177 PrintWarning()
  • 80 PrintError()

Meanwhile @kaktusus and me tested the translations on Crowdin, so officially supporting it would be very beneficial because in case of minor changes, typo fixes, etc, we can reuse strings and more fellow translators can start testing.

  • For most of the strings translate("Context", "string") was used.
  • For commands names and tooltips QT_TRANSLATE_NOOP() worked fine, I'm not 100% sure why using it everywhere don't work but as of now the instenaces of it works fine.
  • One-line strings are easy, but for multi-line strings check hlp.py file for example. It seems that only HTML notation modifies the text aspect, for example using \n in multiline strings normanlly would make a new line (tested in other WB) but it seems that only <br> achieves that in this WB.
  • If you identify another UI file that is not being used it's better to remove it from bash script.

https://forum.freecad.org/viewtopic.php?t=85949

Related #142
Close #173

@easyw
Copy link
Owner

easyw commented Mar 11, 2024

@hasecilu
please check this error:

Running the Python command 'ksuToolsConstrainator' failed:
Traceback (most recent call last):
  File "C:\Users\userC\AppData\Roaming\FreeCAD\Mod\kicadStepUpModTranslationTest\.\kicadStepUpCMD.py", line 2018, in Activated
    ui.setupUi(CDialog)
  File "C:\Users\userC\AppData\Roaming\FreeCAD\Mod\kicadStepUpModTranslationTest\.\kicadStepUpCMD.py", line 736, in setupUi
    self.Label_howto.setToolTip(translate("Ui_CDialog", "Select a Sketch and Parameters\n"

name 'translate' is not defined

and

Running the Python command 'ksuToolsMoveSketch' failed:
Traceback (most recent call last):
  File "C:\Users\userC\AppData\Roaming\FreeCAD\Mod\kicadStepUpModTranslationTest\.\kicadStepUpCMD.py", line 1032, in Activated
    ui.setupUi(offsetDlg)
  File "C:\Users\userC\AppData\Roaming\FreeCAD\Mod\kicadStepUpModTranslationTest\.\kicadStepUpCMD.py", line 656, in setupUi
    Offset_value.setWindowTitle(translate("Ui_Offset_value", "Offset value"))

name 'translate' is not defined:43  Running the Python command 'ksuToolsMoveSketch' failed:
Traceback (most recent call last):
  File "C:\Users\userC\AppData\Roaming\FreeCAD\Mod\kicadStepUpModTranslationTest\.\kicadStepUpCMD.py", line 1032, in Activated
    ui.setupUi(offsetDlg)
  File "C:\Users\userC\AppData\Roaming\FreeCAD\Mod\kicadStepUpModTranslationTest\.\kicadStepUpCMD.py", line 656, in setupUi
    Offset_value.setWindowTitle(translate("Ui_Offset_value", "Offset value"))

name 'translate' is not defined

hasecilu and others added 3 commits March 11, 2024 08:13
- Script to get strings from code and UI files
- Add toolbars, menus,
- The base `ksu.ts` file is updated to have the new context groups
  and to have the correct location path, this is useful to show code
  in Qt Linguist to help on translation.
- TranslateUtils.py to define `translate()`
- Fix some typos
- Fix some capitalizations
- Fix some contexts
- Some UI translations are overriden via code, mark those strings
  for translation
- Remove ' notr="true"' from some strings be available for translation
  on UI files

Co-authored-by: kaktus Jacek <39754351+kaktusus@users.noreply.github.com>
Added es-ES translations

Co-authored-by: EdgarJRobles <tgo.edrobles@gmail.com>
Co-authored-by: kaktus Jacek <39754351+kaktusus@users.noreply.github.com>
@hasecilu
Copy link
Contributor Author

hasecilu commented Mar 11, 2024

Ooops, it seems I forget to include it.

Also I removed ksu_prefs-v1.ui , ksu_prefs-v2b.ui , offset_selection.ui , offset_selection-v2.ui, layer-selection-out.ui & layer-selection.ui files from script.
Could you check again.

@easyw easyw merged commit 5e83583 into easyw:master Mar 12, 2024
@easyw
Copy link
Owner

easyw commented Mar 12, 2024

thank you all for this great contribution 😄

@hasecilu
Copy link
Contributor Author

hasecilu commented Mar 12, 2024

Now to continue the translation efforts to more languages would you like KiCadStepUp WB to be added to Crowdin platform? where 5 other WB have been added very recently and waiting for a few more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

translation GUI of the kicadStepUp workbench
4 participants