[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs i18n
From: |
Paul Eggert |
Subject: |
Re: Emacs i18n |
Date: |
Mon, 18 Mar 2019 14:55:44 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 |
On 3/18/19 2:20 PM, Juri Linkov wrote:
> Using only ‘ngettext’ has an additional advantage:
> there will be no need to add more such functions as
> nmessage, nerror, nuser-error, ntramp-error, etc.
That's not a real advantage, as there is no need to add those functions
anyway. They are merely conveniences that we can either add or not add,
depending on whether the convenience in use is worth the hassle of
supporting and documenting the functions.
For example, suppose 'message' always translates its format argument and
that there is no 'nmessage' function. Then you can use 'message' this
way to handle plurals:
(message "%s" (format (ngettext n "%d item" "%d items") n))
If we find expressions like the above to be common, we can easily write
an nmessage function in Lisp, so that the code can look like this instead:
(nmessage n "%d item" "%d items" n)
but this is merely a convenience.
> ‘format-message’ should check if its first argument is translated,
> and not to call gettext again.
>
I'd rather not involve dynamic checking like that, as it's fragile and
more complicated to explain and a bit slower. format-message should
either always translate, or never translate. In practice, it'll be more
convenient for format-message to always translate, so I expect we should
do it that way.
- Re: Emacs i18n, (continued)
- Re: Emacs i18n, Jean-Christophe Helary, 2019/03/06
- Re: Emacs i18n, Paul Eggert, 2019/03/07
- Re: Emacs i18n, Richard Stallman, 2019/03/07
- Re: Emacs i18n, Juri Linkov, 2019/03/11
- Re: Emacs i18n, Paul Eggert, 2019/03/11
- Re: Emacs i18n, Juri Linkov, 2019/03/12
- Re: Emacs i18n, Juri Linkov, 2019/03/17
- Re: Emacs i18n, Juri Linkov, 2019/03/18
- Re: Emacs i18n,
Paul Eggert <=
- Re: Emacs i18n, Juri Linkov, 2019/03/19
- Re: Emacs i18n, Jean-Christophe Helary, 2019/03/11
- Re: Emacs i18n, Michael Albinus, 2019/03/12
- Re: Emacs i18n, Paul Eggert, 2019/03/06
- Re: Emacs i18n, Eli Zaretskii, 2019/03/06
- Re: Emacs i18n, Paul Eggert, 2019/03/06
- Re: Emacs i18n, Eli Zaretskii, 2019/03/06
- Re: Emacs i18n, Richard Stallman, 2019/03/06
- Re: Emacs i18n, Eli Zaretskii, 2019/03/07
- Re: Emacs i18n, Juri Linkov, 2019/03/07