gettext 3.4.0 → 3.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/doc/text/news.md +39 -0
  3. data/gettext.gemspec +3 -1
  4. data/lib/gettext/mo.rb +5 -14
  5. data/lib/gettext/text_domain_manager.rb +6 -5
  6. data/lib/gettext/tools/parser/erubi.rb +88 -0
  7. data/lib/gettext/tools/xgettext.rb +6 -0
  8. data/lib/gettext/version.rb +2 -2
  9. data/locale/ja/LC_MESSAGES/gettext.mo +0 -0
  10. data/po/bg/gettext.edit.po +13 -9
  11. data/po/bg/gettext.po +3 -0
  12. data/po/bs/gettext.edit.po +13 -9
  13. data/po/bs/gettext.po +3 -0
  14. data/po/ca/gettext.edit.po +13 -9
  15. data/po/ca/gettext.po +3 -0
  16. data/po/cs/gettext.edit.po +13 -9
  17. data/po/cs/gettext.po +3 -0
  18. data/po/de/gettext.edit.po +13 -9
  19. data/po/de/gettext.po +3 -0
  20. data/po/el/gettext.edit.po +13 -9
  21. data/po/el/gettext.po +3 -0
  22. data/po/eo/gettext.edit.po +13 -9
  23. data/po/eo/gettext.po +3 -0
  24. data/po/es/gettext.edit.po +13 -9
  25. data/po/es/gettext.po +3 -0
  26. data/po/et/gettext.edit.po +13 -9
  27. data/po/et/gettext.po +3 -0
  28. data/po/fr/gettext.edit.po +13 -9
  29. data/po/fr/gettext.po +3 -0
  30. data/po/gettext.pot +16 -12
  31. data/po/hr/gettext.edit.po +13 -9
  32. data/po/hr/gettext.po +3 -0
  33. data/po/hu/gettext.edit.po +13 -9
  34. data/po/hu/gettext.po +3 -0
  35. data/po/it/gettext.edit.po +13 -9
  36. data/po/it/gettext.po +3 -0
  37. data/po/ja/gettext.edit.po +14 -10
  38. data/po/ja/gettext.po +4 -1
  39. data/po/ko/gettext.edit.po +13 -9
  40. data/po/ko/gettext.po +3 -0
  41. data/po/lv/gettext.edit.po +13 -9
  42. data/po/lv/gettext.po +3 -0
  43. data/po/nb/gettext.edit.po +13 -9
  44. data/po/nb/gettext.po +3 -0
  45. data/po/nl/gettext.edit.po +13 -9
  46. data/po/nl/gettext.po +3 -0
  47. data/po/pt_BR/gettext.edit.po +13 -9
  48. data/po/pt_BR/gettext.po +3 -0
  49. data/po/ru/gettext.edit.po +13 -9
  50. data/po/ru/gettext.po +3 -0
  51. data/po/sr/gettext.edit.po +13 -9
  52. data/po/sr/gettext.po +3 -0
  53. data/po/sv/gettext.edit.po +13 -9
  54. data/po/sv/gettext.po +3 -0
  55. data/po/uk/gettext.edit.po +13 -9
  56. data/po/uk/gettext.po +3 -0
  57. data/po/vi/gettext.edit.po +13 -9
  58. data/po/vi/gettext.po +3 -0
  59. data/po/zh/gettext.edit.po +13 -9
  60. data/po/zh/gettext.po +3 -0
  61. data/po/zh_TW/gettext.edit.po +13 -9
  62. data/po/zh_TW/gettext.po +3 -0
  63. data/test/fixtures/erb/case.rhtml +16 -0
  64. data/test/fixtures/simple.rb +4 -0
  65. data/test/locale/fr/LC_MESSAGES/test1.mo +0 -0
  66. data/test/locale/fr_BE/LC_MESSAGES/test1.mo +0 -0
  67. data/test/locale/fr_BE_Foo/LC_MESSAGES/test1.mo +0 -0
  68. data/test/po/fr/test1.po +7 -0
  69. data/test/po/fr_BE/test1.po +24 -0
  70. data/test/po/fr_BE_Foo/test1.po +20 -0
  71. data/test/po/ja/_.po +15 -0
  72. data/test/test_gettext.rb +23 -0
  73. data/test/test_locale_path.rb +12 -4
  74. data/test/test_parser.rb +62 -0
  75. data/test/tools/test_xgettext.rb +85 -0
  76. metadata +39 -4
@@ -21,12 +21,12 @@ msgstr ""
21
21
  "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4"
22
22
  " && (n%100<10 || n%100>=20) ? 1 : 2;\n"
23
23
 
24
- #: ../lib/gettext/text_domain_manager.rb:148
24
+ #: ../lib/gettext/text_domain_manager.rb:149
25
25
  #, fuzzy
26
26
  msgid "ngettext: 3rd parmeter is wrong: value = %{number}"
27
27
  msgstr "3. параметар је погрешан: вредност = %{number}"
28
28
 
29
- #: ../lib/gettext/text_domain_manager.rb:154
29
+ #: ../lib/gettext/text_domain_manager.rb:155
30
30
  msgid "ngettext: 3rd parameter should be a number, not nil."
31
31
  msgstr ""
32
32
 
@@ -144,7 +144,7 @@ msgstr "Формирање бинарног каталога порука из
144
144
  msgid "write output to specified file"
145
145
  msgstr "писање излаза у задат фајл"
146
146
 
147
- #: ../lib/gettext/tools/msgfmt.rb:93 ../lib/gettext/tools/xgettext.rb:349
147
+ #: ../lib/gettext/tools/msgfmt.rb:93 ../lib/gettext/tools/xgettext.rb:355
148
148
  msgid "display version information and exit"
149
149
  msgstr "приказ информација о верзији и излаз"
150
150
 
@@ -303,31 +303,35 @@ msgid "require the library before executing xgettext"
303
303
  msgstr "захтевај библиотеку пре извршења rgettext-а"
304
304
 
305
305
  #: ../lib/gettext/tools/xgettext.rb:334
306
+ msgid "Add PARSER to parser list for xgettext"
307
+ msgstr ""
308
+
309
+ #: ../lib/gettext/tools/xgettext.rb:340
306
310
  msgid "If TAG is specified, place comment blocks starting with TAG and precedding keyword lines in output file"
307
311
  msgstr ""
308
312
 
309
- #: ../lib/gettext/tools/xgettext.rb:335
313
+ #: ../lib/gettext/tools/xgettext.rb:341
310
314
  msgid "If TAG is not specified, place all comment blocks preceing keyword lines in output file"
311
315
  msgstr ""
312
316
 
313
- #: ../lib/gettext/tools/xgettext.rb:336
317
+ #: ../lib/gettext/tools/xgettext.rb:342
314
318
  msgid "(default: %s)"
315
319
  msgstr ""
316
320
 
317
- #: ../lib/gettext/tools/xgettext.rb:336
321
+ #: ../lib/gettext/tools/xgettext.rb:342
318
322
  msgid "no TAG"
319
323
  msgstr ""
320
324
 
321
- #: ../lib/gettext/tools/xgettext.rb:340
325
+ #: ../lib/gettext/tools/xgettext.rb:346
322
326
  msgid "run in debugging mode"
323
327
  msgstr "ради у дибагинг моду"
324
328
 
325
- #: ../lib/gettext/tools/xgettext.rb:344
329
+ #: ../lib/gettext/tools/xgettext.rb:350
326
330
  #, fuzzy
327
331
  msgid "display this help and exit"
328
332
  msgstr "приказ информација о верзији и излаз"
329
333
 
330
- #: ../lib/gettext/tools/xgettext.rb:375
334
+ #: ../lib/gettext/tools/xgettext.rb:381
331
335
  msgid "Warning: The empty \"\" msgid is reserved by gettext. So gettext(\"\") doesn't returns empty string but the header entry in po file."
332
336
  msgstr ""
333
337
 
data/po/sr/gettext.po CHANGED
@@ -251,6 +251,9 @@ msgstr ""
251
251
  msgid "require the library before executing xgettext"
252
252
  msgstr "захтевај библиотеку пре извршења rgettext-а"
253
253
 
254
+ msgid "Add PARSER to parser list for xgettext"
255
+ msgstr ""
256
+
254
257
  msgid ""
255
258
  "If TAG is specified, place comment blocks starting with TAG and precedding key"
256
259
  "word lines in output file"
@@ -19,11 +19,11 @@ msgstr ""
19
19
  "Content-Type: text/plain; charset=UTF-8\n"
20
20
  "Content-Transfer-Encoding: 8bit\n"
21
21
 
22
- #: ../lib/gettext/text_domain_manager.rb:148
22
+ #: ../lib/gettext/text_domain_manager.rb:149
23
23
  msgid "ngettext: 3rd parmeter is wrong: value = %{number}"
24
24
  msgstr ""
25
25
 
26
- #: ../lib/gettext/text_domain_manager.rb:154
26
+ #: ../lib/gettext/text_domain_manager.rb:155
27
27
  msgid "ngettext: 3rd parameter should be a number, not nil."
28
28
  msgstr ""
29
29
 
@@ -139,7 +139,7 @@ msgstr "Generera binära meddelandekataloger från textuell översättningsdata.
139
139
  msgid "write output to specified file"
140
140
  msgstr ""
141
141
 
142
- #: ../lib/gettext/tools/msgfmt.rb:93 ../lib/gettext/tools/xgettext.rb:349
142
+ #: ../lib/gettext/tools/msgfmt.rb:93 ../lib/gettext/tools/xgettext.rb:355
143
143
  msgid "display version information and exit"
144
144
  msgstr ""
145
145
 
@@ -292,29 +292,33 @@ msgid "require the library before executing xgettext"
292
292
  msgstr ""
293
293
 
294
294
  #: ../lib/gettext/tools/xgettext.rb:334
295
+ msgid "Add PARSER to parser list for xgettext"
296
+ msgstr ""
297
+
298
+ #: ../lib/gettext/tools/xgettext.rb:340
295
299
  msgid "If TAG is specified, place comment blocks starting with TAG and precedding keyword lines in output file"
296
300
  msgstr ""
297
301
 
298
- #: ../lib/gettext/tools/xgettext.rb:335
302
+ #: ../lib/gettext/tools/xgettext.rb:341
299
303
  msgid "If TAG is not specified, place all comment blocks preceing keyword lines in output file"
300
304
  msgstr ""
301
305
 
302
- #: ../lib/gettext/tools/xgettext.rb:336
306
+ #: ../lib/gettext/tools/xgettext.rb:342
303
307
  msgid "(default: %s)"
304
308
  msgstr ""
305
309
 
306
- #: ../lib/gettext/tools/xgettext.rb:336
310
+ #: ../lib/gettext/tools/xgettext.rb:342
307
311
  msgid "no TAG"
308
312
  msgstr ""
309
313
 
310
- #: ../lib/gettext/tools/xgettext.rb:340
314
+ #: ../lib/gettext/tools/xgettext.rb:346
311
315
  msgid "run in debugging mode"
312
316
  msgstr ""
313
317
 
314
- #: ../lib/gettext/tools/xgettext.rb:344
318
+ #: ../lib/gettext/tools/xgettext.rb:350
315
319
  msgid "display this help and exit"
316
320
  msgstr ""
317
321
 
318
- #: ../lib/gettext/tools/xgettext.rb:375
322
+ #: ../lib/gettext/tools/xgettext.rb:381
319
323
  msgid "Warning: The empty \"\" msgid is reserved by gettext. So gettext(\"\") doesn't returns empty string but the header entry in po file."
320
324
  msgstr ""
data/po/sv/gettext.po CHANGED
@@ -237,6 +237,9 @@ msgstr ""
237
237
  msgid "require the library before executing xgettext"
238
238
  msgstr ""
239
239
 
240
+ msgid "Add PARSER to parser list for xgettext"
241
+ msgstr ""
242
+
240
243
  msgid ""
241
244
  "If TAG is specified, place comment blocks starting with TAG and precedding key"
242
245
  "word lines in output file"
@@ -24,12 +24,12 @@ msgstr ""
24
24
  "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
25
25
  "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
26
26
 
27
- #: ../lib/gettext/text_domain_manager.rb:148
27
+ #: ../lib/gettext/text_domain_manager.rb:149
28
28
  #, fuzzy
29
29
  msgid "ngettext: 3rd parmeter is wrong: value = %{number}"
30
30
  msgstr "Третій параметр неправильний: value = %{number}"
31
31
 
32
- #: ../lib/gettext/text_domain_manager.rb:154
32
+ #: ../lib/gettext/text_domain_manager.rb:155
33
33
  msgid "ngettext: 3rd parameter should be a number, not nil."
34
34
  msgstr ""
35
35
 
@@ -147,7 +147,7 @@ msgstr "Генерує бінарний каталог повідомлень і
147
147
  msgid "write output to specified file"
148
148
  msgstr "записати результат у вказаний файл"
149
149
 
150
- #: ../lib/gettext/tools/msgfmt.rb:93 ../lib/gettext/tools/xgettext.rb:349
150
+ #: ../lib/gettext/tools/msgfmt.rb:93 ../lib/gettext/tools/xgettext.rb:355
151
151
  msgid "display version information and exit"
152
152
  msgstr "показати інформацію про версію і завершити роботу"
153
153
 
@@ -306,31 +306,35 @@ msgid "require the library before executing xgettext"
306
306
  msgstr "для виконання rgettext необхідна бібліотека"
307
307
 
308
308
  #: ../lib/gettext/tools/xgettext.rb:334
309
+ msgid "Add PARSER to parser list for xgettext"
310
+ msgstr ""
311
+
312
+ #: ../lib/gettext/tools/xgettext.rb:340
309
313
  msgid "If TAG is specified, place comment blocks starting with TAG and precedding keyword lines in output file"
310
314
  msgstr ""
311
315
 
312
- #: ../lib/gettext/tools/xgettext.rb:335
316
+ #: ../lib/gettext/tools/xgettext.rb:341
313
317
  msgid "If TAG is not specified, place all comment blocks preceing keyword lines in output file"
314
318
  msgstr ""
315
319
 
316
- #: ../lib/gettext/tools/xgettext.rb:336
320
+ #: ../lib/gettext/tools/xgettext.rb:342
317
321
  msgid "(default: %s)"
318
322
  msgstr ""
319
323
 
320
- #: ../lib/gettext/tools/xgettext.rb:336
324
+ #: ../lib/gettext/tools/xgettext.rb:342
321
325
  msgid "no TAG"
322
326
  msgstr ""
323
327
 
324
- #: ../lib/gettext/tools/xgettext.rb:340
328
+ #: ../lib/gettext/tools/xgettext.rb:346
325
329
  msgid "run in debugging mode"
326
330
  msgstr "запуск в режимі відлагодження"
327
331
 
328
- #: ../lib/gettext/tools/xgettext.rb:344
332
+ #: ../lib/gettext/tools/xgettext.rb:350
329
333
  #, fuzzy
330
334
  msgid "display this help and exit"
331
335
  msgstr "показати інформацію про версію і завершити роботу"
332
336
 
333
- #: ../lib/gettext/tools/xgettext.rb:375
337
+ #: ../lib/gettext/tools/xgettext.rb:381
334
338
  msgid "Warning: The empty \"\" msgid is reserved by gettext. So gettext(\"\") doesn't returns empty string but the header entry in po file."
335
339
  msgstr ""
336
340
 
data/po/uk/gettext.po CHANGED
@@ -255,6 +255,9 @@ msgstr ""
255
255
  msgid "require the library before executing xgettext"
256
256
  msgstr "для виконання rgettext необхідна бібліотека"
257
257
 
258
+ msgid "Add PARSER to parser list for xgettext"
259
+ msgstr ""
260
+
258
261
  msgid ""
259
262
  "If TAG is specified, place comment blocks starting with TAG and precedding key"
260
263
  "word lines in output file"
@@ -20,12 +20,12 @@ msgstr ""
20
20
  "Content-Transfer-Encoding: 8bit\n"
21
21
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
22
22
 
23
- #: ../lib/gettext/text_domain_manager.rb:148
23
+ #: ../lib/gettext/text_domain_manager.rb:149
24
24
  #, fuzzy
25
25
  msgid "ngettext: 3rd parmeter is wrong: value = %{number}"
26
26
  msgstr "Tham số thứ 3 sai: giá trị = %{number}"
27
27
 
28
- #: ../lib/gettext/text_domain_manager.rb:154
28
+ #: ../lib/gettext/text_domain_manager.rb:155
29
29
  msgid "ngettext: 3rd parameter should be a number, not nil."
30
30
  msgstr ""
31
31
 
@@ -143,7 +143,7 @@ msgstr "Sinh message catalog nhị phân từ chuỗi văn bản."
143
143
  msgid "write output to specified file"
144
144
  msgstr "ghi ra tập tin được chỉ định"
145
145
 
146
- #: ../lib/gettext/tools/msgfmt.rb:93 ../lib/gettext/tools/xgettext.rb:349
146
+ #: ../lib/gettext/tools/msgfmt.rb:93 ../lib/gettext/tools/xgettext.rb:355
147
147
  msgid "display version information and exit"
148
148
  msgstr "hiện thông tin về phiên bản rồi thoát"
149
149
 
@@ -302,31 +302,35 @@ msgid "require the library before executing xgettext"
302
302
  msgstr "require thư viện trước khi chạy rgettext"
303
303
 
304
304
  #: ../lib/gettext/tools/xgettext.rb:334
305
+ msgid "Add PARSER to parser list for xgettext"
306
+ msgstr ""
307
+
308
+ #: ../lib/gettext/tools/xgettext.rb:340
305
309
  msgid "If TAG is specified, place comment blocks starting with TAG and precedding keyword lines in output file"
306
310
  msgstr ""
307
311
 
308
- #: ../lib/gettext/tools/xgettext.rb:335
312
+ #: ../lib/gettext/tools/xgettext.rb:341
309
313
  msgid "If TAG is not specified, place all comment blocks preceing keyword lines in output file"
310
314
  msgstr ""
311
315
 
312
- #: ../lib/gettext/tools/xgettext.rb:336
316
+ #: ../lib/gettext/tools/xgettext.rb:342
313
317
  msgid "(default: %s)"
314
318
  msgstr ""
315
319
 
316
- #: ../lib/gettext/tools/xgettext.rb:336
320
+ #: ../lib/gettext/tools/xgettext.rb:342
317
321
  msgid "no TAG"
318
322
  msgstr ""
319
323
 
320
- #: ../lib/gettext/tools/xgettext.rb:340
324
+ #: ../lib/gettext/tools/xgettext.rb:346
321
325
  msgid "run in debugging mode"
322
326
  msgstr "chạy trong chế độ debug"
323
327
 
324
- #: ../lib/gettext/tools/xgettext.rb:344
328
+ #: ../lib/gettext/tools/xgettext.rb:350
325
329
  #, fuzzy
326
330
  msgid "display this help and exit"
327
331
  msgstr "hiện thông tin về phiên bản rồi thoát"
328
332
 
329
- #: ../lib/gettext/tools/xgettext.rb:375
333
+ #: ../lib/gettext/tools/xgettext.rb:381
330
334
  msgid "Warning: The empty \"\" msgid is reserved by gettext. So gettext(\"\") doesn't returns empty string but the header entry in po file."
331
335
  msgstr ""
332
336
 
data/po/vi/gettext.po CHANGED
@@ -250,6 +250,9 @@ msgstr ""
250
250
  msgid "require the library before executing xgettext"
251
251
  msgstr "require thư viện trước khi chạy rgettext"
252
252
 
253
+ msgid "Add PARSER to parser list for xgettext"
254
+ msgstr ""
255
+
253
256
  msgid ""
254
257
  "If TAG is specified, place comment blocks starting with TAG and precedding key"
255
258
  "word lines in output file"
@@ -23,12 +23,12 @@ msgstr ""
23
23
  "Plural-Forms: nplurals=1; plural=0;\n"
24
24
  "X-Generator: KBabel 1.9.1\n"
25
25
 
26
- #: ../lib/gettext/text_domain_manager.rb:148
26
+ #: ../lib/gettext/text_domain_manager.rb:149
27
27
  #, fuzzy
28
28
  msgid "ngettext: 3rd parmeter is wrong: value = %{number}"
29
29
  msgstr "第三个参数错误:value = %{number}"
30
30
 
31
- #: ../lib/gettext/text_domain_manager.rb:154
31
+ #: ../lib/gettext/text_domain_manager.rb:155
32
32
  msgid "ngettext: 3rd parameter should be a number, not nil."
33
33
  msgstr ""
34
34
 
@@ -146,7 +146,7 @@ msgstr "从文本叙述翻译生成二进制信息目录。"
146
146
  msgid "write output to specified file"
147
147
  msgstr "输出到指定文件"
148
148
 
149
- #: ../lib/gettext/tools/msgfmt.rb:93 ../lib/gettext/tools/xgettext.rb:349
149
+ #: ../lib/gettext/tools/msgfmt.rb:93 ../lib/gettext/tools/xgettext.rb:355
150
150
  msgid "display version information and exit"
151
151
  msgstr "显示版本信息并退出"
152
152
 
@@ -305,31 +305,35 @@ msgid "require the library before executing xgettext"
305
305
  msgstr "在执行 rgettext 之前需要一个库"
306
306
 
307
307
  #: ../lib/gettext/tools/xgettext.rb:334
308
+ msgid "Add PARSER to parser list for xgettext"
309
+ msgstr ""
310
+
311
+ #: ../lib/gettext/tools/xgettext.rb:340
308
312
  msgid "If TAG is specified, place comment blocks starting with TAG and precedding keyword lines in output file"
309
313
  msgstr ""
310
314
 
311
- #: ../lib/gettext/tools/xgettext.rb:335
315
+ #: ../lib/gettext/tools/xgettext.rb:341
312
316
  msgid "If TAG is not specified, place all comment blocks preceing keyword lines in output file"
313
317
  msgstr ""
314
318
 
315
- #: ../lib/gettext/tools/xgettext.rb:336
319
+ #: ../lib/gettext/tools/xgettext.rb:342
316
320
  msgid "(default: %s)"
317
321
  msgstr ""
318
322
 
319
- #: ../lib/gettext/tools/xgettext.rb:336
323
+ #: ../lib/gettext/tools/xgettext.rb:342
320
324
  msgid "no TAG"
321
325
  msgstr ""
322
326
 
323
- #: ../lib/gettext/tools/xgettext.rb:340
327
+ #: ../lib/gettext/tools/xgettext.rb:346
324
328
  msgid "run in debugging mode"
325
329
  msgstr "运行于调试模式"
326
330
 
327
- #: ../lib/gettext/tools/xgettext.rb:344
331
+ #: ../lib/gettext/tools/xgettext.rb:350
328
332
  #, fuzzy
329
333
  msgid "display this help and exit"
330
334
  msgstr "显示版本信息并退出"
331
335
 
332
- #: ../lib/gettext/tools/xgettext.rb:375
336
+ #: ../lib/gettext/tools/xgettext.rb:381
333
337
  msgid "Warning: The empty \"\" msgid is reserved by gettext. So gettext(\"\") doesn't returns empty string but the header entry in po file."
334
338
  msgstr ""
335
339
 
data/po/zh/gettext.po CHANGED
@@ -252,6 +252,9 @@ msgstr ""
252
252
  msgid "require the library before executing xgettext"
253
253
  msgstr "在执行 rgettext 之前需要一个库"
254
254
 
255
+ msgid "Add PARSER to parser list for xgettext"
256
+ msgstr ""
257
+
255
258
  msgid ""
256
259
  "If TAG is specified, place comment blocks starting with TAG and precedding key"
257
260
  "word lines in output file"
@@ -22,12 +22,12 @@ msgstr ""
22
22
  "X-Poedit-Language: Chinese\n"
23
23
  "X-Poedit-Country: TAIWAN\n"
24
24
 
25
- #: ../lib/gettext/text_domain_manager.rb:148
25
+ #: ../lib/gettext/text_domain_manager.rb:149
26
26
  #, fuzzy
27
27
  msgid "ngettext: 3rd parmeter is wrong: value = %{number}"
28
28
  msgstr "第三个参数錯誤:value = %{number}"
29
29
 
30
- #: ../lib/gettext/text_domain_manager.rb:154
30
+ #: ../lib/gettext/text_domain_manager.rb:155
31
31
  msgid "ngettext: 3rd parameter should be a number, not nil."
32
32
  msgstr ""
33
33
 
@@ -145,7 +145,7 @@ msgstr "從textual translation description產生二進位訊息 catalog"
145
145
  msgid "write output to specified file"
146
146
  msgstr "輸出到指定檔案"
147
147
 
148
- #: ../lib/gettext/tools/msgfmt.rb:93 ../lib/gettext/tools/xgettext.rb:349
148
+ #: ../lib/gettext/tools/msgfmt.rb:93 ../lib/gettext/tools/xgettext.rb:355
149
149
  msgid "display version information and exit"
150
150
  msgstr "秀出版本資訊後退出"
151
151
 
@@ -304,31 +304,35 @@ msgid "require the library before executing xgettext"
304
304
  msgstr "在執行 rgettext 之前需要一個庫"
305
305
 
306
306
  #: ../lib/gettext/tools/xgettext.rb:334
307
+ msgid "Add PARSER to parser list for xgettext"
308
+ msgstr ""
309
+
310
+ #: ../lib/gettext/tools/xgettext.rb:340
307
311
  msgid "If TAG is specified, place comment blocks starting with TAG and precedding keyword lines in output file"
308
312
  msgstr ""
309
313
 
310
- #: ../lib/gettext/tools/xgettext.rb:335
314
+ #: ../lib/gettext/tools/xgettext.rb:341
311
315
  msgid "If TAG is not specified, place all comment blocks preceing keyword lines in output file"
312
316
  msgstr ""
313
317
 
314
- #: ../lib/gettext/tools/xgettext.rb:336
318
+ #: ../lib/gettext/tools/xgettext.rb:342
315
319
  msgid "(default: %s)"
316
320
  msgstr ""
317
321
 
318
- #: ../lib/gettext/tools/xgettext.rb:336
322
+ #: ../lib/gettext/tools/xgettext.rb:342
319
323
  msgid "no TAG"
320
324
  msgstr ""
321
325
 
322
- #: ../lib/gettext/tools/xgettext.rb:340
326
+ #: ../lib/gettext/tools/xgettext.rb:346
323
327
  msgid "run in debugging mode"
324
328
  msgstr "執行除錯模式"
325
329
 
326
- #: ../lib/gettext/tools/xgettext.rb:344
330
+ #: ../lib/gettext/tools/xgettext.rb:350
327
331
  #, fuzzy
328
332
  msgid "display this help and exit"
329
333
  msgstr "秀出版本資訊後退出"
330
334
 
331
- #: ../lib/gettext/tools/xgettext.rb:375
335
+ #: ../lib/gettext/tools/xgettext.rb:381
332
336
  msgid "Warning: The empty \"\" msgid is reserved by gettext. So gettext(\"\") doesn't returns empty string but the header entry in po file."
333
337
  msgstr ""
334
338
 
data/po/zh_TW/gettext.po CHANGED
@@ -251,6 +251,9 @@ msgstr ""
251
251
  msgid "require the library before executing xgettext"
252
252
  msgstr "在執行 rgettext 之前需要一個庫"
253
253
 
254
+ msgid "Add PARSER to parser list for xgettext"
255
+ msgstr ""
256
+
254
257
  msgid ""
255
258
  "If TAG is specified, place comment blocks starting with TAG and precedding key"
256
259
  "word lines in output file"
@@ -0,0 +1,16 @@
1
+ <%
2
+ require 'gettext'
3
+ include GetText
4
+ bindtextdomain("helloerb", :path => "locale")
5
+ %>
6
+ <html>
7
+ <head>
8
+ <title></title>
9
+ </head>
10
+ <body>
11
+ <%= _('Hello') %>
12
+ <% case 1 %>
13
+ <% end %>
14
+ <%= _('World') %>
15
+ </body>
16
+ </html>
@@ -13,4 +13,8 @@ class Simple
13
13
  def test_formatted_string
14
14
  _("one is %d.") % 1
15
15
  end
16
+
17
+ def test_plural
18
+ n_("There is an apple.", "There are %{num} apples.", 5) % {:num => 5}
19
+ end
16
20
  end
Binary file
data/test/po/fr/test1.po CHANGED
@@ -13,6 +13,7 @@ msgstr ""
13
13
  "MIME-Version: 1.0\n"
14
14
  "Content-Type: text/plain; charset=utf-8\n"
15
15
  "Content-Transfer-Encoding: ENCODING\n"
16
+ "Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n"
16
17
 
17
18
  #: simple.rb:10
18
19
  msgid "language"
@@ -21,3 +22,9 @@ msgstr "french"
21
22
  #: simple.rb:14
22
23
  msgid "one is %d."
23
24
  msgstr "FRENCH:ONE IS %d."
25
+
26
+ #: simple.rb:18
27
+ msgid "There is an apple."
28
+ msgid_plural "There are %{num} apples."
29
+ msgstr[0] "FRENCH:Il y a une pomme."
30
+ msgstr[1] "FRENCH:Il y a %{num} pommes."
@@ -0,0 +1,24 @@
1
+ # SOME DESCRIPTIVE TITLE.
2
+ # Copyright (C) YEAR ORGANIZATION
3
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4
+ #
5
+ #, fuzzy
6
+ msgid ""
7
+ msgstr ""
8
+ "Project-Id-Version: PACKAGE VERSION\n"
9
+ "POT-Creation-Date: 2002-01-01 02:24:56+0900\n"
10
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
11
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12
+ "Language-Team: LANGUAGE <LL@li.org>\n"
13
+ "MIME-Version: 1.0\n"
14
+ "Content-Type: text/plain; charset=utf-8\n"
15
+ "Content-Transfer-Encoding: ENCODING\n"
16
+ "Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n"
17
+
18
+ #: simple.rb:10
19
+ msgid "language"
20
+ msgstr "french-Belgium"
21
+
22
+ #: simple.rb:14
23
+ msgid "one is %d."
24
+ msgstr "FRENCH-BELGIUM:ONE IS %d."
@@ -0,0 +1,20 @@
1
+ # SOME DESCRIPTIVE TITLE.
2
+ # Copyright (C) YEAR ORGANIZATION
3
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4
+ #
5
+ #, fuzzy
6
+ msgid ""
7
+ msgstr ""
8
+ "Project-Id-Version: PACKAGE VERSION\n"
9
+ "POT-Creation-Date: 2002-01-01 02:24:56+0900\n"
10
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
11
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12
+ "Language-Team: LANGUAGE <LL@li.org>\n"
13
+ "MIME-Version: 1.0\n"
14
+ "Content-Type: text/plain; charset=utf-8\n"
15
+ "Content-Transfer-Encoding: ENCODING\n"
16
+ "Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n"
17
+
18
+ #: simple.rb:10
19
+ msgid "language"
20
+ msgstr "french-Belgium-Foo"
data/test/po/ja/_.po CHANGED
@@ -133,3 +133,18 @@ msgstr "ONE LINE"
133
133
  msgid ""
134
134
  "one new line\n"
135
135
  msgstr ""
136
+
137
+ msgid "in_symbol_array"
138
+ msgstr ""
139
+
140
+ msgid "hello world"
141
+ msgstr ""
142
+
143
+ msgid "in_string_array"
144
+ msgstr ""
145
+
146
+ msgid "Hello"
147
+ msgstr ""
148
+
149
+ msgid "World"
150
+ msgstr ""
data/test/test_gettext.rb CHANGED
@@ -59,6 +59,29 @@ class TestGetText < Test::Unit::TestCase
59
59
  assert_equal("nomsgstr", _("nomsgstr"))
60
60
  end
61
61
 
62
+ def test_fallbacks
63
+ bindtextdomain("test1", "locale")
64
+ test = Simple.new
65
+
66
+ # Translation present in all candidates
67
+ GetText.set_current_locale("fr_BE_Foo")
68
+ assert_equal("french-Belgium-Foo", test.test)
69
+ GetText.set_current_locale("fr_BE")
70
+ assert_equal("french-Belgium", test.test)
71
+ GetText.set_current_locale("fr")
72
+ assert_equal("french", test.test)
73
+
74
+ # Translation Missing in fr_BE_Foo (fallback to fr_BE)
75
+ GetText.set_current_locale("fr_BE_Foo")
76
+ assert_equal("FRENCH-BELGIUM:ONE IS 1.", test.test_formatted_string)
77
+
78
+ # Translation Missing in fr_BE_Foo *and* fr_BE (both languages fallback to fr)
79
+ GetText.set_current_locale("fr_BE_Foo")
80
+ assert_equal("FRENCH:Il y a 5 pommes.", test.test_plural)
81
+ GetText.set_current_locale("fr_BE")
82
+ assert_equal("FRENCH:Il y a 5 pommes.", test.test_plural)
83
+ end
84
+
62
85
  def test_empty
63
86
  bindtextdomain("test1", "locale")
64
87
  assert_equal("japanese", gettext("language"))
@@ -53,9 +53,11 @@ class TestLocalePath < Test::Unit::TestCase
53
53
  testdir = File.dirname(File.expand_path(__FILE__))
54
54
  path = GetText::LocalePath.new("test1", "#{testdir}/locale")
55
55
  assert_equal({
56
- "ja" => "#{testdir}/locale/ja/LC_MESSAGES/test1.mo",
57
- "fr" => "#{testdir}/locale/fr/LC_MESSAGES/test1.mo",
58
- "zh_Hant" => "#{testdir}/locale/zh_Hant/LC_MESSAGES/test1.mo"
56
+ "ja" => "#{testdir}/locale/ja/LC_MESSAGES/test1.mo",
57
+ "fr" => "#{testdir}/locale/fr/LC_MESSAGES/test1.mo",
58
+ "fr_BE" => "#{testdir}/locale/fr_BE/LC_MESSAGES/test1.mo",
59
+ "fr_BE_Foo" => "#{testdir}/locale/fr_BE_Foo/LC_MESSAGES/test1.mo",
60
+ "zh_Hant" => "#{testdir}/locale/zh_Hant/LC_MESSAGES/test1.mo"
59
61
  },
60
62
  path.locale_paths)
61
63
  assert_equal("#{testdir}/locale/ja/LC_MESSAGES/test1.mo",
@@ -66,6 +68,12 @@ class TestLocalePath < Test::Unit::TestCase
66
68
  path.current_path(Locale::Tag.parse("ja_JP.UTF-8")))
67
69
  assert_equal(nil,
68
70
  path.current_path(Locale::Tag.parse("en")))
71
+ assert_equal("#{testdir}/locale/fr/LC_MESSAGES/test1.mo",
72
+ path.current_path(Locale::Tag.parse("fr")))
73
+ assert_equal("#{testdir}/locale/fr_BE/LC_MESSAGES/test1.mo",
74
+ path.current_path(Locale::Tag.parse("fr-BE")))
75
+ assert_equal("#{testdir}/locale/fr_BE_Foo/LC_MESSAGES/test1.mo",
76
+ path.current_path(Locale::Tag.parse("fr-BE-Foo")))
69
77
  assert_equal("#{testdir}/locale/zh_Hant/LC_MESSAGES/test1.mo",
70
78
  path.current_path(Locale::Tag.parse("zh-Hant")))
71
79
  end
@@ -73,7 +81,7 @@ class TestLocalePath < Test::Unit::TestCase
73
81
  def test_supported_locales
74
82
  testdir = File.dirname(File.expand_path(__FILE__))
75
83
  path = GetText::LocalePath.new("test1", "#{testdir}/locale")
76
- assert_equal ["fr", "ja", "zh_Hant"], path.supported_locales
84
+ assert_equal ["fr", "fr_BE", "fr_BE_Foo", "ja", "zh_Hant"], path.supported_locales
77
85
 
78
86
  path = GetText::LocalePath.new("plural", "#{testdir}/locale")
79
87
  assert_equal ["cr", "da", "fr", "ir", "ja", "la", "li", "po", "sl"], path.supported_locales