Re: UTF-8 strings; plurals; qt-format



Hi Daniel,

Today at 1:17, Daniel Elstner wrote:

> Shall I do so?  This would require changes to each and every .po file,
> of course.  Would it be alright if I do a mass search/replace on all .po
> files myself?  (Of course using regexxer itself for the job!)  Come to
> think of it, if I do the mass search replace I might as well commit the
> results of intltool-update, no?  Please advise, I really don't want to
> disrupt anybody's work.

Just announcing it on gnome-i18n prior to doing any change (so
translators can commit their unfinished work, and stop doing anything
new) should be enough.  And yes, it would be best if you did the
conversion of PO files yourself.

Running intltool-update in such a scenario and committing the results
might as well be acceptable, but I wouldn't worry about it: is there
any particular reason you'd want to run it?

> Now to the second question.  Right now I'm not using ngettext() in
> regexxer, but will happily do so if it turns out to be necessary.  The
> problem is, I'm not sure what to do about a string like this:
>
>     #: ../src/mainwindow.cc:476
>     #, qt-format
>     msgid ""
>     "Error in regular expression at \"%1\" (index %2):\n"
>     "%3"

This message doesn't require ngettext call.  In general, messages
which have a number attached to a noun or pronoun, and where number is
used for counting (eg. "%1 matches") need ngettext.

> The third issue I'd like to bring up is actually more of an
> informational notice than a question.  In regexxer, I use qt-format for
> placeholders in message strings.  Actually I didn't realize that the
> notation matches qt-format until after I implemented it, but it's great
> to know that it's some sort of standard and is specifically supported by
> xgettext, too.

Thanks for the notice :)  I also see that those strings are already
marked as qt-format, so even running "msgfmt -c" locally would catch
the problems :)

>         You can reorder substitutions!  This isn't possible with
>         standard C89 printf without implementation-specific extensions.
>         You could even reference an index more than once or not at all,
>         but that probably isn't useful.

This is possible with POSIX extensions even to C89, so this is a
non-argument :)  Yeah, it may look uglier, but that's all there is to
it (%1$s, %2$d...).

> Looking through the .po files for regexxer, I noticed that as of yet no
> translation actually makes use of the reordering feature.  Of course
> this could be because the default order happened to be just fine for all
> translations currently available for regexxer.  But it might also be the
> case that the translators are simply not aware of the possibility, and
> that's why I'm writing this notice.

As far as I see, only 2 messages have %2 in them, and both of them
are of the error message/warning type with %2 being either after
semicolon or in parenthesis (which is hardly suitable for reordering :).

> Sorry for the looong mail.  I do hope that's about all I need to know
> for a while.

This is more than appreciated: if all the developers announced their
plans in the same way, and described the technology they use like
this, it would be easier for translators to do their job (well, in
most cases, we have standards on how to do things anyway, so that's
part of the solution :)).

Thanks,
Danilo


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