OSDN Git Service

Update releases for LDP v3.76
[linuxjm/LDP_man-pages.git] / release / 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 .\"*******************************************************************
32 .\"
33 .\" This file was generated with po4a. Translate the source file.
34 .\"
35 .\"*******************************************************************
36 .\"
37 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
38 .\"         all rights reserved.
39 .\" Translated Wed Dec 24 21:08:08 JST 1997
40 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
41 .\" Modified Thu 14 Nov 2002 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
42 .\"
43 .TH LOCALE 7 2014\-12\-31 Linux "Linux Programmer's Manual"
44 .SH 名前
45 locale \- 多言語サポートの解説
46 .SH 書式
47 .nf
48 \fB#include <locale.h>\fP
49 .fi
50 .SH 説明
51 ロケール (locale) は言語や文化ルールの集合である。 これには、メッセージ出力に使用する言語、 様々な文字集合、
52 表記に関する慣習などが含まれる。 プログラムをいろいろな文化に移植可能とするには、 プログラムが自分のロケールを判定し、
53 それに応じた適切な動作ができる必要がある。
54 .PP
55 ヘッダーファイル \fI<locale.h>\fP には、 このための便利なデータ型、 関数、 マクロなどの宣言がある。
56 .PP
57 このヘッダーファイルで宣言されている関数には、 現在のロケールを設定する \fBsetlocale\fP(3)
58 と、数値のフォーマット方法についての情報を取得する \fBlocaleconv\fP(3)  がある。
59 .PP
60 ロケール情報は、 プログラムが必要とすると思われるいくつかのカテゴリに分かれており、 それらはマクロとして宣言されている。 これらのマクロを
61 \fBsetlocale\fP(3) 関数の最初の引き数に用いると、 各カテゴリを望むロケールに設定できる。
62 .TP 
63 \fBLC_ADDRESS\fP (GNU 拡張、 glibc 2.2 以降)
64 .\" See ISO/IEC Technical Report 14652
65 場所や地理関連の項目の表示に使用するフォーマット (郵便番号など) に関する設定を変更する。 この情報が必要なアプリケーションは
66 \fBnl_langinfo\fP(3) を使って非標準の要素を取得できる。 \fB_NL_ADDRESS_COUNTRY_NAME\fP
67 (指定されたロケールの言語での国名) や \fB_NL_ADDRESS_LANG_NAME\fP (指定されたロケールの言語での言語名) などがあり、
68 ドイツ語ロケールでは "Deutschland" と "Deutsch" といった文字列が返される。 他の要素名については
69 \fI<langinfo.h>\fP にリストがある。
70 .TP 
71 \fBLC_COLLATE\fP
72 This category governs the collation rules used for sorting and regular
73 expressions, including character equivalence classes and multicharacter
74 collating elements.  This locale category changes the behavior of the
75 functions \fBstrcoll\fP(3)  and \fBstrxfrm\fP(3), which are used to compare
76 strings in the local alphabet.  For example, the German sharp s is sorted as
77 "ss".
78 .TP 
79 \fBLC_CTYPE\fP
80 This category determines the interpretation of byte sequences as characters
81 (e.g., single versus multibyte characters), character classifications (e.g.,
82 alphabetic or digit), and the behavior of character classes.  It changes the
83 behavior of the character handling and classification functions, such as
84 \fBisupper\fP(3)  and \fBtoupper\fP(3), and the multibyte character functions such
85 as \fBmblen\fP(3)  or \fBwctomb\fP(3).
86 .TP 
87 \fBLC_IDENTIFICATION\fP (GNU 拡張、 glibc 2.2 以降)
88 .\" See ISO/IEC Technical Report 14652
89 ロケールのメタデータに関連する設定を変更する。 この情報が必要なアプリケーションは \fBnl_langinfo\fP(3)
90 を使って非標準の要素を取得できる。 \fB_NL_IDENTIFICATION_TITLE\fP (このロケール文書のタイトル) や
91 \fB_NL_IDENTIFICATION_TERRITORY\fP (このロケール文書が適用される地理的な範囲) などがあり、 "English
92 locale for the USA" や "USA" といった文字列が返される。 他の要素名については \fI<langinfo.h>\fP
93 にリストがある。
94 .TP 
95 \fBLC_MONETARY\fP
96 This category determines the formatting used for monetary\-related numeric
97 values.  This changes the information returned by \fBlocaleconv\fP(3), which
98 describes the way numbers are usually printed, with details such as decimal
99 point versus decimal comma.  This information is internally used by the
100 function \fBstrfmon\fP(3).
101 .TP 
102 \fBLC_MESSAGES\fP
103 This category affects the language in which messages are displayed and what
104 an affirmative or negative answer looks like.  The GNU C library contains
105 the \fBgettext\fP(3), \fBngettext\fP(3), and \fBrpmatch\fP(3)  functions to ease the
106 use of this information.  The GNU gettext family of functions also obey the
107 environment variable \fBLANGUAGE\fP (containing a colon\-separated list of
108 locales)  if the category is set to a valid locale other than \fB"C"\fP.  This
109 category also affects the behavior of \fBcatopen\fP(3).
110 .TP 
111 \fBLC_MEASUREMENT\fP (GNU 拡張、 glibc 2.2 以降)
112 ロケールの測定系 (つまり、メートル法かアメリカでよく使われる単位か) に関連する設定を変更する。 この情報が必要なアプリケーションは
113 \fBnl_langinfo\fP(3) を使って非標準の要素である \fB_NL_MEASUREMENT_MEASUREMENT\fP を取得できる。 この要素は
114 1 (メートル法) か 2 (アメリカでよく使われる単位) の値が入った文字列へのポインタを返す。
115 .TP 
116 \fBLC_NAME\fP (GNU 拡張、 glibc 2.2 以降)
117 .\" See ISO/IEC Technical Report 14652
118 人に呼びかける際に使用されるフォーマットに関する設定を変更する。 この情報が必要なアプリケーションは \fBnl_langinfo\fP(3)
119 を使って非標準の要素を取得できる。 \fB_NL_NAME_NAME_MR\fP (男性に対する一般的な呼び掛け) や \fB_NL_NAME_NAME_MS\fP
120 (女性に対する一般的な呼び掛け) などがあり、 ドイツ語ロケールでは "Herr" や "Frau" といった文字列が返される。 他の要素名については
121 \fI<langinfo.h>\fP にリストがある。
122 .TP 
123 \fBLC_NUMERIC\fP
124 This category determines the formatting rules used for nonmonetary numeric
125 values\(emfor example, the thousands separator and the radix character (a
126 period in most English\-speaking countries, but a comma in many other
127 regions).  It affects functions such as \fBprintf\fP(3), \fBscanf\fP(3), and
128 \fBstrtod\fP(3).  This information can also be read with the \fBlocaleconv\fP(3)
129 function.
130 .TP 
131 \fBLC_PAPER\fP (GNU 拡張、 glibc 2.2 以降)
132 .\" See ISO/IEC Technical Report 14652
133 標準的な紙のサイズの寸法 (US letter や A4 など) に関する設定を変更する。 この情報が必要なアプリケーションは
134 \fBnl_langinfo\fP(3) を使って非標準の要素である \fB_NL_PAPER_WIDTH\fP と \fB_NL_PAPER_HEIGHT\fP
135 を取得できる。 この要素はミリメーター単位の寸法を指定する \fIint\fP 値を返す。
136 .TP 
137 \fBLC_TELEPHONE\fP (GNU 拡張、 glibc 2.2 以降)
138 .\" See ISO/IEC Technical Report 14652
139 電話サービスで使用されるフォーマットに関する設定を変更する。 この情報が必要なアプリケーションは \fBnl_langinfo\fP(3)
140 を使って非標準の要素を取得できる。 \fB_NL_TELEPHONE_INT_PREFIX\fP (そのロケールでの電話番号の前に付く国を示す番号)
141 などがある。 "49" (ドイツの場合) といった文字列が返される。 他の要素名については \fI<langinfo.h>\fP
142 にリストがある。
143 .TP 
144 \fBLC_TIME\fP
145 This category governs the formatting used for date and time values.  For
146 example, most of Europe uses a 24\-hour clock versus the 12\-hour clock used
147 in the United States.  The setting of this category affects the behavior of
148 functions such as \fBstrftime\fP(3)  and \fBstrptime\fP(3).
149 .TP 
150 \fBLC_ALL\fP
151 上記の全て。
152 .PP
153 \fBsetlocale\fP(3)  の二番目の引き数が空文字列 \fB""\fP の場合、 デフォルトのロケールは以下の手順で決定する:
154 .IP 1.
155 環境変数 \fBLC_ALL\fP が設定されている場合には \fBLC_ALL\fP の値が使用される。
156 .IP 2.
157 上記のカテゴリのどれかと同じ名前の環境変数が設定されている場合には、 そのカテゴリにはその値が使用される。
158 .IP 3.
159 環境変数 \fBLANG\fP が設定されている場合には \fBLANG\fP の値が使用される。
160 .PP
161 地域的な数値フォーマットの情報は \fBlocaleconv\fP(3)  関数によって返される \fIstruct lconv\fP
162 で得ることができ、これは以下のように宣言されている:
163 .in +2n
164 .nf
165
166 struct lconv {
167
168     /* (通貨以外の) 数値情報 */
169
170     char *decimal_point;     /* 小数点の文字 */
171     char *thousands_sep;     /* 小数点の左側の数字のグループの
172                                 区切り文字 */
173     char *grouping; /* それぞれの要素は各グループの数字の個数である。
174                        インデックス値が大きいほど、左側のグループを表す。
175                        要素の値が CHAR_MAX の場合は、最後のグループで
176                        あることを意味する。要素の値が 0 の場合は、
177                        その要素より左側の全ての要素に前の要素と同じ値を
178                        使用することを意味する。 */
179
180     /* 残りのフィールドは通貨情報用である */
181
182     char *int_curr_symbol;   /* 最初の三つの文字は ISO 4217 の通貨記号。
183                                 四番目の文字は区切り文字。
184                                 五番目は \(aq\0\(aq。 */
185     char *currency_symbol;   /* 地域の通貨記号 */
186     char *mon_decimal_point; /* 小数点の文字 */
187     char *mon_thousands_sep; /* 上記の `thousands_sep' と同様 */
188     char *mon_grouping;      /* 上記の `grouping' と同様 */
189     char *positive_sign;     /* 正の値の符号 */
190     char *negative_sign;     /* 負の値の符号 */
191     char  int_frac_digits;   /* 国際的な小数部の数字 */
192     char  frac_digits;       /* 地域の小数部の数字 */
193     char  p_cs_precedes;     /* 正の値の前に通貨記号を置く場合は 1,
194                                 後ろに置く場合は 0 */
195     char  p_sep_by_space;    /* 正の値と通貨記号の間にスペースを
196                                 入れる場合は 1 */
197     char  n_cs_precedes;     /* 負の値の前に通貨記号を置く場合は 1,
198                                 後ろに置く場合は 0 */
199     char  n_sep_by_space;    /* 負の値と通貨記号の間にスペースを
200                                 入れる場合は 1 */
201     /* 正と負の符号の位置:
202        0 値と通貨記号を括弧で囲む
203        1 符号は値と通貨記号の前に置く
204        2 符号は値と通貨記号の後に置く
205        3 符号は通貨記号の直後に置く
206        4 符号は通貨記号の直前に置く    */
207     char  p_sign_posn;
208     char  n_sign_posn;
209 };
210 .fi
211 .in
212 .SS "ロケール API の POSIX.1\-2008 での拡張"
213 POSIX.1\-2008 では、 ロケール API への多くの拡張が標準化されている。 これは GNU C ライブラリのバージョン 2.3
214 で初めて登場した実装に基づいている。 これらの拡張は、 従来のロケール API
215 がマルチスレッドアプリケーションや複数のロケールを扱う必要があるアプリケーションとうまく組み合わせて使うことができない問題を解決するために設計された。
216
217 この拡張は、 ロケールオブジェクトの作成、操作のための新しい関数 (\fBnewlocale\fP(3), \fBfreelocale\fP(3),
218 \fBduplocale\fP(3), \fBuselocale\fP(3)) とサフィックス "_l" が付いた新しいライブラリ関数
219 (\fBtoupper_l\fP(3) など) で構成される。 新しいライブラリ関数は、 従来のロケール依存の API (\fBtoupper\fP(3) など)
220 を関数実行時に適用するロケールオブジェクトの指定ができるように拡張したものである。
221 .SH 環境変数
222 The following environment variable is used by \fBnewlocale\fP(3)  and
223 \fBsetlocale\fP(3), and thus affects all unprivileged localized programs:
224 .TP 
225 \fBLOCPATH\fP
226 A list of pathnames, separated by colons (\(aq:\(aq), that should be used to
227 find locale data.  If this variable is set, only the individual compiled
228 locale data files from \fILOCPATH\fP and the system default locale data path
229 are used; any available locale archives are not used (see \fBlocaledef\fP(1)).
230 The individual compiled locale data files are searched for under
231 subdirectories which depend on the currently used locale.  For example, when
232 \fIen_GB.UTF\-8\fP is used for a category, the following subdirectories are
233 searched for, in this order: \fIen_GB.UTF\-8\fP, \fIen_GB.utf8\fP, \fIen_GB\fP,
234 \fIen.UTF\-8\fP, \fIen.utf8\fP, and \fIen\fP.
235 .SH ファイル
236 .TP 
237 \fI/usr/lib/locale/locale\-archive\fP
238 Usual default locale archive location.
239 .TP 
240 \fI/usr/lib/locale\fP
241 Usual default path for compiled individual locale files.
242 .SH 準拠
243 .\"
244 .\" The GNU gettext functions are specified in LI18NUX2000.
245 POSIX.1\-2001.
246 .SH 関連項目
247 \fBlocale\fP(1), \fBlocaledef\fP(1), \fBcatopen\fP(3), \fBgettext\fP(3),
248 \fBlocaleconv\fP(3), \fBmbstowcs\fP(3), \fBnewlocale\fP(3), \fBngettext\fP(3),
249 \fBnl_langinfo\fP(3), \fBrpmatch\fP(3), \fBsetlocale\fP(3), \fBstrcoll\fP(3),
250 \fBstrfmon\fP(3), \fBstrftime\fP(3), \fBstrxfrm\fP(3), \fBuselocale\fP(3),
251 \fBwcstombs\fP(3), \fBlocale\fP(5), \fBcharsets\fP(7), \fBunicode\fP(7), \fButf\-8\fP(7)
252 .SH この文書について
253 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.76 の一部
254 である。プロジェクトの説明とバグ報告に関する情報は
255 http://www.kernel.org/doc/man\-pages/ に書かれている。