Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 194 lines (149 sloc) 6.387 kb
46a2425 @docelic Hehe, I seem productive this weekend ;-)
docelic authored
1 __NAME__ purpose
c1cb324 @docelic * Fixes and updates
docelic authored
2 specify locale definitions
46a2425 @docelic Hehe, I seem productive this weekend ;-)
docelic authored
3 __END__
4
5
6 __NAME__ synopsis
3496c8e @docelic * content or markup fixes
docelic authored
7 <arg choice='plain' rep='repeat'><replaceable>locale_key</replaceable> <replaceable>locale_value</replaceable></arg><sbr />
46a2425 @docelic Hehe, I seem productive this weekend ;-)
docelic authored
8 __END__
9
10
11 __NAME__ description
c1cb324 @docelic * Fixes and updates
docelic authored
12 The directive specifies the default &glos-locale; definitions for
13 a number of items:
14 <itemizedlist>
15 <listitem><para>
16 <literal>currency_symbol</literal> - default currency symbol. Can be a simple value like "<literal>$</literal>" or " <literal>E</literal>", or a more flexible setting such as '<literal>&lt;img src="euro.png" /&gt;</literal>'.
17 </para></listitem>
18 <listitem><para>
a815905 @docelic * Updates to I/J/K/L/M config directives
docelic authored
19 <literal>frac_digits</literal> -
c1cb324 @docelic * Fixes and updates
docelic authored
20 </para></listitem>
21 <listitem><para>
22 <literal>int_curr_symbol</literal> -
23 </para></listitem>
2a5ddc5 @racke int_currency_symbol added
racke authored
24 <listitem><para>
159e8d0 @racke describe int_currency_symbol
racke authored
25 <literal>int_currency_symbol</literal> - currency symbol for plain text display
2a5ddc5 @racke int_currency_symbol added
racke authored
26 </para></listitem>
c1cb324 @docelic * Fixes and updates
docelic authored
27 <listitem><para>
28 <literal>int_frac_digits</literal> -
29 </para></listitem>
30 <listitem><para>
31 <literal>mon_decimal_point</literal> -
32 </para></listitem>
33 <listitem><para>
34 <literal>mon_grouping</literal> -
35 </para></listitem>
36 <listitem><para>
37 <literal>price_picture</literal> -
38 </para></listitem>
39 <listitem><para>
40 <literal>mon_thousands_sep</literal> -
41 </para></listitem>
42 <listitem><para>
43 <literal>n_cs_precedes</literal> -
44 </para></listitem>
45 <listitem><para>
46 <literal>negative_sign</literal> -
47 </para></listitem>
48 <listitem><para>
9bbcf68 @racke fixed wording
racke authored
49 <literal>p_cs_precedes</literal> - whether currency symbol precedes price or vice versa
c1cb324 @docelic * Fixes and updates
docelic authored
50 </para></listitem>
51 <listitem><para>
b99c0ad @racke documented p_* currency locale values
racke authored
52 <literal>p_sep_by_space</literal> - number of spaces between currency symbol and price
c1cb324 @docelic * Fixes and updates
docelic authored
53 </para></listitem>
54 <listitem><para>
55 <literal>positive_sign</literal> -
56 </para></listitem>
57 </itemizedlist>
46a2425 @docelic Hehe, I seem productive this weekend ;-)
docelic authored
58 __END__
59
b66dae3 @docelic - bin/refs-autogen:
docelic authored
60 __NAME__ notes
61 If two locales are set "default" using &conf-Locale;, and no
62 &conf-DefaultLocale; is specified, the behavior is undefined as the first
63 "default" found will be set as the actual default.
64 __END__
65
c1cb324 @docelic * Fixes and updates
docelic authored
66 __NAME__ example: Defining general Locale
67 <programlisting>
68 Locale fr
69 </programlisting>
70 __END__
71
72 __NAME__ example: Defining Locale by individual keys
472c85c @docelic A large commit. Here's the deal:
docelic authored
73 Put the following in &gcf;:
46a2425 @docelic Hehe, I seem productive this weekend ;-)
docelic authored
74 <programlisting>
c1cb324 @docelic * Fixes and updates
docelic authored
75 Locale &lt;localedata
46a2425 @docelic Hehe, I seem productive this weekend ;-)
docelic authored
76 </programlisting>
3496c8e @docelic * content or markup fixes
docelic authored
77 The actual file <filename>localedata</filename> could be composed
c1cb324 @docelic * Fixes and updates
docelic authored
78 of the keys listed in <xref linkend="Locale_description"/>.
46a2425 @docelic Hehe, I seem productive this weekend ;-)
docelic authored
79 __END__
80
f2d8fd6 @racke add example for defining currency display parameters
racke authored
81 __NAME__ example: Price displayed as 1.000,00 EUR
82 <programlisting>
83 Locale de_DE currency_symbol EUR
84 Locale de_DE p_cs_precedes 0
85 Locale de_DE mon_decimal_point ,
86 Locale de_DE mon_thousands_sep .
87
88 [currency]1000[/currency]
89 </programlisting>
90 __END__
91
472c85c @docelic A large commit. Here's the deal:
docelic authored
92 __NAME__ missing
5f3f31f @docelic - Some new stuff, some placeholders, some updates/fixes to existing file...
docelic authored
93 purpose and description is wrong completely
c6c4dc1 @docelic - ran glossary entries and reference pages through a spellchecker aspell
docelic authored
94 The description doesn't seem to match the description of the same variable when set in catalog.cfg
267221c @docelic * Went over the rest of configuration directives, polished the text,
docelic authored
95 The usual list format of NAME (SYN, default DEF) - DESC
96 More sound examples
472c85c @docelic A large commit. Here's the deal:
docelic authored
97 __END__
5f3f31f @docelic - Some new stuff, some placeholders, some updates/fixes to existing file...
docelic authored
98
99
b8bc221 @docelic * Updates. Too bad I'm idle lately. My PC machines went broken, and
docelic authored
100 Example of POSIX setlocale for France, if properly aliased:
101
102 !block example
103 Locale fr
104 !endblock
105
106 ee C<setlocale(3)> for more information. If embedded Perl code is used to sort search returns, the C<setlocale()> will carry through to string collation.
107
108
5f3f31f @docelic - Some new stuff, some placeholders, some updates/fixes to existing file...
docelic authored
109
110
111 LI1: price_picture
112
113 .Interchange will format a currency number based on a "picture" given to it. The basic form is:
114
115 !block example; listitem=2
116 Locale en_US price_picture "$ ###,###,###.##"
117 !endblock
118
119 .The C<en_US> locale, for the United States, would display C<4452.3> as C<$ 4,452.30>. The same display can be achieved with:
120
121 !block example; listitem=2
122 Locale en_US mon_thousands_sep ,
123 Locale en_US mon_decimal_point .
124 Locale en_US p_cs_precedes 1
125 Locale en_US currency_symbol $
126 !endblock
127
128 .A common price_picture for European countries would be C<###.###.###,##>, which would display that same number as C<4.452,30>. To add a franc notation at the end for the locale C<fr_FR>, use the setting:
129
130 !block example; listitem=2
131 Locale fr_FR price_picture "##.###,## fr"
132 !endblock
133
134 Note[label='IMPORTANT NOTE: '] The decimal point in use, set by C<mon_decimal_point>, and the thousands separator, set by C<mon_thousands_sep> must match the settings in the price_picture. The C<frac_digits> setting is not used in this case. It is derived from the location of the decimal (if any).
135
136 .The same setting for C<fr_FR> above can be achieved with:
137
138 !block example; listitem=2
139 Locale fr_FR mon_thousands_sep .
140 Locale fr_FR mon_decimal_point ,
141 Locale fr_FR p_cs_precedes 0
142 Locale fr_FR currency_symbol fr
143 !endblock
144
145 .If the number of digits is greater than the # locations in the price_picture, the digits will be changed to asterisks. An overflow number above would show as C<**.***,** fr>.
146
147 LI1: picture
148
149 .Same as C<price_picture>, but sets the value returned if the C<[currency]> tag is not used. If the number of digits is greater than the # locations in the picture, the digits will be changed to asterisks, displaying something like C<**,***.**>.
150
151
152
153
154
155
156 H2: Placing Locale Information in a Database
157
158 Interchange has the capability to read its locale information from a database, named with the C<LocaleDatabase> directive. The database can be of any valid Interchange type. The locales are in columns, and the keys are in rows. For example, to set up price information:
159
160 !block example
161 key en_US fr_FR de_DE
162 PriceDivide 1 .1590 .58
163 mon_decimal_point . , ,
164 mon_thousands_sep , .
165 currency_symbol $ frs DM
166 ps_cs_precedes 1 0 0
167 !endblock
168
169 This would translate to the following:
170
171 !block example
172 Locale en_US PriceDivide 1
173 Locale en_US mon_decimal_point .
174 Locale en_US mon_thousands_sep ,
175 Locale en_US currency_symbol $
176 Locale en_US ps_cs_precedes 1
177
178 Locale fr_FR PriceDivide .1590
179 Locale fr_FR mon_decimal_point ,
180 Locale fr_FR mon_thousands_sep .
181 Locale fr_FR currency_symbol " frs"
182 Locale fr_FR ps_cs_precedes 0
183
184 Locale de_DE PriceDivide .58
185 Locale de_DE mon_decimal_point ,
186 Locale de_DE mon_thousands_sep " "
187 Locale de_DE currency_symbol "DM "
188 Locale de_DE ps_cs_precedes 1
189 !endblock
190
191 These settings append and overwrite any that are set in the catalog configuration files, including any include files.
192
193 Important note: This information is only read during catalog configuration. It is not reasonable to access a database for translation or currency conversion in the normal course of events.
Something went wrong with that request. Please try again.