Re: ngettext revisited

tis 2003-09-30 klockan 18.31 skrev Danilo Segan:
> > gdm
> This seems to be troublesome because there are strings in XML files
> using "%d".
> AFAICS, intltool doesn't yet support plural forms with XML files.
> Actually, this doesn't seem easily solveable at all, because there are
> some strings which are loaded from XML files, and since they store the
> messages at runtime (PO files are just used for initial editting, and
> the strings from there are put into XML files at compile time), there's
> no way to get the correct strings in running programs.
> I don't know much about XML localization issues (yes, I've noticed that
> some kind of 'xml:lang' attribute is used for translations, but this is
> not enough for plural forms), so any hint would be helpful.
> Btw, this could probably be solved more easily if GDM would actually
> pass these strings to (n)gettext (depending on whether %d is used).
> Still, there would need to be some more custom markup for (like
> <N_and then the tag name>singular english form<n_>plural english form</
> N_closing tag>
> But this would still bring in many complications.

There seems to be only a few (two) strings in gdm theme xml files that
require ngettext. Perhaps they could be moved from the theme files to
some place else. In any case that should be discussed in the specific
bug report.

> > nautilus
> This one will has one tricky for fixing, like where there are several
> "%d"'s in one string.
> It would be nice to get some input from other translation teams if it's
> ok to use concatenation, i.e. can they translate correctly the string:
>   msgid "Uptime is %d days, %d hours, %d minutes"
> if it's split into:
>   msgid "Uptime is %d days"
>   msgid "%d hours"
>   msgid "%d minutes"
> and later concatenated into
>   "%s, %s, %s"
> ?

Such things are already used in some modules when absolutely necessary.
I would use a slight modification though:

  msgid "Uptime is %d days, %s, %s"
  msgid "%d hours"
  msgid "%d minutes"

Naturally, providing a comment(*) to translators explaining how such
messages are put together is absolutely essential.
This should be possible to translate correctly, albeit with a greater
danger of accidental mistranslation, even with a comment.
So *please* refrain from doing such concatenations unless absolutely



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