OSDN Git Service

(split) LDP: Update draft and release (from the previous commit)
[linuxjm/LDP_man-pages.git] / draft / man7 / locale.7
1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
2 .\" and Copyright (C) 2014 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .\" Modified Sat Jul 24 17:28:34 1993 by Rik Faith <faith@cs.unc.edu>
27 .\" Modified Sun Jun 01 17:16:34 1997 by Jochen Hein
28 .\"   <jochen.hein@delphi.central.de>
29 .\" Modified Thu Apr 25 00:43:19 2002 by Bruno Haible <bruno@clisp.org>
30 .\"
31 .\" FIXME Document LOCPATH;
32 .\" see http://sourceware.org/bugzilla/show_bug.cgi?id=174
33 .\"     Is removed for SUID/SGID programs (see sysdeps/generic/unsecvars.h)
34 .\"*******************************************************************
35 .\"
36 .\" This file was generated with po4a. Translate the source file.
37 .\"
38 .\"*******************************************************************
39 .\"
40 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
41 .\"         all rights reserved.
42 .\" Translated Wed Dec 24 21:08:08 JST 1997
43 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
44 .\" Modified Thu 14 Nov 2002 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
45 .\"
46 .TH LOCALE 7 2014\-03\-18 Linux "Linux Programmer's Manual"
47 .SH 名前
48 locale \- 多言語サポートの解説
49 .SH 書式
50 .nf
51 \fB#include <locale.h>\fP
52 .fi
53 .SH 説明
54 ロケール (locale) は言語や文化ルールの集合である。 これらは、メッセージ出力に使用する言語・いろいろな文字集合・
55 表記に関する慣習といったような面をカバーしている。 プログラムをいろいろな文化に移植可能とするには、 そのプログラムは自分のロケールを決めて、
56 それに応じた適切な動作ができなければならない。
57 .PP
58 ヘッダーファイル \fI<locale.h>\fP には、この目的に便利なデータ型・関数・マクロなどの宣言がある。
59 .PP
60 このヘッダーファイルで宣言されている関数には、 現在のロケールを設定する \fBsetlocale\fP(3)
61 と、数値のフォーマット方法についての情報を取得する \fBlocaleconv\fP(3)  がある。
62 .PP
63 プログラムの必要に応じて、ロケール情報はいろいろなカテゴリに分かれており、 それらはマクロとして宣言されている。 これらのマクロを
64 \fBsetlocale\fP(3)  関数の最初の引き数に用いると、 これらのどれかを望むロケールに設定できる。
65 .TP 
66 \fBLC_ADDRESS\fP (GNU 拡張、 glibc 2.2 以降)
67 .\" See ISO/IEC Technical Report 14652
68 Change settings that describe the formats (e.g., postal addresses)  used to
69 describe locations and geography\-related items.  Applications that need this
70 information can use \fBnl_langinfo\fP(3)  to retrieve nonstandard elements,
71 such as \fB_NL_ADDRESS_COUNTRY_NAME\fP (country name, in the language of the
72 locale)  and \fB_NL_ADDRESS_LANG_NAME\fP (language name, in the language of the
73 locale), which return strings such as "Deutschland" and "Deutsch" (for
74 German\-language locales).  (Other element names are listed in
75 \fI<langinfo.h>\fP.)
76 .TP 
77 \fBLC_COLLATE\fP
78 これは地域的なアルファベット文字列の比較に使用する \fBstrcoll\fP(3)  関数と \fBstrxfrm\fP(3)
79 関数の動作を変更する。例えばドイツ語のエスツェット (鋭い s)  は、ソートの際 "ss" として扱われる。
80 .TP 
81 \fBLC_CTYPE\fP
82 これは \fBisupper\fP(3)  や \fBtoupper\fP(3)  のような文字の判定・操作をする関数や、多バイト文字を扱う \fBmblen\fP(3)
83 や \fBwctomb\fP(3)  のような関数の動作を変更する。
84 .TP 
85 \fBLC_IDENTIFICATION\fP (GNU 拡張、 glibc 2.2 以降)
86 .\" See ISO/IEC Technical Report 14652
87 Change settings that relate to the metdata for the locale.  Applications
88 that need this information can use \fBnl_langinfo\fP(3)  to retrieve
89 nonstandard elements, such as \fB_NL_IDENTIFICATION_TITLE\fP (title of this
90 locale document)  and \fB_NL_IDENTIFICATION_TERRITORY\fP (geograpical territory
91 to which this locale document applies), which might return strings such as
92 "English locale for the USA" and "USA".  (Other element names are listed in
93 \fI<langinfo.h>\fP.)
94 .TP 
95 \fBLC_MONETARY\fP
96 \fBlocaleconv\fP(3)  によって返される情報を変更する。 これには小数点や区切りコンマの位置など、
97 数字の表示方法に関する詳細が含まれている。この情報は \fBstrfmon\fP(3)  関数が内部で使用する。
98 .TP 
99 \fBLC_MESSAGES\fP
100 メッセージ表示に使用する言語を変更する。 また肯定的・否定的な回答をどのように表示するかを変更する。 この情報を簡単に使用するために、 GNU C
101 ライブラリには \fBgettext\fP(3), \fBngettext\fP(3), \fBrpmatch\fP(3)  関数が含まれている。 GNU gettext
102 ファミリーに属する関数は、カテゴリが \fB"C"\fP 以外の有効なロケールに設定されている場合、環境変数 \fBLANGUAGE\fP にも従う
103 (\fBLANGUAGE\fP はコロン区切りのロケールのリストである)。
104 .TP 
105 \fBLC_MEASUREMENT\fP (GNU 拡張、 glibc 2.2 以降)
106 Change the settings relating to the measurement system in the locale (i.e.,
107 metric versus US customary units).  Applications can use \fBnl_langinfo\fP(3)
108 to retrieve the nonstandard \fB_NL_MEASUREMENT_MEASUREMENT\fP element, which
109 returns a pointer to a character that has the value 1 (metric) or 2 (US
110 customary units).
111 .TP 
112 \fBLC_NAME\fP (GNU 拡張、 glibc 2.2 以降)
113 .\" See ISO/IEC Technical Report 14652
114 Change settings that describe the formats used to address persons.
115 Applications that need this information can use \fBnl_langinfo\fP(3)  to
116 retrieve nonstandard elements, such as \fB_NL_NAME_NAME_MR\fP (general
117 salutation for men)  and \fB_NL_NAME_NAME_MS\fP (general salutation for women)
118 elements, which return strings such as "Herr" and "Frau" (for
119 German\-language locales).  (Other element names are listed in
120 \fI<langinfo.h>\fP.)
121 .TP 
122 \fBLC_NUMERIC\fP
123 \fBprintf\fP(3)  関数および \fBscanf\fP(3)  関数のファミリーでロケール設定を使うよう指示された場合に
124 用いる情報を変更する。この情報は \fBlocaleconv\fP(3)  関数で取得することもできる。
125 .TP 
126 \fBLC_PAPER\fP (GNU extension, since glibc 2.2)
127 .\" See ISO/IEC Technical Report 14652
128 Change the settings relating to the dimensions of the standard paper size
129 (e.g., US letter versus A4).  Applications that need the dimensions can
130 obtain them by using \fBnl_langinfo\fP(3)  to retrieve the nonstandard
131 \fB_NL_PAPER_WIDTH\fP and \fB_NL_PAPER_HEIGHT\fP elements, which return \fIint\fP
132 values specifying the dimensions in millimeters.
133 .TP 
134 \fBLC_TELEPHONE\fP (GNU extension, since glibc 2.2)
135 .\" See ISO/IEC Technical Report 14652
136 Change settings that describe the formats to be used with telephone
137 services.  Applications that need this information can use \fBnl_langinfo\fP(3)
138 to retrieve nonstandard elements, such as \fB_NL_TELEPHONE_INT_PREFIX\fP
139 (international prefix used to call numbers in this locale), which returns a
140 string such as "49" (for Germany).  (Other element names are listed in
141 \fI<langinfo.h>\fP.)
142 .TP 
143 \fBLC_TIME\fP
144 \fBstrftime\fP(3)  関数の動作を変更し、 地域で利用されている方法で現在時刻を表示する。 例えば、ヨーロッパの多くでは
145 24時間式の時計を使うが、 アメリカでは 12時間式の時計を使う。
146 .TP 
147 \fBLC_ALL\fP
148 上記の全て。
149 .PP
150 \fBsetlocale\fP(3)  の二番目の引き数が空文字列 \fB""\fP の場合、 デフォルトのロケールは以下の手順で決定する:
151 .IP 1.
152 環境変数 \fBLC_ALL\fP が設定されている場合には \fBLC_ALL\fP の値が使用される。
153 .IP 2.
154 上記のカテゴリのどれかと同じ名前の環境変数が設定されている場合には、 そのカテゴリにはその値が使用される。
155 .IP 3.
156 環境変数 \fBLANG\fP が設定されている場合には \fBLANG\fP の値が使用される。
157 .PP
158 地域的な数値フォーマットの情報は \fBlocaleconv\fP(3)  関数によって返される \fIstruct lconv\fP
159 で得ることができ、これは以下のように宣言されている:
160 .in +2n
161 .nf
162
163 struct lconv {
164
165     /* (通貨以外の) 数値情報 */
166
167     char *decimal_point;     /* 小数点の文字 */
168     char *thousands_sep;     /* 小数点の左側の数字のグループの
169                                 区切り文字 */
170     char *grouping; /* それぞれの要素は各グループの数字の個数である。
171                        インデックス値が大きいほど、左側のグループを表す。
172                        要素の値が CHAR_MAX の場合は、最後のグループで
173                        あることを意味する。要素の値が 0 の場合は、
174                        その要素より左側の全ての要素に前の要素と同じ値を
175                        使用することを意味する。 */
176
177     /* 残りのフィールドは通貨情報用である */
178
179     char *int_curr_symbol;   /* 最初の三つの文字は ISO 4217 の通貨記号。
180                                 四番目の文字は区切り文字。
181                                 五番目は \(aq\0\(aq。 */
182     char *currency_symbol;   /* 地域の通貨記号 */
183     char *mon_decimal_point; /* 小数点の文字 */
184     char *mon_thousands_sep; /* 上記の `thousands_sep' と同様 */
185     char *mon_grouping;      /* 上記の `grouping' と同様 */
186     char *positive_sign;     /* 正の値の符号 */
187     char *negative_sign;     /* 負の値の符号 */
188     char  int_frac_digits;   /* 国際的な小数部の数字 */
189     char  frac_digits;       /* 地域の小数部の数字 */
190     char  p_cs_precedes;     /* 正の値の前に通貨記号を置く場合は 1,
191                                 後ろに置く場合は 0 */
192     char  p_sep_by_space;    /* 正の値と通貨記号の間にスペースを
193                                 入れる場合は 1 */
194     char  n_cs_precedes;     /* 負の値の前に通貨記号を置く場合は 1,
195                                 後ろに置く場合は 0 */
196     char  n_sep_by_space;    /* 負の値と通貨記号の間にスペースを
197                                 入れる場合は 1 */
198     /* 正と負の符号の位置:
199        0 値と通貨記号を括弧で囲む
200        1 符号は値と通貨記号の前に置く
201        2 符号は値と通貨記号の後に置く
202        3 符号は通貨記号の直後に置く
203        4 符号は通貨記号の直前に置く    */
204     char  p_sign_posn;
205     char  n_sign_posn;
206 };
207 .fi
208 .in
209 .SS "POSIX.1\-2008 extensions to the locale API"
210 POSIX.1\-2008 standardized a number of extensions to the locale API, based on
211 implementations that first appeared in version 2.3 of the GNU C library.
212 These extensions are designed to address the problem that the traditional
213 locale APIs do not mix well with multithreaded applications and with
214 applications that must deal with multiple locales.
215
216 The extensions take the form of new functions for creating and manipulating
217 locale objects (\fBnewlocale\fP(3), \fBfreelocale\fP(3), \fBduplocale\fP(3), and
218 \fBuselocale\fP(3))  and various new library functions with the suffix "_l"
219 (e.g., \fBtoupper_l\fP(3))  that extend the traditional locale\-dependent APIs
220 (e.g., \fBtoupper\fP(3))  to allow the specification of a locale object that
221 should apply when executing the function.
222 .SH 準拠
223 .\"
224 .\" The GNU gettext functions are specified in LI18NUX2000.
225 POSIX.1\-2001.
226 .SH 関連項目
227 \fBlocale\fP(1), \fBlocaledef\fP(1), \fBcatopen\fP(3), \fBgettext\fP(3),
228 \fBlocaleconv\fP(3), \fBmbstowcs\fP(3), \fBnewlocale\fP(3), \fBngettext\fP(3),
229 \fBnl_langinfo\fP(3), \fBrpmatch\fP(3), \fBsetlocale\fP(3), \fBstrcoll\fP(3),
230 \fBstrfmon\fP(3), \fBstrftime\fP(3), \fBstrxfrm\fP(3), \fBuselocale\fP(3),
231 \fBwcstombs\fP(3), \fBlocale\fP(5)
232 .SH この文書について
233 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.64 の一部
234 である。プロジェクトの説明とバグ報告に関する情報は
235 http://www.kernel.org/doc/man\-pages/ に書かれている。