Translations of custom property in .desktop file

View: New views
2 Messages — Rating Filter:   Alert me  

Translations of custom property in .desktop file

by Bugzilla from alexanderrieder@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
In Cantor (kdeedu), I'm offering a button that launches a webbrowser, pointing
to the documentation page for the backend. The information of the url is read
from the desktop file, using a custom X-Cantor-HelpUrl property. My question
is: Is it possible to make this property translateable, so it can point to the
right documentation url for each language? Or shouldn't I store the Url in the
desktop file?

thanks,
Alexander

Re: Translations of custom property in .desktop file

by Albert Astals Cid-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A Diumenge, 8 de novembre de 2009, Alexander Rieder va escriure:
> Hi,
> In Cantor (kdeedu), I'm offering a button that launches a webbrowser,
>  pointing to the documentation page for the backend. The information of the
>  url is read from the desktop file, using a custom X-Cantor-HelpUrl
>  property. My question is: Is it possible to make this property
>  translateable, so it can point to the right documentation url for each
>  language? Or shouldn't I store the Url in the desktop file?

There is automatic translation for these fields in desktop files Name,
Comment, Language, Keywords, About, Description, GenericName, Query,
ExtraNames, X-KDE-Submenu

Maybe you could reuse the Query field?

On the other hand you may well make it part of your plugin API with something
like

virtual QString documentationUrl() const = 0;

and then each backend can just do

QString MyBackend::documentationUrl() const
{
        return i18nc("the url to the documentation of my, please check if there is a
my translation for doc and use the correct url",
"http://this.is.a.cool.url/to/my/language/doc");
}

Albert

>
> thanks,
> Alexander
>