Translating external workbenches

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Translating external workbenches

Post by Kunda1 »

EdgarRobles wrote: Tue May 05, 2020 3:42 am dodo workbench is fully translated to spanish
Wait what? How did I miss this news?
So these instructions would work for other external workbenches?
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
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Translating external workbenches

Post by Kunda1 »

yorik wrote: Wed May 20, 2020 8:16 am Excellent! If you are interested, I would advise you to create a main .ts file (without language code in it), and add it to https://crowdin.com/project/freecad-addons (send me your crowdin username and I'll give you access rights). Then FreeCAD translators can then easily find it. When you have access right, you also have access to the crowdin API and automate all the process of uploading/retrieving translations, check the translation scripts I did for the BIM WB at https://github.com/yorikvanhavre/BIM_Wo ... ster/utils
Ok we need to write documentation for this and make it prominent for Addon devs to see it. Anyone want to help me?
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
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Translating external workbenches

Post by Kunda1 »

Kunda1 wrote: Wed Feb 10, 2021 2:34 pm
yorik wrote: Wed May 20, 2020 8:16 am Excellent! If you are interested, I would advise you to create a main .ts file (without language code in it), and add it to https://crowdin.com/project/freecad-addons (send me your crowdin username and I'll give you access rights). Then FreeCAD translators can then easily find it. When you have access right, you also have access to the crowdin API and automate all the process of uploading/retrieving translations, check the translation scripts I did for the BIM WB at https://github.com/yorikvanhavre/BIM_Wo ... ster/utils
Ok we need to write documentation for this and make it prominent for Addon devs to see it. Anyone want to help me?
Does every external workbench need to load ...?

Code: Select all

from PySide.QtCore import QT_TRANSLATE_NOOP
from DraftGui import translate
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
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Translating external workbenches

Post by yorik »

User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Translating external workbenches

Post by Kunda1 »

yorik wrote: Fri Feb 12, 2021 1:22 pm https://wiki.freecadweb.org/Translating ... _workbench
But it still needs some work...
Yorik, perhaps we should consider @vocx's refinements at https://github.com/shaise/FreeCAD_Sheet ... -546412627
I like how he assumes that he adds the conditional:

Code: Select all

if App.GuiUp:
which is cool because it's future friendly toward running FC headless but still translated.
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
User avatar
Evgeniy
Posts: 477
Joined: Thu Jul 15, 2021 6:10 pm

Re: Translating external workbenches

Post by Evgeniy »

Do I understand correctly that to start translating the FreeCAD interface, i need to register
here -->> https://crowdin.com/project/freecad/ru
Or is it done by another way?
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Translating external workbenches

Post by Kunda1 »

Evgeniy wrote: Mon Jul 26, 2021 6:59 pm Do I understand correctly that to start translating the FreeCAD interface, i need to register
here -->> https://crowdin.com/project/freecad/ru
correct
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
KAKM
Posts: 112
Joined: Tue May 04, 2021 12:17 am

Re: Translating external workbenches

Post by KAKM »

This wiki page https://wiki.freecadweb.org/Translating ... n_.py_file recommends I load the translate function using

Code: Select all

from FreeCAD.Qt import translate
but it threw a Module Not Found Error. Is there something else I need to import first?
User avatar
chennes
Veteran
Posts: 3914
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Translating external workbenches

Post by chennes »

Yeah, I think that's not quite correct there in the Wiki. What you really need is:

Code: Select all

from FreeCAD import Qt
Qt.translate("context","text")
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
Roy_043
Veteran
Posts: 8580
Joined: Thu Dec 27, 2018 12:28 pm

Re: Translating external workbenches

Post by Roy_043 »

AFAICT the context for (sub)menu names and toolbar names should always be "Workbench". I have changed the Translating_an_external_workbench page accordingly.

Since the same information also applies to 'internal' workbenches, the page should perhaps be renamed?:
Translating_a_Workbench
Post Reply