[kde-doc-english] handling of *.desktop files of plugins

Luigi Toscano luigi.toscano at tiscali.it
Sat Mar 12 11:46:04 UTC 2016


Thomas Eschenbacher ha scritto:
> Hi,
> 
> I recently have ported the plugin system of Kwave to use the KDE
> Services interface. Unfortunately the translated plugin names now can no
> longer be extracted from the source files, instead I have a *.desktop
> file for each plugin.

Hi,
while there is overlap regarding the people dealing with documentation and
translations, this is a question more for kde-i18-doc@ (now in CC:)

> 
> But before I release this change I have some questions:
> 
> Q1: do I have to do something, provide some script or so, to get the
> messages extracted and to get the desktop files updated, or does this
> work "out of the box" by the KDE scripts, maybe by the same magic that
> already handles my <application>.desktop file?
> 

https://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_Systems#Translating_.desktop_Files

Previously discussed here:
http://marc.info/?t=136249526200006&r=1&w=2

> Q2: the files are all named
> "plugins/<name>/kwaveplugin_<name>.desktop.in". Is that ok, are
> *.desktop.in files found, or does the suffix "*.in" prevent this?

See above.

Please note that for Frameworks, even this is still working, you would
probably like to migrate to the Qt-native plugin system.
http://vizzzion.org/blog/2013/08/kde-frameworks-5-plugin-factory-guts/

(we support the translations of json files too).

> 
> Q3: The files will look like this:
> -------------------------------------------------
> [Desktop Entry]
> Encoding=UTF-8
> Comment=Low Pass Filter          <= to be translated
> Comment[de]=Tiefpass-Filter
> Type=Service
> ServiceTypes=Kwave/Plugin
> X-KDE-PluginInfo-Author=Thomas Eschenbacher
> X-KDE-PluginInfo-Name=lowpass    <= not to be translated
> X-KDE-PluginInfo-Version=@KWAVE_VERSION_FULL@:2.3
> X-KDE-PluginInfo-License=GPL
> X-KDE-PluginInfo-EnabledByDefault=true
> -------------------------------------------------
> 
> Is that file format ok, and is it clear that only the "Comment" tag
> should be translated?

See the same code from ktelepathy or other projects, random example:
https://quickgit.kde.org/?p=ktp-text-ui.git&a=blob&h=92df3ba9e4fa00cb1be4f0d97343424c8f8024e3&hb=deafad35a0866ecb335f32144d4c0b1150388afb&f=filters%2Femoticons%2Fktptextui_message_filter_emoticons.desktop.cmake


> 
> Q4: I could easily write a script that extracts the translated messages,
> which currently exist in some *.po file, and puts them into the desktop
> file, so that they are present at first checkin (like in the example
> above). Would these translated tags be kept, or would this be a waste of
> time as they get overwritten by the KDE scripts.

You can do it, sure, but if you don't have it, we can more easily merge the
strings from main po file into the po file which translates the desktop entries.

Ciao
-- 
Luigi




More information about the kde-doc-english mailing list