[Ardour-Dev] translators!

Alexandre Prokoudine alexandre.prokoudine at gmail.com
Fri Jan 4 00:07:59 PST 2013


Paul,

Here's a quick overview of plural forms issues that still exist.

First of all, ngettext suggests to use %d instead of %1. P_() macros
doesn't work with %d. In fact, it doesn't even work with %1. Here are
some examples:

>From sfdb_ui.cc:

		string_compose(P_("found %1 match", "found %1 matches", matches), matches));

This never gets merged into PO files. Nor the other occurence of same
phrase later in the file.

>From ardour_ui.cc:

if (tracks.size() != how_many) {
				error << string_compose (P_("could not create new audio track",
"could not create %1 new audio tracks", how_many), how_many)
				      << endmsg;
}

Two issues in the example above:

1. As already discussed on IRC, in Russian this won't work for numbers
like 21, 41, 71 etc. There should always be a variable. I can submit
English translation that deals with it to make the actual user visible
phrase in English look more natural, i.e. the way it is now.

2. Again, the combination of the P_() macros and the %1 variable
doesn't work. Neither PO files get ngettextized, nor the actual
phrases are put into PO files as is. After running ./waf i18n I get
the "could not create %1 new audio tracks" phrase placed to the bottom
of the PO file and marked as obsolete. Apparently gettext thinks that
phrases inside P_() don't exist.

When you think you fixed it, you can check if it worked by running
./waf i18n and checking if the entry looks like this:

#: ardour_ui.cc:1388
#, fuzzy
msgid "could not create %d new audio track"
msgid_plural "could not create %d new audio tracks"
msgstr[0] "first plural form translation"
msgstr[1] "second plural form translation"
msgstr[2] "third plural form translation"

That's for Russian with its three plural forms.

The other problem is that  "could not create a new mixed track"/"could
not create %1 new mixed tracks" is not ngettextized in the source
code. I tried fixing it by rewriting the code, but I'm obviously
lacking required programming skills.

Alexandre

On Thu, Jan 3, 2013 at 6:19 PM, Paul Davis <paul at linuxaudiosystems.com> wrote:
> should be improved and/or fixed in svn now. P_() is a new plural form i18n
> macro.



More information about the Ardour-Dev mailing list