This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Translation-i18n] xtensa message pluralization
- From: Bruno Haible <bruno at clisp dot org>
- To: translation-i18n at lists dot sourceforge dot net
- Cc: Alan Modra <amodra at gmail dot com>, "augustine dot sterling at gmail dot com" <augustine dot sterling at gmail dot com>, binutils at sourceware dot org
- Date: Wed, 08 Nov 2017 16:45:23 +0100
- Subject: Re: [Translation-i18n] xtensa message pluralization
- Authentication-results: sourceware.org; auth=none
- References: <20171107082716.GY10905@bubble.grove.modra.org> <CAGSvup9PD8-HHADP2=YVMLyK59bkLOr7-QbvhU6CAbziDacLFg@mail.gmail.com> <20171108101629.GB10905@bubble.grove.modra.org>
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