[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: Bad extraction in battery applet, probably due to using C++ input language for QML code
From:       Albert Astals Cid <aacid () kde ! org>
Date:       2015-04-13 20:55:35
Message-ID: 129911198.sCa2oPRsTt () xps
[Download RAW message or body]

El Dimecres, 8 d'abril de 2015, a les 21:51:43, Lasse Liehu va escriure:
> Hi,
> 
> there is one string in the Plasma battery applet that is extracted only
> partly.
> 
> Code is in
> plasma-workspace/applets/batterymonitor/package/contents/ui/PowerManagement
> Item.qml.
> 
> It looks like this:
> 
> PlasmaCore.ToolTipArea {
>     anchors.fill: parent
>     subText: i18n("Disabling power management will prevent your screen
> and computer from turning off automatically.\n\n"
>                   + "Most applications will automatically suppress
> power management when they don't want to have you interrupted.")
> }
> 
> 
> Only the part before the + operator is extracted. That is probably
> because strings in QML code seem to be extracted with C++ as the input
> file language. That is because "-C" exists in XGETTEXT_FLAGS in
> extract-messages.sh. Removing that and letting xgettext guess the
> language depending on the file extension does not help because
> xgettext doesn't recognize the .qml extension.
> 
> It's pretty scary if this can happen in any QML code and gettext
> prints no warning.
> 
> How should this be fixed? Maybe in the short term by not using the +
> operator inside i18n calls in QML, but what about long term? Should
> something be changed in extraction scripts or in gettext? Perhaps
> gettext's language support or at least file extension support should
> be extended, or?

If you can get support for qml inside gettext that'd be great, but looks like 
a big-ish project tbh, anyway the code didn't make sense to begin with so i've 
just removed the +, agreed having a warning would have been nice.

Cheers,
  Albert

> 
> Cheers,
> Lasse Liehu

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic