Kaydet (Commit) c3845a14 authored tarafından Fred Drake's avatar Fred Drake

Logical markup & other small nits.

üst 11bc8cfe
\section{\module{locale} --- \section{\module{locale} ---
Internationalization services.} Internationalization services}
\declaremodule{standard}{locale}
\declaremodule{standard}{locale}
\modulesynopsis{Internationalization services.} \modulesynopsis{Internationalization services.}
The \code{locale} module opens access to the \POSIX{} locale database The \module{locale} module opens access to the \POSIX{} locale database
and functionality. The \POSIX{} locale mechanism allows programmers and functionality. The \POSIX{} locale mechanism allows programmers
to deal with certain cultural issues in an application, without to deal with certain cultural issues in an application, without
requiring the programmer to know all the specifics of each country requiring the programmer to know all the specifics of each country
...@@ -14,7 +13,7 @@ where the software is executed. ...@@ -14,7 +13,7 @@ where the software is executed.
The \module{locale} module is implemented on top of the The \module{locale} module is implemented on top of the
\module{_locale}\refbimodindex{_locale} module, which in turn uses an \module{_locale}\refbimodindex{_locale} module, which in turn uses an
ANSI \C{} locale implementation if available. ANSI C locale implementation if available.
The \module{locale} module defines the following exception and The \module{locale} module defines the following exception and
functions: functions:
...@@ -38,8 +37,8 @@ import locale ...@@ -38,8 +37,8 @@ import locale
locale.setlocale(locale.LC_ALL,"") locale.setlocale(locale.LC_ALL,"")
\end{verbatim} \end{verbatim}
This sets the locale for all categories to the user's default setting This sets the locale for all categories to the user's default setting
(typically specified in the \code{LANG} environment variable). If the (typically specified in the \envvar{LANG} environment variable). If
locale is not changed thereafter, using multithreading should not the locale is not changed thereafter, using multithreading should not
cause problems. cause problems.
\end{funcdesc} \end{funcdesc}
...@@ -52,16 +51,16 @@ Returns the database of of the local conventions as a dictionary. This ...@@ -52,16 +51,16 @@ Returns the database of of the local conventions as a dictionary. This
dictionary has the following strings as keys: dictionary has the following strings as keys:
\begin{itemize} \begin{itemize}
\item \code{decimal_point} specifies the decimal point used in \item \code{decimal_point} specifies the decimal point used in
floating point number representations for the \code{LC_NUMERIC} floating point number representations for the \constant{LC_NUMERIC}
category. category.
\item \code{grouping} is a sequence of numbers specifying at which \item \code{grouping} is a sequence of numbers specifying at which
relative positions the \code{thousands_sep} is expected. If the relative positions the \code{thousands_sep} is expected. If the
sequence is terminated with \code{locale.CHAR_MAX}, no further sequence is terminated with \constant{CHAR_MAX}, no further
grouping is performed. If the sequence terminates with a \code{0}, the last grouping is performed. If the sequence terminates with a \code{0}, the last
group size is repeatedly used. group size is repeatedly used.
\item \code{thousands_sep} is the character used between groups. \item \code{thousands_sep} is the character used between groups.
\item \code{int_curr_symbol} specifies the international currency \item \code{int_curr_symbol} specifies the international currency
symbol from the \code{LC_MONETARY} category. symbol from the \constant{LC_MONETARY} category.
\item \code{currency_symbol} is the local currency symbol. \item \code{currency_symbol} is the local currency symbol.
\item \code{mon_decimal_point} is the decimal point used in monetary \item \code{mon_decimal_point} is the decimal point used in monetary
values. values.
...@@ -84,8 +83,8 @@ the currency symbol. ...@@ -84,8 +83,8 @@ the currency symbol.
sign should be placed for positive and negative monetary values. sign should be placed for positive and negative monetary values.
\end{itemize} \end{itemize}
The possible values for \code{p_sign_posn} and \code{n_sign_posn} The possible values for \code{p_sign_posn} and
are given below. \code{n_sign_posn} are given below.
\begin{tableii}{c|l}{code}{Value}{Explanation} \begin{tableii}{c|l}{code}{Value}{Explanation}
\lineii{0}{Currency and value are surrounded by parentheses.} \lineii{0}{Currency and value are surrounded by parentheses.}
...@@ -138,7 +137,7 @@ conventions. ...@@ -138,7 +137,7 @@ conventions.
\begin{datadesc}{LC_CTYPE} \begin{datadesc}{LC_CTYPE}
\refstmodindex{string} \refstmodindex{string}
Locale category for the character type functions. Depending on the Locale category for the character type functions. Depending on the
settings of this category, the functions of module \module{string} settings of this category, the functions of module \refmodule{string}
dealing with case change their behaviour. dealing with case change their behaviour.
\end{datadesc} \end{datadesc}
...@@ -226,7 +225,7 @@ should you document that your module is not compatible with ...@@ -226,7 +225,7 @@ should you document that your module is not compatible with
non-\samp{C} locale settings. non-\samp{C} locale settings.
The case conversion functions in the The case conversion functions in the
\module{string}\refstmodindex{string} and \refmodule{string}\refstmodindex{string} and
\module{strop}\refbimodindex{strop} modules are affected by the locale \module{strop}\refbimodindex{strop} modules are affected by the locale
settings. When a call to the \function{setlocale()} function changes settings. When a call to the \function{setlocale()} function changes
the \constant{LC_CTYPE} settings, the variables the \constant{LC_CTYPE} settings, the variables
...@@ -258,8 +257,8 @@ generally okay, and Python will use whatever locale is set, ...@@ -258,8 +257,8 @@ generally okay, and Python will use whatever locale is set,
The \function{setlocale()} function in the \module{locale} module contains The \function{setlocale()} function in the \module{locale} module contains
gives the Python progammer the impression that you can manipulate the gives the Python progammer the impression that you can manipulate the
\constant{LC_NUMERIC} locale setting, but this not the case at the \C{} \constant{LC_NUMERIC} locale setting, but this not the case at the C
level: \C{} code will always find that the \constant{LC_NUMERIC} locale level: C code will always find that the \constant{LC_NUMERIC} locale
setting is \samp{C}. This is because too much would break when the setting is \samp{C}. This is because too much would break when the
decimal point character is set to something else than a period decimal point character is set to something else than a period
(e.g. the Python parser would break). Caveat: threads that run (e.g. the Python parser would break). Caveat: threads that run
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment