Is it possible to import updated translations from Crowdin into an already installed FreeCAD ?

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Post Reply
Evgeniy
Posts: 341
Joined: Thu Jul 15, 2021 6:10 pm

Is it possible to import updated translations from Crowdin into an already installed FreeCAD ?

Post by Evgeniy »

For example, i want to test new translations from Crowdin: see how it look and how text is located on forms, check functions etc...
And i don't want compile freecad (that is it's hard and long in time on windows).
I can't download the archive with translations, when the archive is being collected by Yorik.
But i can download new *.ts files one by one from Crowdin.
And my question is. Is it possible to import updated *.ts translations from Crowdin into an already installed FreeCAD? (maybe that possible with convertation to other QT Linguist formats) ?

I'm look this scripts:
https://wiki.freecadweb.org/Crowdin_Scripts
But there seems to be no such thing.
User avatar
chennes
Veteran
Posts: 2445
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Is it possible to import updated translations from Crowdin into an already installed FreeCAD ?

Post by chennes »

You can find those scripts in the source distribution:
https://github.com/FreeCAD/FreeCAD/tree ... /src/Tools
Chris Hennes
Pioneer Library System
Evgeniy
Posts: 341
Joined: Thu Jul 15, 2021 6:10 pm

Re: Is it possible to import updated translations from Crowdin into an already installed FreeCAD ?

Post by Evgeniy »

chennes wrote: Sun Aug 22, 2021 7:35 pm You can find those scripts in the source distribution:
https://github.com/FreeCAD/FreeCAD/tree ... /src/Tools
https://github.com/FreeCAD/FreeCAD/blob ... crowdin.py
This?

I think it need compilation of source code. And I only need to update the translation.

I'm add request to bug tracker https://tracker.freecadweb.org/view.php?id=4733
wmayer
Founder
Posts: 18956
Joined: Thu Feb 19, 2009 10:32 am

Re: Is it possible to import updated translations from Crowdin into an already installed FreeCAD ?

Post by wmayer »

Is it possible to import updated translations from Crowdin into an already installed FreeCAD ?
Yes, this is easily doable. Just put your modified translation files to the sub-directory called translations of FreeCAD's user directory.
You can determine this directory in Python with:

Code: Select all

App.getUserAppDataDir()+"translations/
The files inside this directory will take precedence over the built-in translation files.

However, sometimes it might be tricky to test a certain translation string because it's not obvious from which file it comes from. Therefore git commit 4061c047a0 implements a way to add a file via Python.

First make sure to set the application language to English because this will remove all existing translators and then run this line:

Code: Select all

from FreeCAD import Qt
Qt.installTranslator(App.getUserAppDataDir()+"translations/FreeCAD_fr.qm")
If you are done you should remove the added translators with

Code: Select all

Qt.removeTranslators()
Post Reply