Load translations from KPackage files if bundled
ClosedPublic

Authored by davidedmundson on Mar 28 2017, 3:25 AM.

Details

Test Plan

Installed battery monitor locally with kpackagetool5 -i
moved x-test .po file from being installed systemwide to only being inside the bundle
still get xx everywhere

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Mar 28 2017, 3:25 AM
Restricted Application added projects: Plasma, Frameworks. · View Herald TranscriptMar 28 2017, 3:25 AM
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript
mart accepted this revision.Mar 28 2017, 8:48 AM
This revision is now accepted and ready to land.Mar 28 2017, 8:48 AM
This revision was automatically updated to reflect the committed changes.
Zren added a subscriber: Zren.Jul 11 2017, 12:50 PM

Oh awesome. Just found out about this. So this would be added in Frameworks 5.37 then?

Does this mean:

  1. digitalclock.plasmoid/translations/plasma_applet_org.kde.plasma.digitalclock.po
  2. digitalclock.plasmoid/contents/translations/plasma_applet_org.kde.plasma.digitalclock.po
  3. digitalclock.plasmoid/translations/fr/LC_MESSAGES/plasma_applet_org.kde.plasma.digitalclock.po
  4. digitalclock.plasmoid/contents/translations/fr/LC_MESSAGES/plasma_applet_org.kde.plasma.digitalclock.po

So adding the domain will load .po files too? Or do they need to be .mo files?

contents/locale/fr/org.kde.blahblah.po

which is the same as KDE4.

contents/locale/fr/org.kde.blahblah.po

which is the same as KDE4.

I guess you mean
contents/locale/fr/org.kde.blahblah.mo
?

Zren added a comment.EditedOct 26 2017, 2:34 AM

This worked

  • ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar/contents/locale/fr_CA/LC_MESSAGES/plasma_applet_org.kde.plasma.eventcalendar.mo

These didn't work

  • ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar/contents/locale/fr_CA/LC_MESSAGES/org.kde.plasma.eventcalendar.mo
  • ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar/contents/locale/fr_CA/LC_MESSAGES/org.kde.plasma.eventcalendar.po
  • ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar/contents/locale/fr_CA/LC_MESSAGES/plasma_applet_org.kde.plasma.eventcalendar.po
  • ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar/contents/locale/fr_CA/org.kde.plasma.eventcalendar.mo
  • ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar/contents/locale/fr_CA/org.kde.plasma.eventcalendar.po
  • ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar/contents/locale/fr_CA/plasma_applet_org.kde.plasma.eventcalendar.po
  • ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar/contents/locale/fr_CA/plasma_applet_org.kde.plasma.eventcalendar.mo

More importantly, contents/locale/fr/* didn't work, which means I need to either copy or symlink to fr_BE, fr_CA, fr_CH, fr_FR, and fr_LU.

Not sure why contents/locale/fr/* didn't work yesterday, but it works today.

Zren added a comment.EditedOct 26 2017, 2:49 AM

Another note: plasmoidviewer is unaffected by this patch. Meaning

  • devpath/contents/locale/fr_CA/LC_MESSAGES/plasma_applet_org.kde.plasma.eventcalendar.mo

will not show translations in plasmoidviewer, but if you install to

  • ~/.local/share/locale/fr_CA/LC_MESSAGES/plasma_applet_org.kde.plasma.eventcalendar.mo
  • ~/.local/share/locale/fr/LC_MESSAGES/plasma_applet_org.kde.plasma.eventcalendar.mo
  • /usr/share/locale/fr_CA/LC_MESSAGES/plasma_applet_org.kde.plasma.eventcalendar.mo
  • /usr/share/locale/fr/LC_MESSAGES/plasma_applet_org.kde.plasma.eventcalendar.mo

it will work in plasmoidviewer.