1 /*
2 * formats.c: The default formats supported in Gnumeric
3 *
4 * For information on how to translate these format strings properly,
5 * refer to the doc/translating.sgml file in the Gnumeric distribution.
6 *
7 * Author:
8 * Miguel de Icaza (miguel@kernel.org)
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of the
13 * License, or (at your option) version 3.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 * USA
24 */
25 #include <goffice/goffice-config.h>
26 #include "go-format.h"
27 #include "go-locale.h"
28 #include <goffice/utils/regutf8.h>
29 #include <glib/gi18n-lib.h>
30 #include <string.h>
31 #include <stdlib.h>
32
33 /* The various formats */
34 static char const * const
35 fmts_general [] = {
36 "General",
37 NULL
38 };
39
40 static char const * const
41 fmts_number [] = {
42 "0",
43 "0.00",
44 "#,##0",
45 "#,##0.00",
46 "#,##0_);(#,##0)",
47 "#,##0_);[Red](#,##0)",
48 "#,##0.00_);(#,##0.00)",
49 "#,##0.00_);[Red](#,##0.00)",
50 "0.0",
51 NULL
52 };
53
54 /* Some are generated */
55 static char const *
56 fmts_currency [] = {
57 NULL, /* "$#,##0", */
58 NULL, /* "$#,##0_);($#,##0)", */
59 NULL, /* "$#,##0_);[Red]($#,##0)", */
60 NULL, /* "$#,##0.00", */
61 NULL, /* "$#,##0.00_);($#,##0.00)", */
62 NULL, /* "$#,##0.00_);[Red]($#,##0.00)", */
63 NULL,
64 };
65
66 /* Some are generated */
67 static char const *
68 fmts_accounting [] = {
69 NULL, /* "_($* #,##0_);_($* (#,##0);_($* \"-\"_);_(@_)", */
70 NULL, /* "_(* #,##0_);_(* (#,##0);_(* \"-\"_);_(@_)", */
71 NULL, /* "_($* #,##0.00_);_($* (#,##0.00);_($* \"-\"??_);_(@_)", */
72 NULL, /* "_(* #,##0.00_);_(* (#,##0.00);_(* \"-\"??_);_(@_)", */
73 NULL
74 };
75
76 /* All are generated. */
77 static char const *fmts_date[50];
78 static gunichar date_sep;
79 static char const *fmts_time[50];
80
81 /*****************************************************/
82
83 static char const * const
84 fmts_percentage [] = {
85 "0%",
86 "0.00%",
87 NULL,
88 };
89
90 static char const * const
91 fmts_fraction [] = {
92 "# ?/?",
93 "# ?" "?/?" "?", /* Don't accidentally use trigraph. */
94 "# ?" "?" "?/?" "?" "?",
95 "# ?/2",
96 "# ?/4",
97 "# ?/8",
98 "# ?/16",
99 "# ?/10",
100 "# ?/100",
101 NULL
102 };
103
104 static char const * const
105 fmts_science [] = {
106 "0.00E+00",
107 "##0.0E+0",
108 NULL
109 };
110
111 static char const *
112 fmts_text [] = {
113 "@",
114 NULL,
115 };
116
117 char const * const *
_go_format_builtins(GOFormatFamily fam)118 _go_format_builtins(GOFormatFamily fam)
119 {
120 switch (fam) {
121 case GO_FORMAT_GENERAL: return fmts_general;
122 case GO_FORMAT_NUMBER: return fmts_number;
123 case GO_FORMAT_CURRENCY: return fmts_currency;
124 case GO_FORMAT_ACCOUNTING: return fmts_accounting;
125 case GO_FORMAT_DATE: return fmts_date;
126 case GO_FORMAT_TIME: return fmts_time;
127 case GO_FORMAT_PERCENTAGE: return fmts_percentage;
128 case GO_FORMAT_FRACTION: return fmts_fraction;
129 case GO_FORMAT_SCIENTIFIC: return fmts_science;
130 case GO_FORMAT_TEXT: return fmts_text;
131 case GO_FORMAT_SPECIAL:
132 case GO_FORMAT_MARKUP:
133 default:
134 return NULL;
135 }
136 };
137
138 static void
add_dt_format(GHashTable * dt_hash,gboolean timep,guint * N,const char * fmt)139 add_dt_format (GHashTable *dt_hash, gboolean timep, guint *N, const char *fmt)
140 {
141 char *fmt2;
142
143 if (g_hash_table_lookup (dt_hash, fmt))
144 return;
145
146 if (timep)
147 g_assert (*N + 1 < G_N_ELEMENTS (fmts_time));
148 else
149 g_assert (*N + 1 < G_N_ELEMENTS (fmts_date));
150 fmt2 = g_strdup (fmt);
151 (timep ? fmts_time : fmts_date)[*N] = fmt2;
152 g_hash_table_insert (dt_hash, fmt2, fmt2);
153 (*N)++;
154 (timep ? fmts_time : fmts_date)[*N] = NULL;
155 }
156
157 static void
add_frobbed_date_format(GHashTable * dt_hash,guint * N,const char * fmt)158 add_frobbed_date_format (GHashTable *dt_hash, guint *N, const char *fmt)
159 {
160 GString *s = g_string_new (NULL);
161
162 while (*fmt) {
163 if (*fmt == '/') {
164 g_string_append_unichar (s, date_sep);
165 } else
166 g_string_append_c (s, *fmt);
167 fmt++;
168 }
169
170 add_dt_format (dt_hash, FALSE, N, s->str);
171 g_string_free (s, TRUE);
172 }
173
174 static void
add_dmy_formats(GHashTable * dt_hash,guint * N)175 add_dmy_formats (GHashTable *dt_hash, guint *N)
176 {
177 add_frobbed_date_format (dt_hash, N, "dd/mm/yyyy");
178 add_frobbed_date_format (dt_hash, N, "dd/mm");
179 }
180
181 static void
add_mdy_formats(GHashTable * dt_hash,guint * N)182 add_mdy_formats (GHashTable *dt_hash, guint *N)
183 {
184 add_frobbed_date_format (dt_hash, N, "m/d/yyyy");
185 add_frobbed_date_format (dt_hash, N, "m/d");
186 }
187
188 /* Very hacky. Sorry. */
189 static gunichar
guess_date_sep(void)190 guess_date_sep (void)
191 {
192 const GString *df = go_locale_get_date_format();
193 const char *s;
194
195 for (s = df->str; *s; s++) {
196 switch (*s) {
197 case 'd': case 'm': case 'y':
198 while (g_ascii_isalpha (*s))
199 s++;
200 while (g_unichar_isspace (g_utf8_get_char (s)))
201 s = g_utf8_next_char (s);
202 if (*s != ',' &&
203 g_unichar_ispunct (g_utf8_get_char (s)))
204 return g_utf8_get_char (s);
205 break;
206 default:
207 ; /* Nothing */
208 }
209 }
210
211 return '/';
212 }
213
214 void
_go_currency_date_format_init(void)215 _go_currency_date_format_init (void)
216 {
217 GOFormatCurrency const *currency = go_format_locale_currency ();
218 GHashTable *dt_hash;
219 GOFormat *fmt;
220 guint N;
221 int i;
222 GOFormatDetails *details;
223
224 details = go_format_details_new (GO_FORMAT_CURRENCY);
225 details->currency = currency;
226 for (i = 0; i < 6; i++) {
227 GString *str = g_string_new (NULL);
228 details->num_decimals = (i >= 3) ? 2 : 0;
229 details->negative_red = (i % 3 == 2);
230 details->negative_paren = (i % 3 >= 1);
231 go_format_generate_str (str, details);
232 fmts_currency[i] = g_string_free (str, FALSE);
233 }
234 go_format_details_free (details);
235
236 details = go_format_details_new (GO_FORMAT_ACCOUNTING);
237 for (i = 0; i < 4; i++) {
238 GString *str = g_string_new (NULL);
239 details->num_decimals = (i >= 2) ? 2 : 0;
240 details->currency = (i & 1) ? NULL : currency;
241 go_format_generate_str (str, details);
242 fmts_accounting[i] = g_string_free (str, FALSE);
243 }
244 go_format_details_free (details);
245
246 /* ---------------------------------------- */
247
248 date_sep = guess_date_sep ();
249 dt_hash = g_hash_table_new (g_str_hash, g_str_equal);
250 N = 0;
251
252 fmt = go_format_new_magic (GO_FORMAT_MAGIC_LONG_DATE);
253 if (fmt) {
254 add_dt_format (dt_hash, FALSE, &N, go_format_as_XL (fmt));
255 go_format_unref (fmt);
256 }
257 fmt = go_format_new_magic (GO_FORMAT_MAGIC_MEDIUM_DATE);
258 if (fmt) {
259 add_dt_format (dt_hash, FALSE, &N, go_format_as_XL (fmt));
260 go_format_unref (fmt);
261 }
262 fmt = go_format_new_magic (GO_FORMAT_MAGIC_SHORT_DATE);
263 if (fmt) {
264 add_dt_format (dt_hash, FALSE, &N, go_format_as_XL (fmt));
265 go_format_unref (fmt);
266 }
267
268 switch (go_locale_month_before_day ()) {
269 case 0:
270 add_dmy_formats (dt_hash, &N);
271 break;
272 default:
273 case 1:
274 add_mdy_formats (dt_hash, &N);
275 break;
276 case 2:
277 add_dt_format (dt_hash, FALSE, &N, "yyyy/mm/dd");
278 add_mdy_formats (dt_hash, &N);
279 break;
280 }
281
282 /* Make sure these exist no matter what. */
283 add_dt_format (dt_hash, FALSE, &N, "m/d/yyyy");
284 add_dt_format (dt_hash, FALSE, &N, "m/d/yy");
285 add_dt_format (dt_hash, FALSE, &N, "dd/mm/yyyy");
286 add_dt_format (dt_hash, FALSE, &N, "dd/mm/yy");
287 add_dt_format (dt_hash, FALSE, &N, "d-mmm-yyyy");
288 add_dt_format (dt_hash, FALSE, &N, "yyyy-mm-dd");
289
290 fmt = go_format_new_magic (GO_FORMAT_MAGIC_SHORT_DATETIME);
291 if (fmt) {
292 add_dt_format (dt_hash, FALSE, &N, go_format_as_XL (fmt));
293 go_format_unref (fmt);
294 }
295 add_dt_format (dt_hash, FALSE, &N, "yyyy-mm-dd hh:mm:ss");
296 /* ISO 8601 (zulu time only for now) */
297 add_dt_format (dt_hash, FALSE, &N, "yyyy-mm-dd\"T\"hh:mm:ss\"Z\"");
298
299
300 g_hash_table_destroy (dt_hash);
301
302 /* ---------------------------------------- */
303
304 dt_hash = g_hash_table_new (g_str_hash, g_str_equal);
305 N = 0;
306
307 fmt = go_format_new_magic (GO_FORMAT_MAGIC_LONG_TIME);
308 if (fmt) {
309 add_dt_format (dt_hash, TRUE, &N, go_format_as_XL (fmt));
310 go_format_unref (fmt);
311 }
312 fmt = go_format_new_magic (GO_FORMAT_MAGIC_MEDIUM_TIME);
313 if (fmt) {
314 add_dt_format (dt_hash, TRUE, &N, go_format_as_XL (fmt));
315 go_format_unref (fmt);
316 }
317 fmt = go_format_new_magic (GO_FORMAT_MAGIC_SHORT_TIME);
318 if (fmt) {
319 add_dt_format (dt_hash, TRUE, &N, go_format_as_XL (fmt));
320 go_format_unref (fmt);
321 }
322
323 /* Must-have formats. */
324 add_dt_format (dt_hash, TRUE, &N, "h:mm AM/PM");
325 add_dt_format (dt_hash, TRUE, &N, "h:mm:ss AM/PM");
326 add_dt_format (dt_hash, TRUE, &N, "hh:mm");
327 add_dt_format (dt_hash, TRUE, &N, "hh:mm:ss");
328 add_dt_format (dt_hash, TRUE, &N, "h:mm:ss");
329
330 /* Elapsed time. */
331 add_dt_format (dt_hash, TRUE, &N, "[h]:mm:ss");
332 add_dt_format (dt_hash, TRUE, &N, "[mm]:ss");
333
334 g_hash_table_destroy (dt_hash);
335 }
336
337 void
_go_currency_date_format_shutdown(void)338 _go_currency_date_format_shutdown (void)
339 {
340 /* We need to free allocated strings since */
341 /* currency_date_format_init/shutdown may */
342 /* be called repeatedly by the format selector */
343 /* when switching locales */
344
345 int i;
346
347 for (i = 0; i < 6; i++) {
348 g_free ((char *)(fmts_currency[i]));
349 fmts_currency[i] = NULL;
350 }
351
352 for (i = 0; i < 4; i++) {
353 g_free ((char *)(fmts_accounting[i]));
354 fmts_accounting[i] = NULL;
355 }
356
357 for (i = 0; fmts_date[i]; i++) {
358 g_free ((char*)(fmts_date[i]));
359 fmts_date[i] = NULL;
360 }
361
362 for (i = 0; fmts_time[i]; i++) {
363 g_free ((char*)(fmts_time[i]));
364 fmts_time[i] = NULL;
365 }
366 }
367
368 static GOFormatCurrency const _go_format_currencies_table[] =
369 {
370 { "", N_("None"), TRUE, FALSE }, /* These first six elements */
371 { "$", "$", TRUE, FALSE }, /* Must stay in this order */
372 { "£", "£", TRUE, FALSE }, /* GBP */
373 { "¥", "¥", TRUE, FALSE }, /* JPY */
374
375 /* Add yours to this list ! */
376 { "[$€-1]", "€ Euro (100 €)", FALSE, TRUE},
377 { "[$€-2]", "€ Euro (€ 100)", TRUE, TRUE},
378
379 /* The first column has three letter acronyms
380 * for each currency. They MUST start with '[$'
381 * The second column has the long names of the currencies.
382 */
383
384 /* 2010/08/12 Updated to match iso 4217 */
385
386 { "[$AED]", N_("United Arab Emirates, Dirhams"), TRUE, TRUE},
387 { "[$AFN]", N_("Afghanistan, Afghanis"), TRUE, TRUE},
388 { "[$ALL]", N_("Albania, Leke"), TRUE, TRUE},
389 { "[$AMD]", N_("Armenia, Drams"), TRUE, TRUE},
390 { "[$ANG]", N_("Netherlands antilles, Guilders"), TRUE, TRUE},
391 { "[$AOA]", N_("Angola, Kwanza"), TRUE, TRUE},
392 { "[$ARS]", N_("Argentina, Pesos"), TRUE, TRUE},
393 { "[$AUD]", N_("Australia, Dollars"), TRUE, TRUE},
394 { "[$AWG]", N_("Aruba, Guilders"), TRUE, TRUE},
395 { "[$AZN]", N_("Azerbaijan, Manats"), TRUE, TRUE},
396 { "[$BAM]", N_("Bosnia and herzegovina, Convertible Marka"), TRUE, TRUE},
397 { "[$BBD]", N_("Barbados, Dollars"), TRUE, TRUE},
398 { "[$BDT]", N_("Bangladesh, Taka"), TRUE, TRUE},
399 { "[$BGN]", N_("Bulgaria, Leva"), TRUE, TRUE},
400 { "[$BHD]", N_("Bahrain, Dinars"), TRUE, TRUE},
401 { "[$BIF]", N_("Burundi, Francs"), TRUE, TRUE},
402 { "[$BMD]", N_("Bermuda, Dollars"), TRUE, TRUE},
403 { "[$BND]", N_("Brunei Darussalam, Dollars"), TRUE, TRUE},
404 { "[$BOB]", N_("Bolivia, Bolivianos"), TRUE, TRUE},
405 { "[$BOV]", N_("Bolivia, Mvdol"), TRUE, TRUE},
406 { "[$BRL]", N_("Brazil, Brazilian Real"), TRUE, TRUE},
407 { "[$BSD]", N_("Bahamas, Dollars"), TRUE, TRUE},
408 { "[$BTN]", N_("Bhutan, Ngultrum"), TRUE, TRUE},
409 { "[$BWP]", N_("Botswana, Pulas"), TRUE, TRUE},
410 { "[$BYR]", N_("Belarus, Rubles"), TRUE, TRUE},
411 { "[$BZD]", N_("Belize, Dollars"), TRUE, TRUE},
412 { "[$CAD]", N_("Canada, Dollars"), TRUE, TRUE},
413 { "[$CDF]", N_("Congo, the democratic republic of, Congolese Francs"), TRUE, TRUE},
414 { "[$CHE]", N_("Switzerland, WIR Euros"), TRUE, TRUE},
415 { "[$CHF]", N_("Switzerland, Francs"), TRUE, TRUE},
416 { "[$CHW]", N_("Switzerland, WIR Francs"), TRUE, TRUE},
417 { "[$CLF]", N_("Chile, Unidades de fomento"), TRUE, TRUE},
418 { "[$CLP]", N_("Chile, Pesos"), TRUE, TRUE},
419 { "[$CNY]", N_("China, Yuan Renminbi"), TRUE, TRUE},
420 { "[$COP]", N_("Colombia, Pesos"), TRUE, TRUE},
421 { "[$COU]", N_("Colombia, Unidades de Valor Real"), TRUE, TRUE},
422 { "[$CRC]", N_("Costa rica, Colones"), TRUE, TRUE},
423 { "[$CUC]", N_("Cuba, Pesos Convertibles"), TRUE, TRUE},
424 { "[$CUP]", N_("Cuba, Pesos"), TRUE, TRUE},
425 { "[$CVE]", N_("Cape verde, Escudos"), TRUE, TRUE},
426 { "[$CZK]", N_("Czech republic, Koruny"), TRUE, TRUE},
427 { "[$DJF]", N_("Djibouti, Francs"), TRUE, TRUE},
428 { "[$DKK]", N_("Denmark, Kroner"), TRUE, TRUE},
429 { "[$DOP]", N_("Dominican republic, Pesos"), TRUE, TRUE},
430 { "[$DZD]", N_("Algeria, Algerian Dinars"), TRUE, TRUE},
431 { "[$EGP]", N_("Egypt, Pounds"), TRUE, TRUE},
432 { "[$ERN]", N_("Eritrea, Nakfa"), TRUE, TRUE},
433 { "[$ETB]", N_("Ethiopia, Birr"), TRUE, TRUE},
434 { "[$EUR]", N_("Euro Members Countries, Euros"), TRUE, TRUE},
435 { "[$FJD]", N_("Fiji, Dollars"), TRUE, TRUE},
436 { "[$FKP]", N_("Falkland Islands (Malvinas), Pounds"), TRUE, TRUE},
437 { "[$GBP]", N_("United kingdom, Pounds"), TRUE, TRUE},
438 { "[$GEL]", N_("Georgia, Lari"), TRUE, TRUE},
439 { "[$GHS]", N_("Ghana, Cedis"), TRUE, TRUE},
440 { "[$GIP]", N_("Gibraltar, Pounds"), TRUE, TRUE},
441 { "[$GMD]", N_("Gambia, Dalasi"), TRUE, TRUE},
442 { "[$GNF]", N_("Guinea, Francs"), TRUE, TRUE},
443 { "[$GTQ]", N_("Guatemala, Quetzales"), TRUE, TRUE},
444 { "[$GYD]", N_("Guyana, Dollars"), TRUE, TRUE},
445 { "[$HKD]", N_("Hong Kong, Dollars"), TRUE, TRUE},
446 { "[$HNL]", N_("Honduras, Lempiras"), TRUE, TRUE},
447 { "[$HRK]", N_("Croatia, Kuna"), TRUE, TRUE},
448 { "[$HTG]", N_("Haiti, Gourdes"), TRUE, TRUE},
449 { "[$HUF]", N_("Hungary, Forint"), TRUE, TRUE},
450 { "[$IDR]", N_("Indonesia, Rupiahs"), TRUE, TRUE},
451 { "[$ILS]", N_("Israel, New Sheqels"), TRUE, TRUE},
452 { "[$INR]", N_("India, Rupees"), TRUE, TRUE},
453 { "[$IQD]", N_("Iraq, Dinars"), TRUE, TRUE},
454 { "[$IRR]", N_("Iran, Rials"), TRUE, TRUE},
455 { "[$ISK]", N_("Iceland, Kronur"), TRUE, TRUE},
456 { "[$JMD]", N_("Jamaica, Dollars"), TRUE, TRUE},
457 { "[$JOD]", N_("Jordan, Dinars"), TRUE, TRUE},
458 { "[$JPY]", N_("Japan, Yen"), TRUE, TRUE},
459 { "[$KES]", N_("Kenya, Shillings"), TRUE, TRUE},
460 { "[$KGS]", N_("Kyrgyzstan, Soms"), TRUE, TRUE},
461 { "[$KHR]", N_("Cambodia, Riels"), TRUE, TRUE},
462 { "[$KMF]", N_("Comoros, Francs"), TRUE, TRUE},
463 { "[$KPW]", N_("Korea (North), Won"), TRUE, TRUE},
464 { "[$KRW]", N_("Korea (South) Wons"), TRUE, TRUE},
465 { "[$KWD]", N_("Kuwait, Dinars"), TRUE, TRUE},
466 { "[$KYD]", N_("Cayman islands, Dollars"), TRUE, TRUE},
467 { "[$KZT]", N_("Kazakhstan, Tenge"), TRUE, TRUE},
468 { "[$LAK]", N_("Laos, Kips"), TRUE, TRUE},
469 { "[$LBP]", N_("Lebanon, Pounds"), TRUE, TRUE},
470 { "[$LKR]", N_("Sri Lanka, Rupees"), TRUE, TRUE},
471 { "[$LRD]", N_("Liberia, Dollars"), TRUE, TRUE},
472 { "[$LTL]", N_("Lithuania, Litai"), TRUE, TRUE},
473 { "[$LVL]", N_("Latvia, Lati"), TRUE, TRUE},
474 { "[$LYD]", N_("Libya, Dinars"), TRUE, TRUE},
475 { "[$MAD]", N_("Morocco, Dirhams"), TRUE, TRUE},
476 { "[$MDL]", N_("Moldova, Lei"), TRUE, TRUE},
477 { "[$MGA]", N_("Madagascar, Malagasy Ariary"), TRUE, TRUE},
478 { "[$MKD]", N_("Macedonia, Denars"), TRUE, TRUE},
479 { "[$MMK]", N_("Myanmar (Burma), Kyats"), TRUE, TRUE},
480 { "[$MNT]", N_("Mongolia, Tugriks"), TRUE, TRUE},
481 { "[$MOP]", N_("Macao, Patacas"), TRUE, TRUE},
482 { "[$MRO]", N_("Mauritania, Ouguiyas"), TRUE, TRUE},
483 { "[$MUR]", N_("Mauritius, Rupees"), TRUE, TRUE},
484 { "[$MVR]", N_("Maldives (Maldive Islands), Rufiyaas"), TRUE, TRUE},
485 { "[$MWK]", N_("Malawi, Kwachas"), TRUE, TRUE},
486 { "[$MXN]", N_("Mexico, Pesos"), TRUE, TRUE},
487 { "[$MXV]", N_("Mexico, Unidades de Inversion"), TRUE, TRUE},
488 { "[$MYR]", N_("Malaysia, Ringgits"), TRUE, TRUE},
489 { "[$MZN]", N_("Mozambique, Meticais"), TRUE, TRUE},
490 { "[$NGN]", N_("Nigeria, Nairas"), TRUE, TRUE},
491 { "[$NIO]", N_("Nicaragua, Gold Cordobas"), TRUE, TRUE},
492 { "[$NOK]", N_("Norway, Norwegian Krone"), TRUE, TRUE},
493 { "[$NPR]", N_("Nepal, Nepalese Rupees"), TRUE, TRUE},
494 { "[$NZD]", N_("New zealand, Dollars"), TRUE, TRUE},
495 { "[$OMR]", N_("Oman, Rials"), TRUE, TRUE},
496 { "[$PAB]", N_("Panama, Balboa"), TRUE, TRUE},
497 { "[$PEN]", N_("Peru, Nuevo Soles"), TRUE, TRUE},
498 { "[$PGK]", N_("Papua New Guinea, Kina"), TRUE, TRUE},
499 { "[$PHP]", N_("Philippines, Pesos"), TRUE, TRUE},
500 { "[$PKR]", N_("Pakistan, Rupees"), TRUE, TRUE},
501 { "[$PLN]", N_("Poland, Zlotys"), TRUE, TRUE},
502 { "[$PYG]", N_("Paraguay, Guarani"), TRUE, TRUE},
503 { "[$QAR]", N_("Qatar, Rials"), TRUE, TRUE},
504 { "[$RON]", N_("Romania, New Lei"), TRUE, TRUE},
505 { "[$RSD]", N_("Serbia, Dinars"), TRUE, TRUE},
506 { "[$RUB]", N_("Russia, Rubles"), TRUE, TRUE},
507 { "[$RWF]", N_("Rwanda, Rwanda Francs"), TRUE, TRUE},
508 { "[$SAR]", N_("Saudi arabia, Riyals"), TRUE, TRUE},
509 { "[$SBD]", N_("Solomon Islands, Dollars"), TRUE, TRUE},
510 { "[$SCR]", N_("Seychelles, Rupees"), TRUE, TRUE},
511 { "[$SDG]", N_("Sudan, Pounds"), TRUE, TRUE},
512 { "[$SDR]", N_("International Monetary Fund (I.M.F), SDR"), TRUE, TRUE},
513 { "[$SEK]", N_("Sweden, Kronor"), TRUE, TRUE},
514 { "[$SGD]", N_("Singapore, Dollars"), TRUE, TRUE},
515 { "[$SHP]", N_("Saint Helena, Ascension and Tristan da Cunha, Pounds"), TRUE, TRUE},
516 { "[$SLL]", N_("Sierra leone, Leones"), TRUE, TRUE},
517 { "[$SOS]", N_("Somalia, Shillings"), TRUE, TRUE},
518 { "[$SRD]", N_("Suriname, Dollars"), TRUE, TRUE},
519 { "[$STD]", N_("São Tome and Principe, Dobras"), TRUE, TRUE},
520 { "[$SVC]", N_("El Salvador, Colones"), TRUE, TRUE},
521 { "[$SYP]", N_("Syria, Pounds"), TRUE, TRUE},
522 { "[$SZL]", N_("Swaziland, Emalangeni"), TRUE, TRUE},
523 { "[$THB]", N_("Thailand, Baht"), TRUE, TRUE},
524 { "[$TJS]", N_("Tajikistan, Somoni"), TRUE, TRUE},
525 { "[$TMT]", N_("Turkmenistan, Manats"), TRUE, TRUE},
526 { "[$TND]", N_("Tunisia, Dinars"), TRUE, TRUE},
527 { "[$TOP]", N_("Tonga, Pa'angas"), TRUE, TRUE},
528 { "[$TRY]", N_("Turkey, Liras"), TRUE, TRUE},
529 { "[$TTD]", N_("Trinidad and Tobago, Dollars"), TRUE, TRUE},
530 { "[$TWD]", N_("Taiwan, New Dollars"), TRUE, TRUE},
531 { "[$TZS]", N_("Tanzania, Shillings"), TRUE, TRUE},
532 { "[$UAH]", N_("Ukraine, Hryvnia"), TRUE, TRUE},
533 { "[$UGX]", N_("Uganda, Shillings"), TRUE, TRUE},
534 { "[$USD]", N_("United States of America, Dollars"), TRUE, TRUE},
535 { "[$USN]", N_("United States of America, Dollars (Next day)"), TRUE, TRUE},
536 { "[$USS]", N_("United States of America, Dollars (Same day)"), TRUE, TRUE},
537 { "[$UYI]", N_("Uruguay, Pesos en Unidades Indexadas"), TRUE, TRUE},
538 { "[$UYU]", N_("Uruguay, Pesos"), TRUE, TRUE},
539 { "[$UZS]", N_("Uzbekistan, Sums"), TRUE, TRUE},
540 { "[$VEF]", N_("Venezuela, Bolivares Fuertes"), TRUE, TRUE},
541 { "[$VND]", N_("Viet Nam, Dong"), TRUE, TRUE},
542 { "[$VUV]", N_("Vanuatu, Vatu"), TRUE, TRUE},
543 { "[$WST]", N_("Samoa, Tala"), TRUE, TRUE},
544 { "[$XAF]", N_("Communaute Financiere Africaine BEAC, Francs"), TRUE, TRUE},
545 { "[$XAG]", N_("Silver, Ounces"), TRUE, TRUE },
546 { "[$XAU]", N_("Gold, Ounces"), TRUE, TRUE },
547 { "[$XBA]", N_("Bond Markets Units, European Composite Units (EURCO)"), TRUE, TRUE },
548 { "[$XBB]", N_("European Monetary Units (E.M.U.-6)"), TRUE, TRUE },
549 { "[$XBC]", N_("European Units of Account 9 (E.U.A.-9)"), TRUE, TRUE },
550 { "[$XBD]", N_("European Units of Account 17 (E.U.A.-17)"), TRUE, TRUE },
551 { "[$XCD]", N_("East Caribbean Dollars"), TRUE, TRUE},
552 { "[$XFU]", N_("UIC-Francs"), TRUE, TRUE },
553 { "[$XOF]", N_("Communaute Financiere Africaine BCEAO, Francs"), TRUE, TRUE},
554 { "[$XPF]", N_("Comptoirs Francais du Pacifique, Francs"), TRUE, TRUE},
555 { "[$XPT]", N_("Palladium, Ounces"), TRUE, TRUE },
556 { "[$YER]", N_("Yemen, Rials"), TRUE, TRUE},
557 { "[$ZAR]", N_("South Africa, Rands"), TRUE, TRUE},
558 { "[$LSL]", N_("Lesotho, Maloti"), TRUE, TRUE},
559 { "[$NAD]", N_("Namibia, Dollars"), TRUE, TRUE},
560 { "[$ZMK]", N_("Zambia, Zambian Kwacha"), TRUE, TRUE},
561 { "[$ZWL]", N_("Zimbabwe, Zimbabwe Dollars"), TRUE, TRUE},
562
563 { NULL, NULL, FALSE, FALSE }
564 };
565
566
_go_format_currencies(void)567 GOFormatCurrency const *_go_format_currencies (void)
568 {
569 return &_go_format_currencies_table[0];
570 }
571