Plugin language strings / translation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Plugin language strings / translation

xnakos
Hi, guys! A couple of months ago I started helping with the Greek translation of LibreCAD and at some point wondered about the translation of plugins. What is the status of it? Are the plugin language strings included in the language files? I think this is a question for Rallaz, right?
Reply | Threaded
Open this post in threaded view
|

Re: Plugin language strings / translation

LordOfBikes
Administrator
Hi,

this is matter of Ries, as dxli told me.

I have finished the german translation couple of weeks ago and will try to contact Ries about that.

The progress from the pootle server should be pulled back to github and the a new lupdate should bring new food for the translators then.

I'm not sure if the plugins are taken in account, but I will check this.

Generally I think it would be an asset if we can include the latest translations in view of final release 2.0.0.
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Plugin language strings / translation

xnakos
Greetings, My Lord! ;-)

I looked into it a couple of betas ago. The plugin language strings were totally absent from the language files, and as a result the plugins could not be translated. This was due to the fact that the .pro file of the plugins (if I remember correctly) did not link to the plugin code, as far as the translations were concerned (so that the tr() arguments could be extracted and put in the translation files). I had a pull request almost ready, but then I wondered whether the plugin translations should be together with the base translations or separate from the base/core translations. If you could contact Ries, it would be great. Do you know if there is going to be a release candidate, or something like that, so that we will know the final language strings, in order to finish / touch up the translations?
Reply | Threaded
Open this post in threaded view
|

Re: Plugin language strings / translation

LordOfBikes
Administrator
Hi,

that was, what I thought to remember too, that the plugin strings are not included because of the project file logic.
I was tempted to change this, but got also stuck by the question if it is the right way. As I said, I will check this with Ries and keep you up to date.

The first release candidate was tagged this weekend by dxli. Installers for Windows and Mac can be downloaded from SourceForge.net, see this forum post:
   http://forum.librecad.org/dimensions-reading-between-librecad-and-other-softwares-tp5708262p5708278.html

If we get the translation update done, a new release candidate 2.0.0rc2 could be tagged.
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Plugin language strings / translation

xnakos
Thanks for your effort and the info! I believe that the most correct way (in terms of consistency and scalability - keeping the core translation on its own and not having a file growing every time a new plugin is introduced (in case of having one translation file for all the plugins)) to deal with the plugin translations would be to have a 'ts' directory inside each plugin's directory. For instance,

plugins / sample / ts

keeping each plugin's translation separate. Provided that multiple qm files can be loaded for the current language (which is something that I did not look into - any info on that would be appreciated). This way, the translation for each plugin could be loaded at the time that the plugin is loaded itself.
Reply | Threaded
Open this post in threaded view
|

Re: Plugin language strings / translation

LordOfBikes
Administrator
Hi,

I'm in contact with Ries, but we have to wait till end of next week for further steps. I'll keep you informed.

About the multiple translation files for a single application I don't know yet if this is easy possible, I'll do some investigations concerning this.

Another point are the Qt translation files. Even when all the application strings are translated, there are the Qt standard dialogs, e.g. File open or save, which are in English still. For the most common languages .qm files are included within Qt, but they have to be loaded an distributed with the installer packages. I will look for this issue too.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Plugin language strings / translation

xnakos
Armin, hi!

Thanks for the report! After some playing around, I really cannot say if loading multiple qm files for the same language is even possible. But I believe there is an alternative solution, that would require less coding and just a bit more scripting. The 'lconvert' tool from the qt linguist pack. This seems to be able to merge ts (or qm) files and create a single one to be loaded. So, separate translation files could exist for different parts, for plugins for instance, merging of which could happen later on. Have that in mind too.
Reply | Threaded
Open this post in threaded view
|

Re: Plugin language strings / translation

Vane
In reply to this post by xnakos
For best plugin strings translations I suggest you use this new tool: https://poeditor.com. Since I discovered it I haven't stopped using it, it has a simple interface and useful features such as automatic translation or translation memory.
Reply | Threaded
Open this post in threaded view
|

Re: Plugin language strings / translation

Ilkos
In reply to this post by xnakos
From Help:

void QCoreApplication::installTranslator ( QTranslator * translationFile ) [static]
Adds the translation file translationFile to the list of translation files to be used for translations.
Multiple translation files can be installed. Translations are searched for in the reverse order in which they were installed, so the most recently installed translation file is searched first and the first translation file installed is searched last. The search stops as soon as a translation containing a matching string is found.
Installing or removing a QTranslator, or changing an installed QTranslator generates a LanguageChange event for the QCoreApplication instance. A QApplication instance will propagate the event to all toplevel windows, where a reimplementation of changeEvent can re-translate the user interface by passing user-visible strings via the tr() function to the respective property setters. User-interface classes generated by Qt Designer provide a retranslateUi() function that can be called.
Reply | Threaded
Open this post in threaded view
|

Re: Plugin language strings / translation

LordOfBikes
Administrator
So,

after including the Qt language files for the standard dialogues a couple of weeks ago, I finally included the plugins for translation.

There is one common file for all plugins now in the plugins/ts folder. Please find the TS file on the pootle translation server in your language LibreCAD/plugins folder for translation.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution