[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
i18n (was: reverting/notifying of files that no longer exist)
From: |
Juri Linkov |
Subject: |
i18n (was: reverting/notifying of files that no longer exist) |
Date: |
Thu, 15 Jul 2004 21:42:09 +0300 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) |
Karl Chen <address@hidden> writes:
> BTW, I don't know if Emacs coding standards say much regarding
> internationalization, but in general it's better to write out
> (message "%s changed on disk...")
> and
> (message "%s renamed or deleted on disk...")
> for translation.
> (http://www.gnu.org/software/gettext/manual/html_node/gettext_15.html)
According to those guidelines the right way to translate messages is
to call the `gettext' function on messages before placeholders in them
get expanded with arguments, i.e. to write:
(message (gettext "File %s renamed") filename)
However, this might not be the best solution for Emacs, since it has
several powerful mechanisms like regexps to avoid the need to add
`gettext' functions to every `message' call. So after the call to
(message "File %s renamed" filename) the function `message' receives
a string like "File /some/path/somefile renamed" and could use a
variable with translation mappings to performs regexp replacements
before messages get displayed in the echo area, e.g.:
(defvar message-translations
'(("some_language_name" "^File \\(.?+\\) renamed$" "Elif \1 demaner")
(... ... ...)))
Anyway, I believe this feature is for Emacs 22, and etc/TODO already
has an entry for that.
--
Juri Linkov
http://www.jurta.org/emacs/