locale specific for .desktop

Rodney Dawes dobey.pwns at gmail.com
Thu Oct 4 11:36:54 PDT 2007


On Thu, 2007-10-04 at 18:52 +0200, Sanel Zukan wrote:
> > There are a number of locale specific problems for .desktop spec.
> > 
> > #1. Language specific launcher options.
> > I'ld like to switch the command options by languages.
> > 
> > E.g.
> > Name=Document
> > Exec=gnome-open file:/usr/share/doc/foo/C/index.html
> > Exec[de]=gnome-open file:/usr/share/doc/foo/de/index.html
> > Exec[fr]=gnome-open file:/usr/share/doc/foo/fr/index.html
> > 
> > How about locale executions?
> 
> This proposal has it's place, but here is mine -1 for it :) IMHO this
> opens a huge door for more abuse for Exec key, so anyone could place
> something like:
> 
>  Exec[de]=/usr/local/bin/foo
>  Exec[fr]=/usr/bin/baz
> 
> which creates inconsistency. Already hearing people asking why their
> German colleagues opens this but they are getting that.
> 
> Hm... just thinking, could some shell script resolve this ?

The only viable reasons for this that I can see, are documentation, and
document templates. The former is solved by integrating the
documentation into the help system. The latter should be solved by the
application opening an appropriate per-language template if necessary.
AbiWord does this already for example.

> > #2. .desktop could be shown on a locale only.
> > I'ld like to show a locale specific application on the locale only in gnome-panel menus.
> > 
> > E.g.
> > Name[zh_CN]=Application Name
> > Comment[zh_CN]=Application Comment
> > Exec=/usr/bin/zh_CN-application
> > 
> > How about removing C Name?

Why would the C name need to be removed?

> Isn't this the same as above?

The feature isn't. The implied suggested implementation is. The better
solution for this would be an OnlyShowInLang, that is similar to
OnlyShowIn for desktops.

> > #3. Filename encoding.
> > I'ld like to keep Encoding=UTF-8 but the actual filepath could be several encodings.
> > 
> > E.g.
> > Encoding=UTF-8
> > Name=foo
> > Comment=foo
> > Icon=file:/home/foo/EUC encoding/foo.png
> > 
> > How about URI escape sequences?
> 
> AFAIK, Icon key contains system path, not URI path (wrong ?). On other hand if
> you already using URI path (and application understainds it), at least for me, 
> escape sequences comes naturally :)

Icon really should just be a name, and the icon should be looked up
through the icon theme API. If one is going to put a URI in the file,
and it points to something that is in a non-ascii encoding, it must be
escaped, according to the RFC AFAIK. Doesn't the URI RFC require that
the encoding be US-ASCII?

Either way, if you specify an encoding, and then have data in another
encoding, it's going to break, as there's no way for the implementation
to know what encoding the alternate is.

-- dobey




More information about the xdg mailing list