[Translation-i18n] xtensa message pluralization

Bruno Haible bruno@clisp.org
Wed Nov 8 15:45:00 GMT 2017


Hi Alan,

> A question for the translation project:  I'm wondering if
> I should allow translators to change sentence construction order with
> something like the following patch?

The proposed patch violates rule #2 "Entire sentences" from [1].
In particular, it separates subject and verb of the same sentence
into different format strings. This does not work, because in some
languages the verb's form depends on the subject's gender.

Therefore it should better not be applied.

> (The issue of translators wanting to reorder sentences came to light
> recently

To fix this, apply rule #4 "Use format strings instead of string concatenation."
from ]1].

Something like this:

      msg = my_asprintf ("%s, but %s",
                         ngettext ("format '%s' allows %d slot",
                                   "format '%s' allows %d slots",
                                   slots),
                         ngettext ("there is %d opcode",
                                   "there are %d opcodes",
                                   vinsn->num_slots));

This form does not fulfil rule #2 (again!) but this is a less severe violation
because you won't have side effects between the first and the second substring
in most languages.

Translators can then do the reordering by use of POSIX format string reordering
e.g. "%2$d, whereas %1$d" [2].

Bruno

[1] https://www.gnu.org/software/gettext/manual/html_node/Preparing-Strings.html
[2] https://www.gnu.org/software/gettext/manual/html_node/C.html



More information about the Binutils mailing list