i18n (was: Re: A draft for a standard for desktop configuration)
Philip Van Hoof
spam at pvanhoof.be
Tue Sep 20 22:56:42 EEST 2005
On Thu, 2005-09-15 at 01:52 +0200, Christian Neumair wrote:
Thanks Christian,
I've put this on TODO for the specification. I'm searching for examples
and other DTD/XSD's that have implemented something like this.
If you can point me to samples, that would be great.
This example is, however, very useful.
> I'm not covering setlocale in detail here, which is a basic i18n
> prerequisite. In short, in main (), you need
>
> setlocale(LC_ALL, "" );
>
> In the memory representation of the schema, which would be:
>
> typedef struct {
> ...
> char *gettext_domain;
> char *gettext_directory;
> } DConfSchema;
>
> you should - upon parsing <gettext-domain/> and <gettext-directory/> set
> the fields to its corresponding values. I'm not sure whether a DTD can
> enforce to have a particular node ID only present once for a paticular
> parent node - for these two tags this would be appropriate. After
> parsing,
A DTD can't (I think). An XSD can (I think). I also created an XSD of
the schema definition. The XSD has more features/checks than the DTD.
>
> bindtextdomain (schema->gettext_domain, schema->gettext_directory);
> bind_textdomain_codeset (schema->gettext_domain, "UTF-8");
>
> would be called.
>
> When parsing a DConf key,
>
> typedef struct {
> ...
> char *description;
> } DConfKey;
Sorry. This specification isn't about DConf. DConf might one day become
an implementation that implements this specification.
Please don't confuse it ;-)
> gets filled.
>
> then, in the
>
> const char *dconf_get_description (const char *key,
> const char *locale);
>
> getter you would then lookup the schema associated with key, and
>
> return dgettext (key->scheme->gettext_domain, key->description);
--
Philip Van Hoof, software developer at x-tend
home: me at pvanhoof dot be
gnome: pvanhoof at gnome dot org
work: vanhoof at x-tend dot be
http://www.pvanhoof.be - http://www.x-tend.be
More information about the xdg
mailing list