Next: Documentation String Extraction, Previous: Dynamic Messaging, Up: I18N Level 3 [Contents][Index]
The default message domain of SXEmacs is ‘emacs’. For add-on packages, it is
best to use a different domain. For example, let us say we want to convert
the “gorilla” package to use the domain ‘emacs-gorilla’.
To translate the message “What gorilla?”, use dgettext
as follows:
(dgettext "emacs-gorilla" "What gorilla?")
A function (or macro) which has a documentation string or an interactive
prompt needs to be associated with the domain in order for the documentation
or prompt to be translated. This is done with the domain
special
form as follows:
(defun scratch (location) "Scratch the specified location." (domain "emacs-gorilla") (interactive "sScratch: ") … )
It is most efficient to specify the domain in the first line of the
function body, before the interactive
form.
For variables and constants which have documentation strings, specify the domain after the documentation.
Example:
(defvar weight 250 "Weight of gorilla, in pounds." "emacs-gorilla")
Example:
(defconst limbs 4 "Number of limbs" "emacs-gorilla")
This function defines function to autoload from filename Example:
(autoload 'explore "jungle" "Explore the jungle." nil nil "emacs-gorilla")