Mercurial > hg > xemacs-beta
view man/lispref/internationalization.texi @ 1346:01c57eb70ae9
[xemacs-hg @ 2003-03-09 02:27:27 by ben]
To: xemacs-patches@xemacs.org
i.c: Sleep between calls to check for I/O, since these calls are non-blocking.
behavior.el: Allow other keywords for forward compatibility.
cl-macs.el: Rewrite to eliminate byte-compiler warning when `return' is used
without `finally'.
cmdloop.el: Avoid truncated error messages for `end-of-file' and the like.
cmdloop.el: Avoid char-int error after syncing.
files.el: Eliminate byte-compile warnings.
printer.el: Fix line-width calculations.
#### This used to work. Someone's changes (perhaps by
Michael Sperber?) seem to have messed something up.
simple.el: Use new clear-left-side functions to avoid messages ending up on
the same line as other output.
xemacs.mak: Add override for info/ as well when separate source/build dirs.
xemacs.mak: Order sections in main build process and add comments. Add
additional dependencies to try and prevent later steps from
happening when failures in earlier steps have occurred.
Makefile.in.in: Order sections in main build process and add comments. Add
additional dependencies to try and prevent later steps from
happening when failures in earlier steps have occurred.
alloc.c: Don't arbitrarily clear Vconfigure_info_directory since it
messes up separate build/source dirs.
console.c, console.h, device-msw.c, device.c: Add accidentally omitted msprinter console and data descriptions.
print.c, console-msw.c: Add clear-left-side functionality to help keep stdio/stderr
output from separate sources on separate lines. Generalize
the different kinds of debugging output. Add dpa().
profile.c: Add better docs on Unix/Windows differences.
regex.c: Fix problems with rel-alloc compilation caused by previous patch.
emacs.c: Seg fault rather than abort on Cygwin, since gdb doesn't trap
aborts properly.
console-gtk-impl.h, console-gtk.h, console-msw.h, console-x-impl.h, console-x.h, dialog-gtk.c, dialog-x.c, event-msw.c, frame-gtk.c, frame-x.c, frameslots.h, glyphs-gtk.c, glyphs-x.c, gui-gtk.c, gui-x.c, inline.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, scrollbar-gtk.c, scrollbar-x.c, ui-gtk.c: Delete popup-data object. Delete menubar_data field from frames,
since its usage is frame-specific. Delete menubar-msw.h,
gui-x.h, gui-gtk.h. Clean up handling of lwlib callback data
GCPRO'ing and add missing GCPRO recomputation in widget code.
author | ben |
---|---|
date | Sun, 09 Mar 2003 02:27:46 +0000 |
parents | 576fb035e263 |
children | 03ab78e48ef6 |
line wrap: on
line source
@c -*-texinfo-*- @c This is part of the XEmacs Lisp Reference Manual. @c Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc. @c See the file lispref.texi for copying conditions. @setfilename ../../info/internationalization.info @node Internationalization, MULE, PostgreSQL Support, top @chapter Internationalization @menu * I18N Levels 1 and 2:: Support for different time, date, and currency formats. * I18N Level 3:: Support for localized messages. * I18N Level 4:: Support for Asian languages. @end menu @node I18N Levels 1 and 2 @section I18N Levels 1 and 2 XEmacs is now compliant with I18N levels 1 and 2. Specifically, this means that it is 8-bit clean and correctly handles time and date functions. XEmacs will correctly display the entire ISO-Latin 1 character set. The compose key may now be used to create any character in the ISO-Latin 1 character set not directly available via the keyboard.. In order for the compose key to work it is necessary to load the file @file{x-compose.el}. At any time while composing a character, @code{C-h} will display all valid completions and the character which would be produced. @node I18N Level 3 @section I18N Level 3 @menu * Level 3 Basics:: * Level 3 Primitives:: * Dynamic Messaging:: * Domain Specification:: * Documentation String Extraction:: @end menu @node Level 3 Basics @subsection Level 3 Basics XEmacs now provides alpha-level functionality for I18N Level 3. This means that everything necessary for full messaging is available, but not every file has been converted. The two message files which have been created are @file{src/emacs.po} and @file{lisp/packages/mh-e.po}. Both files need to be converted using @code{msgfmt}, and the resulting @file{.mo} files placed in some locale's @code{LC_MESSAGES} directory. The test ``translations'' in these files are the original messages prefixed by @code{TRNSLT_}. The domain for a variable is stored on the variable's property list under the property name @var{variable-domain}. The function @code{documentation-property} uses this information when translating a variable's documentation. @node Level 3 Primitives @subsection Level 3 Primitives @defun gettext string This function looks up @var{string} in the default message domain and returns its translation. If @code{I18N3} was not enabled when XEmacs was compiled, it just returns @var{string}. @end defun @defun dgettext domain string This function looks up @var{string} in the specified message domain and returns its translation. If @code{I18N3} was not enabled when XEmacs was compiled, it just returns @var{string}. @end defun @defun bind-text-domain domain pathname This function associates a pathname with a message domain. Here's how the path to message file is constructed under SunOS 5.x: @example @code{@{pathname@}/@{LANG@}/LC_MESSAGES/@{domain@}.mo} @end example If @code{I18N3} was not enabled when XEmacs was compiled, this function does nothing. @end defun @defspec domain string This function specifies the text domain used for translating documentation strings and interactive prompts of a function. For example, write: @example (defun foo (arg) "Doc string" (domain "emacs-foo") @dots{}) @end example to specify @code{emacs-foo} as the text domain of the function @code{foo}. The ``call'' to @code{domain} is actually a declaration rather than a function; when actually called, @code{domain} just returns @code{nil}. @end defspec @defun domain-of function This function returns the text domain of @var{function}; it returns @code{nil} if it is the default domain. If @code{I18N3} was not enabled when XEmacs was compiled, it always returns @code{nil}. @end defun @node Dynamic Messaging @subsection Dynamic Messaging The @code{format} function has been extended to permit you to change the order of parameter insertion. For example, the conversion format @code{%1$s} inserts parameter one as a string, while @code{%2$s} inserts parameter two. This is useful when creating translations which require you to change the word order. @node Domain Specification @subsection Domain Specification The default message domain of XEmacs 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 @code{dgettext} as follows: @example (dgettext "emacs-gorilla" "What gorilla?") @end example 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 @code{domain} special form as follows: @page @example (defun scratch (location) "Scratch the specified location." (domain "emacs-gorilla") (interactive "sScratch: ") @dots{} ) @end example It is most efficient to specify the domain in the first line of the function body, before the @code{interactive} form. For variables and constants which have documentation strings, specify the domain after the documentation. @defspec defvar symbol [value [doc-string [domain]]] Example: @example (defvar weight 250 "Weight of gorilla, in pounds." "emacs-gorilla") @end example @end defspec @defspec defconst symbol [value [doc-string [domain]]] Example: @example (defconst limbs 4 "Number of limbs" "emacs-gorilla") @end example @end defspec @defun autoload function filename &optional docstring interactive type This function defines @var{function} to autoload from @var{filename} Example: @example (autoload 'explore "jungle" "Explore the jungle." nil nil "emacs-gorilla") @end example @end defun @node Documentation String Extraction @subsection Documentation String Extraction The utility @file{etc/make-po} scans the file @code{DOC} to extract documentation strings and creates a message file @code{doc.po}. This file may then be inserted within @code{emacs.po}. Currently, @code{make-po} is hard-coded to read from @code{DOC} and write to @code{doc.po}. In order to extract documentation strings from an add-on package, first run @code{make-docfile} on the package to produce the @code{DOC} file. Then run @code{make-po -p} with the @code{-p} argument to indicate that we are extracting documentation for an add-on package. (The @code{-p} argument is a kludge to make up for a subtle difference between pre-loaded documentation and add-on documentation: For add-on packages, the final carriage returns in the strings produced by @code{make-docfile} must be ignored.) @node I18N Level 4 @section I18N Level 4 The Asian-language support in XEmacs is called ``MULE''. @xref{MULE}.