Re: [Tracker] Write-back data & default/dummy data

On 27/10/09 14:28, Philip Van Hoof wrote:
On Tue, 2009-10-27 at 15:10 +0100, Philip Van Hoof wrote:
For example ..

What's the point of returning "Untitled piece of music" if that string
ain't const and therefore can't be translated by gettext()

Non-const strings can still be translated by gettext().

It is more a cast of "some string" might be a valid value for some data and allowing the user to specify what string is used for unknown values means apps get to choose based on the type of data they expect. They should also know what expected data will be returned so they can avoid these cases.

Whereas it is const if the app dev uses coalesce:

"SELECT COALESCE (nie:title(?t), nfo:fileName(?f), "
        _("Untitled piece of music")
") WHERE { ...}"

Unless of course you make ontology files like .desktop files, with their
own translations. And you adapt tracker-store to read the LANG
environment variable

But that's actually very wron: a single app can be set in a language,
while Tracker is in the environment's language
Try running `LANG=nl_NL gnome-terminal` , if now gnome-terminal would
ask for things to Tracker, its default values wouldn't be in Dutch
unless Tracker's store was also started with LANG=nl_NL (but it isn't a
requirement that both are started in the same LANG environment).

These are rarely different though.

With the coalesce() solution it would be dutch. So I don't like "default
values in Tracker" much.

Yes, but if you returned "!!!SLIFF!!!" you could still just use a simple string comparison and change it to something else translatable anyway. It is not as nice I agree.


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