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

List:       kde-core-devel
Subject:    Re: [otaylor@redhat.com: .desktop files and encodings]
From:       Owen Taylor <otaylor () redhat ! com>
Date:       2001-02-28 20:06:14
[Download RAW message or body]


David Faure <david@mandrakesoft.com> writes:

> On Wednesday 28 February 2001 18:31, Navindra Umanee wrote:
> > 
> > Hi, Owen sent this patch for the Desktop Entry Spec to the xdg list.
> > I don't know enough to understand the ramifications of such a patch
> > for KDE.  
> > 
> > Could someone look into it?
> 
> This change to the standard looks ok to me - especially if nobody expects
> KDE to support the Legacy-Mixed encodings (strange name, we call that 
> "locale-8-bit" :)

It's explicitly optional in the spec, because it is pretty hideous. 

Since gnome-1.4 probably won't have support for UTF-8 encoding (Sigh,
but we don't have an XP framework for encoding conversion in a place
we can depend on for this), it might be _nice_ if someone coded the
support for Legacy-Mixed for KDE, but I certainly don't expect it. :-)

The reason why I like a name like "locale-8-bit" less is that it isn't
a file encoded in the encoding of the locale; it is a file with
mixed encodings that depend on the language tags. (If the current
locale is "de_DE.utf8", the encoding of a [de] line is still
ISO-8859-1)

8-bit also has has some implication that multi-byte encodings aren't
included. However, I don't care much about the name; I just wanted to
indicate that it a) it was a mix of encodings b) its nothing that
people should have to worry about long-term (Hence "Legacy".)

> The one change it means for KDE, is to add
> Encoding=UTF-8 
> to all the desktop files it creates.
> Shouldn't be too hard, I'll look into that.
> 
> Another missing bit in KDE would be to recognize
> Name[de_DE] and prefer it over Name[de].

That's in there - both expressed formally and with an example:

===
Keys may be postfixed by [<locale>], where <locale> is the LOCALE type
of the entry.  <locale> must be of the form lang[_COUNTRY][.ENCODING],
where either _COUNTRY or .ENCODING may be omitted. If a postfixed key
occurs, the same key must be also present without the postfix.

When reading in the desktop entry file, the value of the key is
selected by matching the current POSIX locale for the LC_MESSAGES
category against the <locale> postfixes of all occurrences of the key,
with the .ENCODING part stripped. (The .ENCODING is used when the
Encoding key for the desktop entry file is Legacy-Mixed, see section
5.)

The matching is done as follows: if the current value of LC_MESSAGES is
<lang>_<country>.<encoding>@<modifier>, then, if a key for
<lang>_<country> is present, it will be used. Otherwise, if a key for
<lang> is present, it will be used. If both of these are missing, the
required key without a locale specified is used. The encoding and
modifier from the LC_MESSAGES value are ignored.

For example, if the current value of the LC_MESSAGES category
is de_DE, and the desktop file includes:

 Name=Foo
 Name[de]=Foo auf Deutsch

Then the value used for the name key will be 'Foo auf Deutsch'. However,
if a value is specified for Name[de_DE], then that will be used instead.
===

Regards,
                                        Owen 

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

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