emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs i18n


From: Eli Zaretskii
Subject: Re: Emacs i18n
Date: Thu, 07 Mar 2019 05:37:42 +0200

> From: Paul Eggert <address@hidden>
> Date: Wed, 6 Mar 2019 17:52:05 -0800
> Cc: address@hidden, address@hidden, address@hidden
> 
> then it shouldn't be tough at all. The Elisp code should be rewritten
> like this:
> 
>    (message "The program says: %s" (shell-command-to-string "foo"))
> 
> xgettext will automatically put "The program says: %s" into the pool of
> translatable strings. The output of the "foo" command won't be
> translated, nor should it be.
> 
> Anyway, the Elisp code with "concat" needs to be rewritten regardless of
> whether we do i18n, as it can throw an exception if the shell command's
> output contains "%".
> 
> All this is routine for program internationalization. Emacs is not
> special here; we've often had to do this sort of thing for other GNU
> packages.

Sure, except that Emacs is so much larger, and gives the programmer a
lot more freedom with treating code and data alike, than a typical C
program.  I just want people to realize how this job is more
complicated in Emacs than in any other program.  E.g., IIUC what you
say, we will need to rewrite also the likes of this:

  (let* ((field (get-char-property pos 'field))
         (button (get-char-property pos 'button))
         (doc (get-char-property pos 'widget-doc))
         (text (cond (field "This is an editable text area.")
                     (button "This is an active area.")
                     (doc "This is documentation text.")
                     (t "This is unidentified text.")))
         (widget (or field button doc)))
    (when widget
      (widget-browse widget))
    (message text)))

And this is just a random, and not the most complicated, example.



reply via email to

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