Re: RFC - Storing translated values in a PropertyBag



Martin Baulig <martin home-of-linux org> writes: 
> For GConf (FIXME: I don't know how GConf handles translated strings), we
> should try to implement this natively - I don't know enough about GConf,
> but it seems to have a list type and a pair type, so it should be possible
> to map Bonobo::Config::LocalizedString to a pair of strings and
> Bonobo::Config::LocalizedStringList to a sequence of pairs of strings.

What GConf does is simply return the string in the current
(client-side) locale. It properly handles a list of languages in the
locale, etc.

There's a get_with_locale() function to get a string in a specific
locale, but this is really only useful in admin tools or something.

I would suggest a getValueWithLocale() method rather than putting the
locale in the key name, because typically I'm going to specify the
locale programmatically, and it's lame to have to sprintf it into the
string.

To make this useful you need a way to get the list of locales that we
have a value for; GConf lacks this. I think GConf probably lacks
several other things needed for a nice admin tool as well though, I'm
reluctant to start bloating up the API until we have an actual tool to
see what the issues are.

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]