CMUCL commit: src/docs/cmu-user (extensions.tex)
Raymond Toy
rtoy at common-lisp.net
Sun Apr 18 19:24:29 CEST 2010
Date: Sunday, April 18, 2010 @ 13:24:29
Author: rtoy
Path: /project/cmucl/cvsroot/src/docs/cmu-user
Modified: extensions.tex
Update docs to match current implementation.
----------------+
extensions.tex | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
Index: src/docs/cmu-user/extensions.tex
diff -u src/docs/cmu-user/extensions.tex:1.43 src/docs/cmu-user/extensions.tex:1.44
--- src/docs/cmu-user/extensions.tex:1.43 Fri Apr 2 22:20:59 2010
+++ src/docs/cmu-user/extensions.tex Sun Apr 18 13:24:29 2010
@@ -2777,9 +2777,26 @@
the only complete translation is a Pig Latin translation done by
machine. There are a few messages translated to Korean.
+In general, translatable strings are marked as such by using the
+functions \code{intl:gettext} and \code{intl:ngettext} or by using the
+reader macros \verb+_+ or \verb+_N+. When loading or compiling, such
+strings are recorded for translation. At runtime, such strings are
+looked in and the translation is returned. Doc strings do not need to
+be noted in any way; the are automatically noted for translation.
+
+By default, recording of translatable strings is disabled. To enable
+recording of strings, call \code{intl:translation-enable}.
+
\subsection{Dictionary}
\label{sec:localization-dictionary}
+\begin{defun}{intl:}{translation-enable}{}
+ Enable recording of translatable strings.
+\end{defun}
+
+\begin{defun}{intl:}{translation-disable}{}
+ Disablle recording of translatable strings.
+\end{defun}
\begin{defun}{intl:}{setlocale}{\ampoptional{} locale}
Sets the locale to the locale specified by \var{locale}. If
@@ -2846,6 +2863,12 @@
This is a list of directory pathnames where the translations can be found.
\end{defvar}
+\begin{defun}{intl:}{install}{\ampoptional{} (rt *readtable*)}
+ Installs reader macros and comment reader into the specified
+ readtable as explained below. The readtable defaults to
+ \var{*readtable*}.
+\end{defun}
+
Two reader macros are also provided: \code{\_''} and \code{\_N''}. The
first is equivalent to wrapping \code{dgettext} around the string.
The second returns the string, but also records the string. This is
@@ -2864,7 +2887,8 @@
\subsection{Example Usage}
\label{sec:localization-usage}
-Here is a simple example of how to localize your code.
+Here is a simple example of how to localize your code. This assumes
+that you've installed the reader macros via \code{intl::install}.
\begin{example}
More information about the cmucl-commit
mailing list