OSDN Git Service

f09ea9bd778ed40f22b1c2019d90fad6dac40ac8
[linuxjm/LDP_man-pages.git] / draft / man7 / locale.7
1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Modified Sat Jul 24 17:28:34 1993 by Rik Faith <faith@cs.unc.edu>
24 .\" Modified Sun Jun 01 17:16:34 1997 by Jochen Hein
25 .\"   <jochen.hein@delphi.central.de>
26 .\" Modified Thu Apr 25 00:43:19 2002 by Bruno Haible <bruno@clisp.org>
27 .\"
28 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
29 .\"         all rights reserved.
30 .\" Translated Wed Dec 24 21:08:08 JST 1997
31 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
32 .\" Modified Thu 14 Nov 2002 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
33 .\"
34 .\"WORD:        locale  ロケール
35 .\"
36 .TH LOCALE 7  2008-12-05 "Linux" "Linux Programmer's Manual"
37 .\"O .SH NAME
38 .\"O locale \- Description of multilanguage support
39 .SH 名前
40 locale \- 多言語サポートの解説
41 .\"O .SH SYNOPSIS
42 .SH 書式
43 .nf
44 .B #include <locale.h>
45 .fi
46 .\"O .SH DESCRIPTION
47 .SH 説明
48 .\"O A locale is a set of language and cultural rules.
49 .\"O These cover aspects
50 .\"O such as language for messages, different character sets, lexicographic
51 .\"O conventions, etc.
52 .\"O A program needs to be able to determine its locale
53 .\"O and act accordingly to be portable to different cultures.
54 ロケール (locale) は言語や文化ルールの集合である。
55 これらは、メッセージ出力に使用する言語・いろいろな文字集合・
56 表記に関する慣習といったような面をカバーしている。
57 プログラムをいろいろな文化に移植可能とするには、
58 そのプログラムは自分のロケールを決めて、
59 それに応じた適切な動作ができなければならない。
60 .PP
61 .\"O The header
62 .\"O .I <locale.h>
63 .\"O declares data types, functions and macros which are useful in this
64 .\"O task.
65 ヘッダーファイル
66 .I <locale.h>
67 には、この目的に便利なデータ型・関数・マクロなどの宣言がある。
68 .PP
69 .\"O The functions it declares are
70 .\"O .BR setlocale (3)
71 .\"O to set the current locale, and
72 .\"O .BR localeconv (3)
73 .\"O to get information about number formatting.
74 このヘッダーファイルで宣言されている関数には、
75 現在のロケールを設定する
76 .BR setlocale (3)
77 と、数値のフォーマット方法についての情報を取得する
78 .BR localeconv (3)
79 がある。
80 .PP
81 .\"O There are different categories for local information a program might
82 .\"O need; they are declared as macros.
83 .\"O Using them as the first argument
84 .\"O to the
85 .\"O .BR setlocale (3)
86 .\"O function, it is possible to set one of these to the desired locale:
87 プログラムの必要に応じて、ローカル情報はいろいろなカテゴリに分かれており、
88 それらはマクロとして宣言されている。
89 これらのマクロを
90 .BR setlocale (3)
91 関数の最初の引き数に用いると、
92 これらのどれかを望むロケールに設定できる。
93 .TP
94 .B LC_COLLATE
95 .\"O This is used to change the behavior of the functions
96 .\"O .BR strcoll (3)
97 .\"O and
98 .\"O .BR strxfrm (3),
99 .\"O which are used to compare strings in the local alphabet.
100 .\"O For example,
101 .\"O the German sharp s is sorted as "ss".
102 これは地域的なアルファベット文字列の比較に使用する
103 .BR strcoll (3)
104 関数と
105 .BR strxfrm (3)
106 関数の動作を変更する。例えばドイツ語のエスツェット (鋭い s)
107 は、ソートの際 "ss" として扱われる。
108 .TP
109 .B LC_CTYPE
110 .\"O This changes the behavior of the character handling and
111 .\"O classification functions, such as
112 .\"O .BR isupper (3)
113 .\"O and
114 .\"O .BR toupper (3),
115 .\"O and the multibyte character functions such as
116 .\"O .BR mblen (3)
117 .\"O or
118 .\"O .BR wctomb (3).
119 これは
120 .BR isupper (3)
121
122 .BR toupper (3)
123 のような文字の判定・操作をする関数や、多バイト文字を扱う
124 .BR mblen (3)
125
126 .BR wctomb (3)
127 のような関数の動作を変更する。
128 .TP
129 .B LC_MONETARY
130 .\"O changes the information returned by
131 .\"O .BR localeconv (3)
132 .\"O which describes the way numbers are usually printed, with details such
133 .\"O as decimal point versus decimal comma.
134 .\"O This information is internally
135 .\"O used by the function
136 .\"O .BR strfmon (3).
137 .BR localeconv (3)
138 によって返される情報を変更する。
139 これには小数点や区切りコンマの位置など、
140 数字の表示方法に関する詳細が含まれている。この情報は
141 .BR strfmon (3)
142 関数が内部で使用する。
143 .TP
144 .B LC_MESSAGES
145 .\"O changes the language messages are displayed in and what an affirmative or
146 .\"O negative answer looks like.
147 .\"O The GNU C-library contains the
148 .\"O .BR gettext (3),
149 .\"O .BR ngettext (3),
150 .\"O and
151 .\"O .BR rpmatch (3)
152 .\"O functions to ease the use of these information.
153 .\"O The GNU gettext family of
154 .\"O functions also obey the environment variable
155 .\"O .BR LANGUAGE
156 .\"O (containing a colon-separated list of locales)
157 .\"O if the category is set to a valid locale other than
158 .\"O .BR """C""" .
159 メッセージ表示に使用する言語を変更する。
160 また肯定的・否定的な回答をどのように表示するかを変更する。
161 これらの情報を簡単に使用するために、 GNU C ライブラリには
162 .BR gettext (3),
163 .BR ngettext (3),
164 .BR rpmatch (3)
165 関数が含まれている。
166 GNU gettext ファミリーに属する関数は、カテゴリが
167 .B """C"""
168 以外の有効なロケールに設定されている場合、環境変数
169 .B LANGUAGE
170 にも従う
171 .RB ( LANGUAGE
172 はコロン区切りのロケールのリストである)。
173 .TP
174 .B LC_NUMERIC
175 .\"O changes the information used by the
176 .\"O .BR printf (3)
177 .\"O and
178 .\"O .BR scanf (3)
179 .\"O family of functions, when they are advised to use the
180 .\"O locale-settings.
181 .\"O This information can also be read with the
182 .\"O .BR localeconv (3)
183 .\"O function.
184 .BR printf (3)
185 関数および
186 .BR scanf (3)
187 関数のファミリーでロケール設定を使うよう指示された場合に
188 用いる情報を変更する。この情報は
189 .BR localeconv (3)
190 関数で取得することもできる。
191 .TP
192 .B LC_TIME
193 .\"O changes the behavior of the
194 .\"O .BR strftime (3)
195 .\"O function to display the current time in a locally acceptable form; for
196 .\"O example, most of Europe uses a 24-hour clock versus the
197 .\"O 12-hour clock used in the United States.
198 .BR strftime (3)
199 関数の動作を変更し、
200 地域で利用されている方法で現在時刻を表示する。
201 例えば、ヨーロッパの多くでは 24時間式の時計を使うが、
202 アメリカでは 12時間式の時計を使う。
203 .TP
204 .B LC_ALL
205 .\"O All of the above.
206 上記の全て。
207 .\" FIXME glibc 2.2.2 added new nonstandard locale categories:
208 .\" LC_ADDRESS, LC_IDENTIFICATION, LC_MEASUREMENT, LC_NAME,
209 .\" LC_PAPER, LC_TELEPHONE.  These need to be documented.
210 .PP
211 .\"O If the second argument to
212 .\"O .BR setlocale (3)
213 .\"O is empty string,
214 .\"O .BR """""" ,
215 .\"O for the default locale, it is determined using the following steps:
216 .BR setlocale (3)
217 の二番目の引き数が空文字列 \fB""\fP の場合、
218 デフォルトのロケールは以下の手順で決定する:
219 .IP 1.
220 .\"O If there is a non-null environment variable
221 .\"O .BR LC_ALL ,
222 .\"O the value of
223 .\"O .B LC_ALL
224 .\"O is used.
225 環境変数
226 .B LC_ALL
227 が設定されている場合には
228 .B LC_ALL
229 の値が使用される。
230 .IP 2.
231 .\"O If an environment variable with the same name as one of the categories
232 .\"O above exists and is non-null, its value is used for that category.
233 上記のカテゴリのどれかと同じ名前の環境変数が設定されている場合には、
234 そのカテゴリにはその値が使用される。
235 .IP 3.
236 .\"O If there is a non-null environment variable
237 .\"O .BR LANG ,
238 .\"O the value of
239 .\"O .B LANG
240 .\"O is used.
241 環境変数
242 .B LANG
243 が設定されている場合には
244 .B LANG
245 の値が使用される。
246 .PP
247 .\"O Values about local numeric formatting is made available in a
248 .\"O .I struct lconv
249 .\"O returned by the
250 .\"O .BR localeconv (3)
251 .\"O function, which has the following declaration:
252 地域的な数値フォーマットの情報は
253 .BR localeconv (3)
254 関数によって返される
255 .I struct lconv
256 で得ることができ、これは以下のように宣言されている:
257 .in +4n
258 .nf
259
260 struct lconv {
261
262 .\"O     /* Numeric (nonmonetary) information */
263     /* (通貨以外の) 数値情報 */
264
265 .\"O     char *decimal_point;     /* Radix character */
266 .\"O     char *thousands_sep;     /* Separator for digit groups to left
267 .\"O                                 of radix character */
268 .\"O     char *grouping; /* Each element is the number of digits in a
269 .\"O                        group; elements with higher indices are
270 .\"O                        further left.  An element with value CHAR_MAX
271 .\"O                        means that no further grouping is done.  An
272 .\"O                        element with value 0 means that the previous
273 .\"O                        element is used for all groups further left. */
274     char *decimal_point;     /* 小数点の文字 */
275     char *thousands_sep;     /* 小数点の左側の数字のグループの
276                                 区切り文字 */
277     char *grouping; /* それぞれの要素は各グループの数字の個数である。
278                        インデックス値が大きいほど、左側のグループを表す。
279                        要素の値が CHAR_MAX の場合は、最後のグループで
280                        あることを意味する。要素の値が 0 の場合は、
281                        その要素より左側の全ての要素に前の要素と同じ値を
282                        使用することを意味する。 */
283
284 .\"O     /* Remaining fields are for monetary information */
285     /* 残りのフィールドは通貨情報用である */
286
287 .\"O     char *int_curr_symbol;   /* First three chars are a currency symbol
288 .\"O                                 from ISO 4217.  Fourth char is the
289 .\"O                                 separator.  Fifth char is \(aq\0\(aq. */
290 .\"O     char *currency_symbol;   /* Local currency symbol */
291 .\"O     char *mon_decimal_point; /* Radix character */
292 .\"O     char *mon_thousands_sep; /* Like `thousands_sep' above */
293 .\"O     char *mon_grouping;      /* Like `grouping' above */
294 .\"O     char *positive_sign;     /* Sign for positive values */
295 .\"O     char *negative_sign;     /* Sign for negative values */
296 .\"O     char  int_frac_digits;   /* International fractional digits */
297 .\"O     char  frac_digits;       /* Local fractional digits */
298     char *int_curr_symbol;   /* 最初の三つの文字は ISO 4217 の通貨記号。
299                                 四番目の文字は区切り文字。
300                                 五番目は \(aq\0\(aq。 */
301     char *currency_symbol;   /* 地域の通貨記号 */
302     char *mon_decimal_point; /* 小数点の文字 */
303     char *mon_thousands_sep; /* 上記の `thousands_sep' と同様 */
304     char *mon_grouping;      /* 上記の `grouping' と同様 */
305     char *positive_sign;     /* 正の値の符号 */
306     char *negative_sign;     /* 負の値の符号 */
307     char  int_frac_digits;   /* 国際的な小数部の数字 */
308     char  frac_digits;       /* 地域の小数部の数字 */
309 .\"O     char  p_cs_precedes;     /* 1 if currency_symbol precedes a
310 .\"O                                 positive value, 0 if succeeds */
311 .\"O     char  p_sep_by_space;    /* 1 if a space separates currency_symbol
312 .\"O                                 from a positive value */
313 .\"O     char  n_cs_precedes;     /* 1 if currency_symbol precedes a
314 .\"O                                 negative value, 0 if succeeds */
315 .\"O     char  n_sep_by_space;    /* 1 if a space separates currency_symbol
316 .\"O                                 from a negative value */
317     char  p_cs_precedes;     /* 正の値の前に通貨記号を置く場合は 1,
318                                 後ろに置く場合は 0 */
319     char  p_sep_by_space;    /* 正の値と通貨記号の間にスペースを
320                                 入れる場合は 1 */
321     char  n_cs_precedes;     /* 負の値の前に通貨記号を置く場合は 1,
322                                 後ろに置く場合は 0 */
323     char  n_sep_by_space;    /* 負の値と通貨記号の間にスペースを
324                                 入れる場合は 1 */
325 .\"O     /* Positive and negative sign positions:
326 .\"O        0 Parentheses surround the quantity and currency_symbol.
327 .\"O        1 The sign string precedes the quantity and currency_symbol.
328 .\"O        2 The sign string succeeds the quantity and currency_symbol.
329 .\"O        3 The sign string immediately precedes the currency_symbol.
330 .\"O        4 The sign string immediately succeeds the currency_symbol. */
331     /* 正と負の符号の位置:
332        0 値と通貨記号を括弧で囲む
333        1 符号は値と通貨記号の前に置く
334        2 符号は値と通貨記号の後に置く
335        3 符号は通貨記号の直後に置く
336        4 符号は通貨記号の直前に置く    */
337     char  p_sign_posn;
338     char  n_sign_posn;
339 };
340 .fi
341 .in
342 .\"O .SH "CONFORMING TO"
343 .SH 準拠
344 POSIX.1-2001
345
346 .\"O The GNU gettext functions are specified in LI18NUX2000.
347 GNU gettext 関数ファミリーは LI18NUX2000 で規定されている。
348 .\"O .SH "SEE ALSO"
349 .SH 関連項目
350 .BR locale (1),
351 .BR localedef (1),
352 .BR gettext (3),
353 .BR localeconv (3),
354 .BR ngettext (3),
355 .BR nl_langinfo (3),
356 .BR rpmatch (3),
357 .BR setlocale (3),
358 .BR strcoll (3),
359 .BR strfmon (3),
360 .BR strftime (3),
361 .BR strxfrm (3)