emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs i18n


From: Juri Linkov
Subject: Re: Emacs i18n
Date: Mon, 11 Mar 2019 23:48:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>> In that case, the solution that Richard proposed should suffice for most
>> cases. That is, in most cases we shouldn't need to change the Elisp
>> source code; all we need is for xgettext (or its equivalent) to consider
>> the first argument of 'message' to be a translatable string. This is
>> a standard feature of xgettext (see its --keyword argument).
>
> Yes but... The first argument of message is often a lisp expression that
> generates natural language strings programatically. That part will have to
> be modified (although far from perfect, please check what I did on
> packages.el if what I wrote above is not clear).

Please note that you have to handle not only format-strings of ‘message’,
but also ‘error’ and even more low-level ‘format’, i.e. all these

  (error STRING &rest ARGS)
  (message FORMAT-STRING &rest ARGS)
  (format-message STRING &rest OBJECTS)
  (format STRING &rest OBJECTS)

because there are many places that construct the string arguments
of ‘message’ using ‘format’ like in ‘perform-replace’:

        (message "Replaced %d occurrences%s"
                 replace-count
                 (if (> (+ skip-read-only-count
                           skip-filtered-count
                           skip-invisible-count)
                        0)
                     (format " (skipped %s)"
                             (mapconcat
                              #'identity
                              (delq nil (list
                                         (if (> skip-read-only-count 0)
                                             (format "%s read-only"
                                                     skip-read-only-count))
                                         (if (> skip-invisible-count 0)
                                             (format "%s invisible"
                                                     skip-invisible-count))
                                         (if (> skip-filtered-count 0)
                                             (format "%s filtered out"
                                                     skip-filtered-count))))
                              ", "))
                   ""))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]