gettext 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/doc/text/news.md +12 -0
- data/lib/gettext/locale_path.rb +1 -1
- data/lib/gettext/text_domain.rb +2 -3
- data/lib/gettext/version.rb +2 -2
- data/po/bg/gettext.edit.po +35 -35
- data/po/bg/gettext.po +9 -9
- data/po/bs/gettext.edit.po +35 -35
- data/po/bs/gettext.po +9 -9
- data/po/ca/gettext.edit.po +35 -35
- data/po/ca/gettext.po +9 -9
- data/po/cs/gettext.edit.po +35 -35
- data/po/cs/gettext.po +9 -9
- data/po/de/gettext.edit.po +35 -35
- data/po/de/gettext.po +9 -9
- data/po/el/gettext.edit.po +35 -35
- data/po/el/gettext.po +9 -9
- data/po/eo/gettext.edit.po +35 -35
- data/po/eo/gettext.po +9 -9
- data/po/es/gettext.edit.po +35 -35
- data/po/es/gettext.po +9 -9
- data/po/et/gettext.edit.po +35 -35
- data/po/et/gettext.po +9 -9
- data/po/fr/gettext.edit.po +35 -35
- data/po/fr/gettext.po +9 -9
- data/po/gettext.pot +69 -65
- data/po/hr/gettext.edit.po +35 -35
- data/po/hr/gettext.po +9 -9
- data/po/hu/gettext.edit.po +35 -35
- data/po/hu/gettext.po +9 -9
- data/po/it/gettext.edit.po +35 -35
- data/po/it/gettext.po +9 -9
- data/po/ja/gettext.edit.po +35 -35
- data/po/ja/gettext.po +9 -9
- data/po/ko/gettext.edit.po +35 -35
- data/po/ko/gettext.po +9 -9
- data/po/lv/gettext.edit.po +35 -35
- data/po/lv/gettext.po +9 -9
- data/po/nb/gettext.edit.po +35 -35
- data/po/nb/gettext.po +9 -9
- data/po/nl/gettext.edit.po +35 -35
- data/po/nl/gettext.po +9 -9
- data/po/pt_BR/gettext.edit.po +35 -35
- data/po/pt_BR/gettext.po +9 -9
- data/po/ru/gettext.edit.po +35 -35
- data/po/ru/gettext.po +9 -9
- data/po/sr/gettext.edit.po +35 -35
- data/po/sr/gettext.po +9 -9
- data/po/sv/gettext.edit.po +35 -35
- data/po/sv/gettext.po +9 -9
- data/po/uk/gettext.edit.po +35 -35
- data/po/uk/gettext.po +9 -9
- data/po/vi/gettext.edit.po +35 -35
- data/po/vi/gettext.po +9 -9
- data/po/zh/gettext.edit.po +35 -35
- data/po/zh/gettext.po +9 -9
- data/po/zh_TW/gettext.edit.po +35 -35
- data/po/zh_TW/gettext.po +9 -9
- data/test/fixtures/{n_.rb → lower_n_.rb} +0 -0
- data/test/fixtures/{N_.rb → upper_n_.rb} +0 -0
- data/test/locale/ja/LC_MESSAGES/hello.mo +0 -0
- data/test/locale/zh_Hant/LC_MESSAGES/test1.mo +0 -0
- data/test/po/hello.pot +23 -0
- data/test/po/ja/_.edit.po +2 -2
- data/test/po/ja/_.po +2 -2
- data/test/po/ja/hello.edit.po +22 -0
- data/test/po/ja/hello.po.time_stamp +0 -0
- data/test/po/zh_Hant/test1.po +23 -0
- data/test/test_locale_path.rb +17 -7
- data/test/test_parser.rb +69 -31
- metadata +11 -5
data/po/zh_TW/gettext.edit.po
CHANGED
|
@@ -394,71 +394,71 @@ msgstr[1] ""
|
|
|
394
394
|
msgid "hello, tk world"
|
|
395
395
|
msgstr ""
|
|
396
396
|
|
|
397
|
-
#: ../test/fixtures/
|
|
397
|
+
#: ../test/fixtures/_.rb:30 ../test/fixtures/lower_n_.rb:29 ../test/fixtures/upper_n_.rb:10 ../test/test_gettext.rb:155 ../test/test_gettext.rb:159
|
|
398
398
|
msgid "aaa"
|
|
399
399
|
msgid_plural "aaa2"
|
|
400
400
|
msgstr[0] ""
|
|
401
401
|
msgstr[1] ""
|
|
402
402
|
|
|
403
|
-
#: ../test/fixtures/
|
|
403
|
+
#: ../test/fixtures/_.rb:34 ../test/fixtures/upper_n_.rb:14
|
|
404
404
|
msgid ""
|
|
405
405
|
"aaa\n"
|
|
406
406
|
msgstr ""
|
|
407
407
|
|
|
408
|
-
#: ../test/fixtures/
|
|
408
|
+
#: ../test/fixtures/_.rb:38 ../test/fixtures/upper_n_.rb:18
|
|
409
409
|
msgid ""
|
|
410
410
|
"bbb\n"
|
|
411
411
|
"ccc"
|
|
412
412
|
msgstr ""
|
|
413
413
|
|
|
414
|
-
#: ../test/fixtures/
|
|
414
|
+
#: ../test/fixtures/_.rb:42 ../test/fixtures/upper_n_.rb:22
|
|
415
415
|
msgid ""
|
|
416
416
|
"bbb\n"
|
|
417
417
|
"ccc\n"
|
|
418
418
|
"ddd\n"
|
|
419
419
|
msgstr ""
|
|
420
420
|
|
|
421
|
-
#: ../test/fixtures/
|
|
421
|
+
#: ../test/fixtures/_.rb:49 ../test/fixtures/_.rb:53 ../test/fixtures/upper_n_.rb:29 ../test/fixtures/upper_n_.rb:33
|
|
422
422
|
msgid "eee"
|
|
423
423
|
msgstr ""
|
|
424
424
|
|
|
425
|
-
#: ../test/fixtures/
|
|
425
|
+
#: ../test/fixtures/_.rb:53 ../test/fixtures/lower_n_.rb:55 ../test/fixtures/lower_n_.rb:59 ../test/fixtures/upper_n_.rb:33
|
|
426
426
|
msgid "fff"
|
|
427
427
|
msgid_plural "fff2"
|
|
428
428
|
msgstr[0] ""
|
|
429
429
|
msgstr[1] ""
|
|
430
430
|
|
|
431
|
-
#: ../test/fixtures/
|
|
431
|
+
#: ../test/fixtures/_.rb:57 ../test/fixtures/lower_n_.rb:63 ../test/fixtures/upper_n_.rb:37
|
|
432
432
|
msgid "ggghhhiii"
|
|
433
433
|
msgid_plural "jjjkkklll"
|
|
434
434
|
msgstr[0] ""
|
|
435
435
|
msgstr[1] ""
|
|
436
436
|
|
|
437
|
-
#: ../test/fixtures/
|
|
437
|
+
#: ../test/fixtures/_.rb:63 ../test/fixtures/lower_n_.rb:72 ../test/fixtures/upper_n_.rb:43
|
|
438
438
|
msgid "a\"b\"c\""
|
|
439
439
|
msgid_plural "a\"b\"c\"2"
|
|
440
440
|
msgstr[0] ""
|
|
441
441
|
msgstr[1] ""
|
|
442
442
|
|
|
443
|
-
#: ../test/fixtures/
|
|
443
|
+
#: ../test/fixtures/_.rb:67 ../test/fixtures/lower_n_.rb:76 ../test/fixtures/upper_n_.rb:47
|
|
444
444
|
msgid "d\"e\"f\""
|
|
445
445
|
msgid_plural "d\"e\"f\"2"
|
|
446
446
|
msgstr[0] ""
|
|
447
447
|
msgstr[1] ""
|
|
448
448
|
|
|
449
|
-
#: ../test/fixtures/
|
|
449
|
+
#: ../test/fixtures/_.rb:71 ../test/fixtures/upper_n_.rb:51
|
|
450
450
|
msgid "jjj"
|
|
451
451
|
msgstr ""
|
|
452
452
|
|
|
453
|
-
#: ../test/fixtures/
|
|
453
|
+
#: ../test/fixtures/_.rb:72 ../test/fixtures/upper_n_.rb:52
|
|
454
454
|
msgid "kkk"
|
|
455
455
|
msgstr ""
|
|
456
456
|
|
|
457
|
-
#: ../test/fixtures/
|
|
457
|
+
#: ../test/fixtures/_.rb:76 ../test/fixtures/upper_n_.rb:56
|
|
458
458
|
msgid "lllmmm"
|
|
459
459
|
msgstr ""
|
|
460
460
|
|
|
461
|
-
#: ../test/fixtures/
|
|
461
|
+
#: ../test/fixtures/_.rb:84 ../test/fixtures/upper_n_.rb:64
|
|
462
462
|
msgid ""
|
|
463
463
|
"nnn\n"
|
|
464
464
|
"ooo"
|
|
@@ -583,19 +583,7 @@ msgstr ""
|
|
|
583
583
|
msgid "Hello"
|
|
584
584
|
msgstr ""
|
|
585
585
|
|
|
586
|
-
#: ../test/fixtures/
|
|
587
|
-
msgid "language"
|
|
588
|
-
msgstr ""
|
|
589
|
-
|
|
590
|
-
#: ../test/fixtures/multi_text_domain.rb:14 ../test/fixtures/multi_text_domain.rb:27 ../test/fixtures/multi_text_domain.rb:54 ../test/fixtures/multi_text_domain.rb:65 ../test/fixtures/multi_text_domain.rb:78 ../test/fixtures/multi_text_domain.rb:116 ../test/test_gettext.rb:53
|
|
591
|
-
msgid "LANGUAGE"
|
|
592
|
-
msgstr ""
|
|
593
|
-
|
|
594
|
-
#: ../test/fixtures/multi_text_domain.rb:120
|
|
595
|
-
msgid "no data"
|
|
596
|
-
msgstr ""
|
|
597
|
-
|
|
598
|
-
#: ../test/fixtures/n_.rb:33
|
|
586
|
+
#: ../test/fixtures/lower_n_.rb:33
|
|
599
587
|
msgid ""
|
|
600
588
|
"bbb\n"
|
|
601
589
|
msgid_plural ""
|
|
@@ -604,7 +592,7 @@ msgid_plural ""
|
|
|
604
592
|
msgstr[0] ""
|
|
605
593
|
msgstr[1] ""
|
|
606
594
|
|
|
607
|
-
#: ../test/fixtures/
|
|
595
|
+
#: ../test/fixtures/lower_n_.rb:37
|
|
608
596
|
msgid ""
|
|
609
597
|
"ddd\n"
|
|
610
598
|
"ddd"
|
|
@@ -614,7 +602,7 @@ msgid_plural ""
|
|
|
614
602
|
msgstr[0] ""
|
|
615
603
|
msgstr[1] ""
|
|
616
604
|
|
|
617
|
-
#: ../test/fixtures/
|
|
605
|
+
#: ../test/fixtures/lower_n_.rb:42
|
|
618
606
|
msgid ""
|
|
619
607
|
"eee\n"
|
|
620
608
|
"eee\n"
|
|
@@ -624,7 +612,7 @@ msgid_plural ""
|
|
|
624
612
|
msgstr[0] ""
|
|
625
613
|
msgstr[1] ""
|
|
626
614
|
|
|
627
|
-
#: ../test/fixtures/
|
|
615
|
+
#: ../test/fixtures/lower_n_.rb:48
|
|
628
616
|
msgid ""
|
|
629
617
|
"ddd\n"
|
|
630
618
|
"eee\n"
|
|
@@ -634,31 +622,31 @@ msgid_plural ""
|
|
|
634
622
|
msgstr[0] ""
|
|
635
623
|
msgstr[1] ""
|
|
636
624
|
|
|
637
|
-
#: ../test/fixtures/
|
|
625
|
+
#: ../test/fixtures/lower_n_.rb:59
|
|
638
626
|
msgid "ggg"
|
|
639
627
|
msgid_plural "ggg2"
|
|
640
628
|
msgstr[0] ""
|
|
641
629
|
msgstr[1] ""
|
|
642
630
|
|
|
643
|
-
#: ../test/fixtures/
|
|
631
|
+
#: ../test/fixtures/lower_n_.rb:80
|
|
644
632
|
msgid "mmmmmm"
|
|
645
633
|
msgid_plural "mmm2mmm2"
|
|
646
634
|
msgstr[0] ""
|
|
647
635
|
msgstr[1] ""
|
|
648
636
|
|
|
649
|
-
#: ../test/fixtures/
|
|
637
|
+
#: ../test/fixtures/lower_n_.rb:81
|
|
650
638
|
msgid "nnn"
|
|
651
639
|
msgid_plural "nnn2"
|
|
652
640
|
msgstr[0] ""
|
|
653
641
|
msgstr[1] ""
|
|
654
642
|
|
|
655
|
-
#: ../test/fixtures/
|
|
643
|
+
#: ../test/fixtures/lower_n_.rb:85 ../test/fixtures/lower_n_.rb:86
|
|
656
644
|
msgid "ooo"
|
|
657
645
|
msgid_plural "ppp"
|
|
658
646
|
msgstr[0] ""
|
|
659
647
|
msgstr[1] ""
|
|
660
648
|
|
|
661
|
-
#: ../test/fixtures/
|
|
649
|
+
#: ../test/fixtures/lower_n_.rb:90 ../test/fixtures/lower_n_.rb:91
|
|
662
650
|
msgid "qqq"
|
|
663
651
|
msgid_plural "rrr"
|
|
664
652
|
msgstr[0] ""
|
|
@@ -666,12 +654,24 @@ msgstr[1] ""
|
|
|
666
654
|
|
|
667
655
|
#. TRANSLATORS:please provide translations for all
|
|
668
656
|
#. the plural forms!
|
|
669
|
-
#: ../test/fixtures/
|
|
657
|
+
#: ../test/fixtures/lower_n_.rb:97
|
|
670
658
|
msgid "comment"
|
|
671
659
|
msgid_plural "comments"
|
|
672
660
|
msgstr[0] ""
|
|
673
661
|
msgstr[1] ""
|
|
674
662
|
|
|
663
|
+
#: ../test/fixtures/multi_text_domain.rb:11 ../test/fixtures/multi_text_domain.rb:24 ../test/fixtures/multi_text_domain.rb:43 ../test/fixtures/multi_text_domain.rb:50 ../test/fixtures/multi_text_domain.rb:62 ../test/fixtures/multi_text_domain.rb:75 ../test/fixtures/multi_text_domain.rb:91 ../test/fixtures/multi_text_domain.rb:104 ../test/fixtures/multi_text_domain.rb:108 ../test/fixtures/multi_text_domain.rb:128 ../test/fixtures/simple.rb:10 ../test/test_gettext.rb:64 ../test/test_gettext.rb:297 ../test/test_gettext.rb:299 ../test/test_gettext.rb:302 ../test/test_gettext.rb:306 ../test/test_gettext.rb:309 ../test/test_gettext.rb:322 ../test/test_gettext.rb:325 ../test/test_gettext.rb:328 ../test/test_gettext.rb:336 ../test/test_gettext.rb:339 ../test/test_gettext.rb:351 ../test/test_gettext.rb:358 ../test/test_text_domain_toplevel.rb:9 ../test/test_text_domain_toplevel.rb:15 ../test/test_text_domain_toplevel.rb:18 ../test/test_text_domain_toplevel.rb:23 ../test/test_thread.rb:23
|
|
664
|
+
msgid "language"
|
|
665
|
+
msgstr ""
|
|
666
|
+
|
|
667
|
+
#: ../test/fixtures/multi_text_domain.rb:14 ../test/fixtures/multi_text_domain.rb:27 ../test/fixtures/multi_text_domain.rb:54 ../test/fixtures/multi_text_domain.rb:65 ../test/fixtures/multi_text_domain.rb:78 ../test/fixtures/multi_text_domain.rb:116 ../test/test_gettext.rb:53
|
|
668
|
+
msgid "LANGUAGE"
|
|
669
|
+
msgstr ""
|
|
670
|
+
|
|
671
|
+
#: ../test/fixtures/multi_text_domain.rb:120
|
|
672
|
+
msgid "no data"
|
|
673
|
+
msgstr ""
|
|
674
|
+
|
|
675
675
|
#: ../test/fixtures/non_ascii.rb:10
|
|
676
676
|
msgid "こんにちは"
|
|
677
677
|
msgstr ""
|
data/po/zh_TW/gettext.po
CHANGED
|
@@ -481,15 +481,6 @@ msgstr ""
|
|
|
481
481
|
msgid "Hello"
|
|
482
482
|
msgstr ""
|
|
483
483
|
|
|
484
|
-
msgid "language"
|
|
485
|
-
msgstr ""
|
|
486
|
-
|
|
487
|
-
msgid "LANGUAGE"
|
|
488
|
-
msgstr ""
|
|
489
|
-
|
|
490
|
-
msgid "no data"
|
|
491
|
-
msgstr ""
|
|
492
|
-
|
|
493
484
|
msgid ""
|
|
494
485
|
"bbb\n"
|
|
495
486
|
msgid_plural ""
|
|
@@ -557,6 +548,15 @@ msgid_plural "comments"
|
|
|
557
548
|
msgstr[0] ""
|
|
558
549
|
msgstr[1] ""
|
|
559
550
|
|
|
551
|
+
msgid "language"
|
|
552
|
+
msgstr ""
|
|
553
|
+
|
|
554
|
+
msgid "LANGUAGE"
|
|
555
|
+
msgstr ""
|
|
556
|
+
|
|
557
|
+
msgid "no data"
|
|
558
|
+
msgstr ""
|
|
559
|
+
|
|
560
560
|
msgid "こんにちは"
|
|
561
561
|
msgstr ""
|
|
562
562
|
|
|
File without changes
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
data/test/po/hello.pot
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# SOME DESCRIPTIVE TITLE.
|
|
2
|
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
|
3
|
+
# This file is distributed under the same license as the hello package.
|
|
4
|
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
5
|
+
#
|
|
6
|
+
#, fuzzy
|
|
7
|
+
msgid ""
|
|
8
|
+
msgstr ""
|
|
9
|
+
"Project-Id-Version: hello 3.2.2\n"
|
|
10
|
+
"Report-Msgid-Bugs-To: \n"
|
|
11
|
+
"POT-Creation-Date: 2016-04-18 00:02+0900\n"
|
|
12
|
+
"PO-Revision-Date: 2016-04-18 00:02+0900\n"
|
|
13
|
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
|
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
15
|
+
"Language: \n"
|
|
16
|
+
"MIME-Version: 1.0\n"
|
|
17
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
|
18
|
+
"Content-Transfer-Encoding: 8bit\n"
|
|
19
|
+
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
|
20
|
+
|
|
21
|
+
#: ../fixtures/hello.rb:26
|
|
22
|
+
msgid "Hello"
|
|
23
|
+
msgstr ""
|
data/test/po/ja/_.edit.po
CHANGED
|
@@ -141,11 +141,11 @@ msgid ""
|
|
|
141
141
|
msgstr ""
|
|
142
142
|
|
|
143
143
|
#: ../fixtures/_/multiple_messages_in_same_line.rb:28
|
|
144
|
-
msgid "
|
|
144
|
+
msgid "multiple"
|
|
145
145
|
msgstr ""
|
|
146
146
|
|
|
147
147
|
#: ../fixtures/_/multiple_messages_in_same_line.rb:28
|
|
148
|
-
msgid "
|
|
148
|
+
msgid "in same line"
|
|
149
149
|
msgstr ""
|
|
150
150
|
|
|
151
151
|
#: ../fixtures/_/multiple_same_messages.rb:28 ../fixtures/_/multiple_same_messages.rb:32
|
data/test/po/ja/_.po
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Japanese translations for hello package.
|
|
2
|
+
# Copyright (C) 2015 THE PACKAGE'S COPYRIGHT HOLDER
|
|
3
|
+
# This file is distributed under the same license as the hello package.
|
|
4
|
+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
|
|
5
|
+
#
|
|
6
|
+
msgid ""
|
|
7
|
+
msgstr ""
|
|
8
|
+
"Project-Id-Version: hello 3.1.7\n"
|
|
9
|
+
"Report-Msgid-Bugs-To: \n"
|
|
10
|
+
"PO-Revision-Date: 2015-09-22 14:06+0900\n"
|
|
11
|
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
12
|
+
"Language-Team: Japanese\n"
|
|
13
|
+
"Language: ja\n"
|
|
14
|
+
"MIME-Version: 1.0\n"
|
|
15
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
|
16
|
+
"Content-Transfer-Encoding: 8bit\n"
|
|
17
|
+
"Plural-Forms: nplurals=1; plural=0;\n"
|
|
18
|
+
"\n"
|
|
19
|
+
|
|
20
|
+
#: ../fixtures/hello.rb:26
|
|
21
|
+
msgid "Hello"
|
|
22
|
+
msgstr "こんにちは"
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
|
|
17
|
+
#: simple.rb:10
|
|
18
|
+
msgid "language"
|
|
19
|
+
msgstr "traditional Chinese"
|
|
20
|
+
|
|
21
|
+
#: simple.rb:14
|
|
22
|
+
msgid "one is %d."
|
|
23
|
+
msgstr "TRADITIONAL CHINESE:ONE IS %d."
|
data/test/test_locale_path.rb
CHANGED
|
@@ -52,18 +52,28 @@ class TestLocalePath < Test::Unit::TestCase
|
|
|
52
52
|
def test_initialize_with_topdir
|
|
53
53
|
testdir = File.dirname(File.expand_path(__FILE__))
|
|
54
54
|
path = GetText::LocalePath.new("test1", "#{testdir}/locale")
|
|
55
|
-
assert_equal
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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"
|
|
59
|
+
},
|
|
60
|
+
path.locale_paths)
|
|
61
|
+
assert_equal("#{testdir}/locale/ja/LC_MESSAGES/test1.mo",
|
|
62
|
+
path.current_path(Locale::Tag.parse("ja")))
|
|
63
|
+
assert_equal("#{testdir}/locale/ja/LC_MESSAGES/test1.mo",
|
|
64
|
+
path.current_path(Locale::Tag.parse("ja-JP")))
|
|
65
|
+
assert_equal("#{testdir}/locale/ja/LC_MESSAGES/test1.mo",
|
|
66
|
+
path.current_path(Locale::Tag.parse("ja_JP.UTF-8")))
|
|
67
|
+
assert_equal(nil,
|
|
68
|
+
path.current_path(Locale::Tag.parse("en")))
|
|
69
|
+
assert_equal("#{testdir}/locale/zh_Hant/LC_MESSAGES/test1.mo",
|
|
70
|
+
path.current_path(Locale::Tag.parse("zh-Hant")))
|
|
61
71
|
end
|
|
62
72
|
|
|
63
73
|
def test_supported_locales
|
|
64
74
|
testdir = File.dirname(File.expand_path(__FILE__))
|
|
65
75
|
path = GetText::LocalePath.new("test1", "#{testdir}/locale")
|
|
66
|
-
assert_equal ["fr", "ja"], path.supported_locales
|
|
76
|
+
assert_equal ["fr", "ja", "zh_Hant"], path.supported_locales
|
|
67
77
|
|
|
68
78
|
path = GetText::LocalePath.new("plural", "#{testdir}/locale")
|
|
69
79
|
assert_equal ["cr", "da", "fr", "ir", "ja", "la", "li", "po", "sl"], path.supported_locales
|
data/test/test_parser.rb
CHANGED
|
@@ -64,38 +64,68 @@ class TestGetTextParser < Test::Unit::TestCase
|
|
|
64
64
|
end
|
|
65
65
|
|
|
66
66
|
def test_N_
|
|
67
|
-
@ary = @xgettext.parse(['fixtures/
|
|
68
|
-
|
|
69
|
-
assert_target
|
|
70
|
-
|
|
71
|
-
assert_target
|
|
72
|
-
|
|
73
|
-
assert_target
|
|
74
|
-
|
|
75
|
-
assert_target
|
|
76
|
-
|
|
77
|
-
assert_target
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
67
|
+
@ary = @xgettext.parse(['fixtures/upper_n_.rb'])
|
|
68
|
+
|
|
69
|
+
assert_target('aaa',
|
|
70
|
+
['fixtures/upper_n_.rb:10'])
|
|
71
|
+
assert_target("aaa\n",
|
|
72
|
+
['fixtures/upper_n_.rb:14'])
|
|
73
|
+
assert_target("bbb\nccc",
|
|
74
|
+
['fixtures/upper_n_.rb:18'])
|
|
75
|
+
assert_target("bbb\nccc\nddd\n",
|
|
76
|
+
['fixtures/upper_n_.rb:22'])
|
|
77
|
+
assert_target('eee',
|
|
78
|
+
[
|
|
79
|
+
'fixtures/upper_n_.rb:29',
|
|
80
|
+
'fixtures/upper_n_.rb:33',
|
|
81
|
+
])
|
|
82
|
+
assert_target('fff',
|
|
83
|
+
['fixtures/upper_n_.rb:33'])
|
|
84
|
+
assert_target('ggghhhiii',
|
|
85
|
+
['fixtures/upper_n_.rb:37'])
|
|
86
|
+
assert_target('a"b"c"',
|
|
87
|
+
['fixtures/upper_n_.rb:43'])
|
|
88
|
+
assert_target('d"e"f"',
|
|
89
|
+
['fixtures/upper_n_.rb:47'])
|
|
90
|
+
assert_target('jjj',
|
|
91
|
+
['fixtures/upper_n_.rb:51'])
|
|
92
|
+
assert_target('kkk',
|
|
93
|
+
['fixtures/upper_n_.rb:52'])
|
|
94
|
+
assert_target('lllmmm',
|
|
95
|
+
['fixtures/upper_n_.rb:56'])
|
|
96
|
+
assert_target("nnn\nooo",
|
|
97
|
+
['fixtures/upper_n_.rb:64'])
|
|
82
98
|
end
|
|
83
99
|
|
|
84
100
|
def test_n_
|
|
85
101
|
@xgettext.parse_options[:comment_tag] = "TRANSLATORS:"
|
|
86
|
-
@ary = @xgettext.parse(['fixtures/
|
|
87
|
-
assert_plural_target
|
|
88
|
-
|
|
89
|
-
assert_plural_target
|
|
90
|
-
|
|
91
|
-
assert_plural_target
|
|
92
|
-
|
|
93
|
-
assert_plural_target
|
|
94
|
-
|
|
95
|
-
assert_plural_target
|
|
96
|
-
|
|
97
|
-
assert_plural_target
|
|
98
|
-
|
|
102
|
+
@ary = @xgettext.parse(['fixtures/lower_n_.rb'])
|
|
103
|
+
assert_plural_target("aaa", "aaa2",
|
|
104
|
+
['fixtures/lower_n_.rb:29'])
|
|
105
|
+
assert_plural_target("bbb\n", "ccc2\nccc2",
|
|
106
|
+
['fixtures/lower_n_.rb:33'])
|
|
107
|
+
assert_plural_target("ddd\nddd", "ddd2\nddd2",
|
|
108
|
+
['fixtures/lower_n_.rb:37'])
|
|
109
|
+
assert_plural_target("eee\neee\n", "eee2\neee2\n",
|
|
110
|
+
['fixtures/lower_n_.rb:42'])
|
|
111
|
+
assert_plural_target("ddd\neee\n", "ddd\neee2",
|
|
112
|
+
['fixtures/lower_n_.rb:48'])
|
|
113
|
+
assert_plural_target("fff", "fff2",
|
|
114
|
+
[
|
|
115
|
+
'fixtures/lower_n_.rb:55',
|
|
116
|
+
'fixtures/lower_n_.rb:59',
|
|
117
|
+
])
|
|
118
|
+
assert_plural_target("ggg", "ggg2",
|
|
119
|
+
['fixtures/lower_n_.rb:59'])
|
|
120
|
+
assert_plural_target("ggghhhiii", "jjjkkklll",
|
|
121
|
+
['fixtures/lower_n_.rb:63'])
|
|
122
|
+
assert_plural_target("a\"b\"c\"", "a\"b\"c\"2",
|
|
123
|
+
['fixtures/lower_n_.rb:72'])
|
|
124
|
+
assert_plural_target("mmmmmm", "mmm2mmm2",
|
|
125
|
+
['fixtures/lower_n_.rb:80'])
|
|
126
|
+
assert_plural_target("nnn", "nnn2", ['fixtures/lower_n_.rb:81'])
|
|
127
|
+
assert_plural_target("comment", "comments",
|
|
128
|
+
['fixtures/lower_n_.rb:97']) do |t|
|
|
99
129
|
assert_equal "TRANSLATORS:please provide translations for all\n the plural forms!",
|
|
100
130
|
t.extracted_comment
|
|
101
131
|
end
|
|
@@ -175,9 +205,17 @@ class TestGetTextParser < Test::Unit::TestCase
|
|
|
175
205
|
assert_target 'bbb', ['fixtures/erb/ascii.rxml:13']
|
|
176
206
|
assert_plural_target "ccc1", "ccc2", ['fixtures/erb/ascii.rxml:14']
|
|
177
207
|
|
|
178
|
-
@ary = @xgettext.parse(['fixtures/
|
|
179
|
-
assert_plural_target
|
|
180
|
-
|
|
208
|
+
@ary = @xgettext.parse(['fixtures/lower_n_.rb'])
|
|
209
|
+
assert_plural_target("ooo", "ppp",
|
|
210
|
+
[
|
|
211
|
+
'fixtures/lower_n_.rb:85',
|
|
212
|
+
'fixtures/lower_n_.rb:86',
|
|
213
|
+
])
|
|
214
|
+
assert_plural_target("qqq", "rrr",
|
|
215
|
+
[
|
|
216
|
+
'fixtures/lower_n_.rb:90',
|
|
217
|
+
'fixtures/lower_n_.rb:91',
|
|
218
|
+
])
|
|
181
219
|
end
|
|
182
220
|
|
|
183
221
|
private
|