gettext 3.0.5 → 3.0.6
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 +8 -0
- data/lib/gettext/po_entry.rb +7 -0
- data/lib/gettext/tools/msgcat.rb +5 -1
- data/lib/gettext/tools/msgmerge.rb +16 -1
- data/lib/gettext/version.rb +1 -1
- data/locale/bg/LC_MESSAGES/gettext.mo +0 -0
- data/locale/bs/LC_MESSAGES/gettext.mo +0 -0
- data/locale/ca/LC_MESSAGES/gettext.mo +0 -0
- data/locale/cs/LC_MESSAGES/gettext.mo +0 -0
- data/locale/de/LC_MESSAGES/gettext.mo +0 -0
- data/locale/el/LC_MESSAGES/gettext.mo +0 -0
- data/locale/eo/LC_MESSAGES/gettext.mo +0 -0
- data/locale/es/LC_MESSAGES/gettext.mo +0 -0
- data/locale/et/LC_MESSAGES/gettext.mo +0 -0
- data/locale/fr/LC_MESSAGES/gettext.mo +0 -0
- data/locale/hr/LC_MESSAGES/gettext.mo +0 -0
- data/locale/hu/LC_MESSAGES/gettext.mo +0 -0
- data/locale/it/LC_MESSAGES/gettext.mo +0 -0
- data/locale/ja/LC_MESSAGES/gettext.mo +0 -0
- data/locale/ko/LC_MESSAGES/gettext.mo +0 -0
- data/locale/lv/LC_MESSAGES/gettext.mo +0 -0
- data/locale/nb/LC_MESSAGES/gettext.mo +0 -0
- data/locale/nl/LC_MESSAGES/gettext.mo +0 -0
- data/locale/pt_BR/LC_MESSAGES/gettext.mo +0 -0
- data/locale/ru/LC_MESSAGES/gettext.mo +0 -0
- data/locale/sr/LC_MESSAGES/gettext.mo +0 -0
- data/locale/sv/LC_MESSAGES/gettext.mo +0 -0
- data/locale/uk/LC_MESSAGES/gettext.mo +0 -0
- data/locale/vi/LC_MESSAGES/gettext.mo +0 -0
- data/locale/zh/LC_MESSAGES/gettext.mo +0 -0
- data/locale/zh_TW/LC_MESSAGES/gettext.mo +0 -0
- data/po/bg/gettext.po +150 -88
- data/po/bs/gettext.po +158 -95
- data/po/ca/gettext.po +150 -88
- data/po/cs/gettext.po +158 -95
- data/po/de/gettext.po +150 -88
- data/po/el/gettext.po +150 -88
- data/po/eo/gettext.po +151 -89
- data/po/es/gettext.po +150 -88
- data/po/et/gettext.po +150 -88
- data/po/fr/gettext.po +150 -88
- data/po/gettext.pot +37 -33
- data/po/hr/gettext.po +150 -88
- data/po/hu/gettext.po +150 -88
- data/po/it/gettext.po +148 -80
- data/po/ja/gettext.po +150 -84
- data/po/ko/gettext.po +150 -88
- data/po/lv/gettext.po +150 -88
- data/po/nb/gettext.po +150 -88
- data/po/nl/gettext.po +150 -88
- data/po/pt_BR/gettext.po +150 -88
- data/po/ru/gettext.po +150 -88
- data/po/sr/gettext.po +150 -88
- data/po/sv/gettext.po +140 -66
- data/po/uk/gettext.po +150 -88
- data/po/vi/gettext.po +150 -88
- data/po/zh/gettext.po +150 -88
- data/po/zh_TW/gettext.po +150 -88
- data/test/test_po_entry.rb +27 -0
- data/test/tools/test_msgcat.rb +25 -18
- data/test/tools/test_msgmerge.rb +38 -0
- metadata +1 -1
data/test/test_po_entry.rb
CHANGED
@@ -621,6 +621,33 @@ msgstr ""
|
|
621
621
|
assert_false(entry.fuzzy?)
|
622
622
|
end
|
623
623
|
end
|
624
|
+
|
625
|
+
class TestTranslated < self
|
626
|
+
def setup
|
627
|
+
@entry = GetText::POEntry.new(:normal)
|
628
|
+
@entry.msgid = "Hello"
|
629
|
+
end
|
630
|
+
|
631
|
+
def test_have_msgstr
|
632
|
+
@entry.msgstr = "Bonjour"
|
633
|
+
assert_true(@entry.translated?)
|
634
|
+
end
|
635
|
+
|
636
|
+
def test_nil_msgstr
|
637
|
+
@entry.msgstr = nil
|
638
|
+
assert_false(@entry.translated?)
|
639
|
+
end
|
640
|
+
|
641
|
+
def test_empty_msgstr
|
642
|
+
@entry.msgstr = ""
|
643
|
+
assert_false(@entry.translated?)
|
644
|
+
end
|
645
|
+
|
646
|
+
def test_fuzzy
|
647
|
+
@entry.flag = "fuzzy"
|
648
|
+
assert_false(@entry.translated?)
|
649
|
+
end
|
650
|
+
end
|
624
651
|
end
|
625
652
|
|
626
653
|
class TestFormatter < self
|
data/test/tools/test_msgcat.rb
CHANGED
@@ -99,35 +99,42 @@ msgstr "Monde"
|
|
99
99
|
|
100
100
|
class TestDuplicated < self
|
101
101
|
class TestTranslated < self
|
102
|
-
|
103
|
-
|
104
|
-
@po = <<-PO
|
102
|
+
def test_same
|
103
|
+
po = <<-PO
|
105
104
|
msgid "Hello"
|
106
105
|
msgstr "Bonjour"
|
107
|
-
|
108
|
-
end
|
106
|
+
PO
|
109
107
|
|
110
|
-
|
111
|
-
assert_equal(@po, run_msgcat([@po, @po]))
|
112
|
-
end
|
108
|
+
assert_equal(po, run_msgcat([po, po]))
|
113
109
|
end
|
114
110
|
|
115
|
-
|
116
|
-
|
117
|
-
@po1 = <<-PO
|
111
|
+
def test_different
|
112
|
+
po1 = <<-PO
|
118
113
|
msgid "Hello"
|
119
114
|
msgstr "Bonjour"
|
120
|
-
|
115
|
+
PO
|
121
116
|
|
122
|
-
|
117
|
+
po2 = <<-PO
|
123
118
|
msgid "Hello"
|
124
119
|
msgstr "Salut"
|
125
|
-
|
126
|
-
|
120
|
+
PO
|
121
|
+
|
122
|
+
assert_equal(po1, run_msgcat([po1, po2]))
|
123
|
+
end
|
124
|
+
|
125
|
+
def test_one_not_translated
|
126
|
+
po_not_translated = <<-PO
|
127
|
+
msgid "Hello"
|
128
|
+
msgstr ""
|
129
|
+
PO
|
130
|
+
|
131
|
+
po_translated = <<-PO
|
132
|
+
msgid "Hello"
|
133
|
+
msgstr "Bonjour"
|
134
|
+
PO
|
127
135
|
|
128
|
-
|
129
|
-
|
130
|
-
end
|
136
|
+
assert_equal(po_translated,
|
137
|
+
run_msgcat([po_not_translated, po_translated]))
|
131
138
|
end
|
132
139
|
end
|
133
140
|
end
|
data/test/tools/test_msgmerge.rb
CHANGED
@@ -710,5 +710,43 @@ msgstr ""
|
|
710
710
|
PO
|
711
711
|
end
|
712
712
|
end
|
713
|
+
|
714
|
+
class TestObsoleteEntries < self
|
715
|
+
def pot_content
|
716
|
+
<<-POT
|
717
|
+
msgid "World"
|
718
|
+
msgstr ""
|
719
|
+
POT
|
720
|
+
end
|
721
|
+
|
722
|
+
def po_content
|
723
|
+
<<-PO
|
724
|
+
msgid "Hello!"
|
725
|
+
msgstr "Bonjour!"
|
726
|
+
PO
|
727
|
+
end
|
728
|
+
|
729
|
+
def test_default
|
730
|
+
@msgmerge.run("--update",
|
731
|
+
@po_file_path, @pot_file_path)
|
732
|
+
assert_equal(<<-PO, File.read(@po_file_path))
|
733
|
+
msgid "World"
|
734
|
+
msgstr ""
|
735
|
+
|
736
|
+
#~ msgid "Hello!"
|
737
|
+
#~ msgstr "Bonjour!"
|
738
|
+
PO
|
739
|
+
end
|
740
|
+
|
741
|
+
def test_no_obsolete_entries
|
742
|
+
@msgmerge.run("--update",
|
743
|
+
"--no-obsolete-entries",
|
744
|
+
@po_file_path, @pot_file_path)
|
745
|
+
assert_equal(<<-PO, File.read(@po_file_path))
|
746
|
+
msgid "World"
|
747
|
+
msgstr ""
|
748
|
+
PO
|
749
|
+
end
|
750
|
+
end
|
713
751
|
end
|
714
752
|
end
|