Add localization to the local file KCM
ClosedPublic

Authored by yurchor on Aug 2 2017, 6:28 AM.

Details

Summary

Some parts of Elisa are unlocalizable now. This patch tries to fix this.

The patch was created by Victor <victorr2007@yandex.ru>

Test Plan

Because of the oldish Qt (5.6.2) only extraction was tested on my machine.

Diff Detail

Repository
R255 Elisa
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
yurchor created this revision.Aug 2 2017, 6:28 AM

Thanks for your patch. I will test later but I have a question. Is the second extractor script really the way to go ? Is it not better to have everything in one ?
I will also check that the qml ui really gets translated.

Is the second extractor script really the way to go ? Is it not better to have everything in one ?

Sure, it can be squashed with the current Messages.sh file. It is just a matter of discussion what is the better way for Elisa team.

I have no preference as long as it works and is similar to other kde software.
Thanks again for your help

Are the strings captured also by the existing Messages.sh?

Are the strings captured also by the existing Messages.sh?

H-m-m... Yes, they are. So, would it be enough just add i18n()?

mgallien requested changes to this revision.Aug 2 2017, 10:42 AM

I was reading https://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_Systems#Extracting_and_merging_messages about qml ui loaded via a package (kpackage). It seems the catalog should be called plasma_package_<catalog name>. Could you modify your patch according to this ?
I will test later today and report here (if nothing interrupt me).
Thanks again

This revision now requires changes to proceed.Aug 2 2017, 10:42 AM
yurchor updated this revision to Diff 17557.Aug 2 2017, 11:12 AM
yurchor edited edge metadata.

Trying to combine the proposals: remove separate translation catalog to avoid double extraction.

Must be horribly wrong because -DTRANSLATION_DOMAIN= is for libraries.

I gave a look at the kcm in plasma-pa project. It is alos done with a qml UI.
The catalog should be named after the name of the desktop file of the kcm. If one does that, the translations are loaded in the qml UI files.
Could you modify your patch to generate a catalog specific to the kcm with the name kcm_elisa_local_file ?

yurchor updated this revision to Diff 17608.Aug 3 2017, 5:30 AM

No changes to CMakeLists.txt (as it is expected to work as is), still double extraction (can be excluded with 'grep -v localFileConfiguration'-pipe in the main Messages.sh, but looks unpractical if further KCMs will be added).

lueck added a subscriber: lueck.Aug 4 2017, 12:05 PM

works for me in locale x-test/zu, please push
thanks

This revision was automatically updated to reflect the committed changes.