Translating external workbenches

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
yorik
Site Admin
Posts: 12073
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels, Belgium
Contact:

Translating external workbenches

Postby yorik » Thu May 16, 2019 12:51 am

I just adapted the BIM workbench to be fully translatable, and documented the procedure on https://www.freecadweb.org/wiki/Transla ... _workbench

Now we can spread the word among addon developers! :mrgreen:

I suggest we let the addons developers who wish so to upload their .ts file on the FreeCAD crowdin account, so they can benefit from the massive community of translators there...
galou_breizh
Posts: 325
Joined: Wed Sep 15, 2010 9:38 am

Re: Translating external workbenches

Postby galou_breizh » Sun Jun 02, 2019 9:52 am

Hi Yorik,

thanks for this wiki page! I'll study it and try to adapt it to macros.

Something surprised me though: "Text that is only shown in the Python console should not be translated". If such text should really not be translated, all mentions of "FreeCAD.Console" should also be remove from this wiki page.

Gaël
galou_breizh
Posts: 325
Joined: Wed Sep 15, 2010 9:38 am

Re: Translating external workbenches

Postby galou_breizh » Sun Jun 02, 2019 4:43 pm

Ok, I tried again to adapt this to macros but unsuccessfully despite the fact that I think I have everything what is needed (actually even more because I also compiled a resource file).

My current effort is attached
DxfToSketchLayers.zip
(6.01 KiB) Downloaded 62 times
. To test it, unpack it in FreeCAD's macro folder and launch FreeCAD with `LANG=fr_FR.UTF-8 freecad` or `LANG=fr_FR.UTF-8 freecad-daily`. The associated unfinished documentation is at https://github.com/FreeCAD/FreeCAD-macr ... -in-macros.

Thanks for any help!
Gaël
User avatar
yorik
Site Admin
Posts: 12073
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels, Belgium
Contact:

Re: Translating external workbenches

Postby yorik » Mon Jun 03, 2019 7:22 pm

galou_breizh wrote:
Sun Jun 02, 2019 9:52 am
Something surprised me though: "Text that is only shown in the Python console should not be translated". If such text should really not be translated, all mentions of "FreeCAD.Console" should also be remove from this wiki page.
FreeCAD.Console doesn't print to the Python console, but to the Report window. That's exactly why this is there, translated text goes to the report window, which is where the user would expect to see text made for them to see, while the python console is a technical area, where everything always happens in english and the exact wording can have an impact.

About your file, I'll have a look at it...
galou_breizh
Posts: 325
Joined: Wed Sep 15, 2010 9:38 am

Re: Translating external workbenches

Postby galou_breizh » Sat Jul 27, 2019 7:55 pm

yorik wrote: About your file, I'll have a look at it...
Yorik, I guess you've been very busy but did you manage to have a look a i18n issues with macros?

Thanks at lot!
Gaël
User avatar
rockn
Posts: 1675
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: Translating external workbenches

Postby rockn » Fri Aug 02, 2019 2:26 pm

Hello, i'm trying to translate mooc workbench but i'm unable to get it showing translated sentences.

@yorik
I notice that BIM workbench does not display the translated sentences either.
I've just check the BIM Setup sentences, first lines of https://github.com/yorikvanhavre/BIM_Wo ... /BIM_fr.ts and it remains in english.
Formations et tutoriels FreeCAD en Français, soutenez moi : https://www.tipeee.com/formations-freecad
User avatar
yorik
Site Admin
Posts: 12073
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels, Belgium
Contact:

Re: Translating external workbenches

Postby yorik » Fri Aug 09, 2019 7:35 pm

Sorry for the radio silence! Hectically busy here these days :)

Hm you guys are right... Indeed it still doesn't work for the BIM WB either. There must be something wrong somewhere... I'll do the procedure again and try to fix
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: Translating external workbenches

Postby triplus » Mon Aug 12, 2019 10:46 am

Didn't test it yet but highly likely translations can be provided as external binary resources:

https://forum.freecadweb.org/viewtopic. ... 50#p307202

P.S. Just like when it comes to icon themes.
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: Translating external workbenches

Postby vocx » Sat Sep 28, 2019 6:05 pm

triplus wrote:
Mon Aug 12, 2019 10:46 am
Didn't test it yet but highly likely translations can be provided as external binary resources:

https://forum.freecadweb.org/viewtopic. ... 50#p307202

P.S. Just like when it comes to icon themes.
This is already done. See the Translating an external workbench page again.

The .ts text files that define the strings to translate are compiled into .qm resource files, which are supposed to be loaded by Qt. Or are you suggesting to somehow include all those .ts or .qm inside a single .rcc?
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: Translating external workbenches

Postby triplus » Fri Oct 04, 2019 11:41 am

vocx wrote:
Sat Sep 28, 2019 6:05 pm
Or are you suggesting to somehow include all those .ts or .qm inside a single .rcc?
Yes, that likely would work too.