[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs i18n
From: |
Juri Linkov |
Subject: |
Re: Emacs i18n |
Date: |
Mon, 25 Mar 2019 23:11:30 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) |
> + (cons (format (ngettext "finished with %d match found\n"
> + "finished with %d matches found\n"
> + grep-num-matches-found)
> + grep-num-matches-found)
>
> ("^Grep[/a-zA-Z]* started.*"
> (0 '(face nil compilation-message nil help-echo nil mouse-face nil) t))
> - ("^Grep[/a-zA-Z]* finished with \\(?:\\(\\(?:[0-9]+ \\)?matches
> found\\)\\|\\(no matches found\\)\\).*"
> + ("^Grep[/a-zA-Z]* finished with \\(?:\\(\\(?:[0-9]+
> \\)?match\\(?:es\\)?
> found\\)\\|\\(no matches found\\)\\).*"
>
> Since it is not uncommon in Emacs to pattern-match on generated text,
> either the translator needs to understand regexps well or the code
> must be restructured to avoid that kind of matching, perhaps by using
> text properties. Besides, translating regexp strings precludes the use
> of modern regexp notations like rx, since gettext is string-oriented.
Is it possible to generate a regexp from ngettext arguments?
For example, given the same arguments and calling a hypothetical
function ‘rx-ngettext’:
(rx-ngettext "finished with %d match found\n"
"finished with %d matches found\n")
to generate a regexp like:
"finished with \\(?:\\(\\(?:[0-9]+ \\)?match\\(?:es\\)? found\\)"
- Re: Emacs i18n, (continued)
- Re: Emacs i18n, Eli Zaretskii, 2019/03/24
- Re: Emacs i18n, Jean-Christophe Helary, 2019/03/25
- Re: Emacs i18n, Juri Linkov, 2019/03/25
- Re: Emacs i18n, Eli Zaretskii, 2019/03/25
- Re: Emacs i18n, Richard Stallman, 2019/03/27
- Re: Emacs i18n, Mattias Engdegård, 2019/03/25
- Re: Emacs i18n, Eli Zaretskii, 2019/03/25
- Re: Emacs i18n,
Juri Linkov <=
- Re: Emacs i18n, Mattias Engdegård, 2019/03/25
- Re: Emacs i18n, Juri Linkov, 2019/03/27
- Re: Emacs i18n, Mattias Engdegård, 2019/03/28
Re: Emacs i18n (was: bug#34520: delete-matching-lines should report how many lines it deleted), Richard Stallman, 2019/03/03
- Re: Emacs i18n (was: bug#34520: delete-matching-lines should report how many lines it deleted), Eli Zaretskii, 2019/03/04
- Re: Emacs i18n (was: bug#34520: delete-matching-lines should report how many lines it deleted), Paul Eggert, 2019/03/04
- Re: Emacs i18n (was: bug#34520: delete-matching-lines should report how many lines it deleted), Eli Zaretskii, 2019/03/04
- Re: Emacs i18n (was: bug#34520: delete-matching-lines should report how many lines it deleted), Paul Eggert, 2019/03/04
- Re: Emacs i18n, Juri Linkov, 2019/03/05
- Re: Emacs i18n, Richard Stallman, 2019/03/05