From kde-i18n-doc Mon Apr 13 20:55:35 2015 From: Albert Astals Cid Date: Mon, 13 Apr 2015 20:55:35 +0000 To: kde-i18n-doc Subject: Re: Bad extraction in battery applet, probably due to using C++ input language for QML code Message-Id: <129911198.sCa2oPRsTt () xps> X-MARC-Message: https://marc.info/?l=kde-i18n-doc&m=142895855326219 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