[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs i18n
From: |
Richard Stallman |
Subject: |
Re: Emacs i18n |
Date: |
Sun, 10 Mar 2019 21:20:40 -0400 |
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> Thanks for explaining the -masc, -fem, -neut part. I'm afraid, though, that
I
> still don't fully understand the proposal. It sounds like it is a redesign
of
> what GNU gettext does, but I don't see any advantage over GNU gettext.
The advantage -- which is a big one -- is that the way the translation
is represented is much cleaner. Compare this
(numeric-case NUMBER
(russian-masc "%d байт скопирован, %s, %s")
(russian-fem "%d байта скопировано, %s, %s")
(russian-neut "%d байт скопировано, %s, %s"))
(I have filled in strings for the real example you sent. Since I
don't speak Russian, I was unable to write one myself, and it would
have taken me hours to find one.)
or this:
"russian-masc:%d байт скопирован, %s, %s|\
russian-fem:%d байта скопировано, %s, %s|\
russian-neut:%d байт скопировано, %s, %s"
with this:
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 &&
n%10<=4
&& (n%100<10 || n%100>=20) ? 1 : 2);\n"
...
#: src/dd.c:822
#, c-format
msgid "%<PRIuMAX> byte copied, %s, %s"
msgid_plural "%<PRIuMAX> bytes copied, %s, %s"
msgstr[0] "%<PRIuMAX> байт скопирован, %s, %s"
msgstr[1] "%<PRIuMAX> байта скопировано, %s, %s"
msgstr[2] "%<PRIuMAX> байт скопировано, %s, %s"
If the selector symbol can modify the string too,
I can envision something like this:
"russian-nom:%d байт%| скопирован%|, %s, %s"
where the 'russian-nom' operator would replace the two %| sequences
with the appropriate declensional suffixes for the nominative case.
Building that sort of thing into gettext would be bad architecture.
Gettext is too low level, and used in too many places.
Making Emacs handle 'russian-nom' in a string it pulls out of gettext
would be no problem at all.
> This is a simple scheme that does not attempt to solve the problem of
generating
> idiomatic phrases for numbers (e.g., "twenty-four bytes" in English,
I agree we don't need to do this. But, with the mechanism I've just
proposed, it would be easy to do, so I suppose we would implement it.
--
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
- Re: Emacs i18n, (continued)
- Re: Emacs i18n, Richard Stallman, 2019/03/07
- Re: Emacs i18n, Elias Mårtenson, 2019/03/07
- Re: Emacs i18n, Eli Zaretskii, 2019/03/08
- Re: Emacs i18n, Richard Stallman, 2019/03/08
- Re: Emacs i18n, Paul Eggert, 2019/03/09
- Re: Emacs i18n, Eli Zaretskii, 2019/03/09
- Re: Emacs i18n, Richard Stallman, 2019/03/09
- Re: Emacs i18n, Paul Eggert, 2019/03/10
- Re: Emacs i18n,
Richard Stallman <=
- Re: Emacs i18n, Paul Eggert, 2019/03/11
- Re: Emacs i18n, Richard Stallman, 2019/03/11
- Re: Emacs i18n, Richard Stallman, 2019/03/11
- Re: Emacs i18n, Yuri Khan, 2019/03/10
- Re: Emacs i18n, Richard Stallman, 2019/03/09
- Re: Emacs i18n, Paul Eggert, 2019/03/10
- Re: Emacs i18n, Richard Stallman, 2019/03/09
- Re: Emacs i18n, Richard Stallman, 2019/03/06
- Re: Emacs i18n, Eli Zaretskii, 2019/03/07
- Re: Emacs i18n, Paul Eggert, 2019/03/07