dglent / meteo-qt

System tray application for weather status information
GNU General Public License v3.0
82 stars 21 forks source link

Translations: Unable to test meteo-qt_it.qm #147

Closed stefonarch closed 4 months ago

stefonarch commented 4 months ago

I'd like to update some italian translations, edited the .ts file with Qlinguist and released meteo-qt_it.qm. Copying to /usr/share/meteo-qt/translations/ had no effect, still the old (some of them wrong) were displayed. Even deleting /usr/share/meteo-qt/translations/ meteo-qt_it.qm doesn't have any effect.

I tried to compile meteo-qt directly but it fails to start on arch, only AUR is working.

What am I missing?

In the closed issues I found a dead link to transifex. We could eventually add meteo-qt to the LXQt Weblate platform.

dglent commented 4 months ago

How you proceed , you copy only the meteo-qt_it.ts or you compile it to meteo-qt_it.qm ? The meteo-qt_it.ts will not work you need to compile it to meteo-qt_it.qm with the command:

"Beeing in the folder where you have placed the translated meteo-qt_it.ts"

lrelease meteo-qt_it.ts -qm meteo-qt_it.qm

Then you place the generated meteo-qt_it.qm in the folder "/usr/share/meteo_qt/translations" The command lrelease i don't know exactly in which package is in arch, in Mageia is in the "qttols5" "qttools5:/usr/lib64/qt5/bin/lrelease"

And you have to use the meteo-qt_it.ts of your installation ! For this, you can download the archive of your version from here: https://github.com/dglent/meteo-qt/releases

stefonarch commented 4 months ago

How you proceed , you copy only the meteo-qt_it.ts or you compile it to meteo-qt_it.qm ?

I edit with QtLinguist, and I use the menu item "Release" which creates the .qm file. But as I said, even deleting /usr/share/meteo-qt/translations/ meteo-qt_it.qm doesn't have any effect, but searching for meteo-qt I found that/usr/lib/python3.12/site-packages/meteo_qt/translations/meteo-qt_it.qm is the correct location, the files installed under /usr/share/meteo-qt/translations are not considered.

Closing and continuing to translate, will make a PR later.

dglent commented 4 months ago

Ah i see you have right i didn't think about this. And i don't remember exactly why we have them in two places. I remember that i wanted to be able to use translations when the app is installed and if you run it as standalone from a folder ... I see here that it checks both places: https://github.com/dglent/meteo-qt/blob/d21bdba050d54a390147e8b69e7cada3489b7c55/meteo_qt/meteo_qt.py#L3087

dglent commented 4 months ago

Yes maybe LXQt Weblate platform is a better solution finally, i have no objection

stefonarch commented 4 months ago

Yes maybe LXQt Weblate platform is a better solution finally, i have no objection

While adding it I see that there is no empty template translations/meteo-qt.ts ~so all translations look like 100%~ using meteo-qt_en.ts doesn't work as it's translated too.

https://translate.lxqt-project.org/projects/dglent/meteo-qt/

Could you add an empty template?

dglent commented 4 months ago

Thank you! The English file is used as the template file

stefonarch commented 4 months ago

I got an error as usual the template is without language extensions, but managed to filter it out. All should be fine now.

dglent commented 4 months ago

Thank you @stefonarch , i need to find out now the process to synchronize the translations, i suppose something similar with tx api of transifex

stefonarch commented 4 months ago

Weblate pulls from time to time and will create a PR (using LXQt-bot). I will trigger one now. Usually if an user adds an empty template for a new language a PR is sent immediately, so just wait until it looks complete to you.

dglent commented 4 months ago

Ah Ok, great !