D16595: Fix i18n when the kcm code is embedded in the plasmoid config

Albert Astals Cid noreply at phabricator.kde.org
Thu Nov 1 22:40:32 GMT 2018


aacid added a comment.


  In D16595#352466 <https://phabricator.kde.org/D16595#352466>, @broulik wrote:
  
  > This is only covering an underlying problem where `KDeclarative` fails to set the translation context on `QQmlContext` as the engines are shared and it then refuses to set anything on the "internal context". But since I haven't found a solution, perhaps this is better than having non-translated UI
  
  
  Where in kdeclarative/plasma-framework are you trying to set the translation context?
  
  I had a quick look without knowing anything about the architecture and it seems ConfigViewPrivate::init would be the place, but there's nothing there. Or you mean you tried and it didn't work and that's why the code isn't there?
  
  Anyhow the thing is, it can't work, you're using this code "as a library", and what you have to do in library code is hardcode the translation domain since there can only be one "default domain" and obviously that's the applet here and not the kcm (which acts as a library).
  
  The thing is that most of the times in library C++ code we don't see ourselves hardcoding the domain via i18nd calls because we use the -DTRANSLATION_DOMAIN trick to do it for us, but since QML isn't compiled we can't have anything that, so for QML that can show in various processes we need to use i18nd.

REPOSITORY
  R115 Plasma Audio Volume Applet

REVISION DETAIL
  https://phabricator.kde.org/D16595

To: aacid
Cc: broulik, plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20181101/0707297c/attachment-0001.html>


More information about the Plasma-devel mailing list