gettext 3.0.5 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/doc/text/news.md +8 -0
  3. data/lib/gettext/po_entry.rb +7 -0
  4. data/lib/gettext/tools/msgcat.rb +5 -1
  5. data/lib/gettext/tools/msgmerge.rb +16 -1
  6. data/lib/gettext/version.rb +1 -1
  7. data/locale/bg/LC_MESSAGES/gettext.mo +0 -0
  8. data/locale/bs/LC_MESSAGES/gettext.mo +0 -0
  9. data/locale/ca/LC_MESSAGES/gettext.mo +0 -0
  10. data/locale/cs/LC_MESSAGES/gettext.mo +0 -0
  11. data/locale/de/LC_MESSAGES/gettext.mo +0 -0
  12. data/locale/el/LC_MESSAGES/gettext.mo +0 -0
  13. data/locale/eo/LC_MESSAGES/gettext.mo +0 -0
  14. data/locale/es/LC_MESSAGES/gettext.mo +0 -0
  15. data/locale/et/LC_MESSAGES/gettext.mo +0 -0
  16. data/locale/fr/LC_MESSAGES/gettext.mo +0 -0
  17. data/locale/hr/LC_MESSAGES/gettext.mo +0 -0
  18. data/locale/hu/LC_MESSAGES/gettext.mo +0 -0
  19. data/locale/it/LC_MESSAGES/gettext.mo +0 -0
  20. data/locale/ja/LC_MESSAGES/gettext.mo +0 -0
  21. data/locale/ko/LC_MESSAGES/gettext.mo +0 -0
  22. data/locale/lv/LC_MESSAGES/gettext.mo +0 -0
  23. data/locale/nb/LC_MESSAGES/gettext.mo +0 -0
  24. data/locale/nl/LC_MESSAGES/gettext.mo +0 -0
  25. data/locale/pt_BR/LC_MESSAGES/gettext.mo +0 -0
  26. data/locale/ru/LC_MESSAGES/gettext.mo +0 -0
  27. data/locale/sr/LC_MESSAGES/gettext.mo +0 -0
  28. data/locale/sv/LC_MESSAGES/gettext.mo +0 -0
  29. data/locale/uk/LC_MESSAGES/gettext.mo +0 -0
  30. data/locale/vi/LC_MESSAGES/gettext.mo +0 -0
  31. data/locale/zh/LC_MESSAGES/gettext.mo +0 -0
  32. data/locale/zh_TW/LC_MESSAGES/gettext.mo +0 -0
  33. data/po/bg/gettext.po +150 -88
  34. data/po/bs/gettext.po +158 -95
  35. data/po/ca/gettext.po +150 -88
  36. data/po/cs/gettext.po +158 -95
  37. data/po/de/gettext.po +150 -88
  38. data/po/el/gettext.po +150 -88
  39. data/po/eo/gettext.po +151 -89
  40. data/po/es/gettext.po +150 -88
  41. data/po/et/gettext.po +150 -88
  42. data/po/fr/gettext.po +150 -88
  43. data/po/gettext.pot +37 -33
  44. data/po/hr/gettext.po +150 -88
  45. data/po/hu/gettext.po +150 -88
  46. data/po/it/gettext.po +148 -80
  47. data/po/ja/gettext.po +150 -84
  48. data/po/ko/gettext.po +150 -88
  49. data/po/lv/gettext.po +150 -88
  50. data/po/nb/gettext.po +150 -88
  51. data/po/nl/gettext.po +150 -88
  52. data/po/pt_BR/gettext.po +150 -88
  53. data/po/ru/gettext.po +150 -88
  54. data/po/sr/gettext.po +150 -88
  55. data/po/sv/gettext.po +140 -66
  56. data/po/uk/gettext.po +150 -88
  57. data/po/vi/gettext.po +150 -88
  58. data/po/zh/gettext.po +150 -88
  59. data/po/zh_TW/gettext.po +150 -88
  60. data/test/test_po_entry.rb +27 -0
  61. data/test/tools/test_msgcat.rb +25 -18
  62. data/test/tools/test_msgmerge.rb +38 -0
  63. metadata +1 -1
@@ -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
@@ -99,35 +99,42 @@ msgstr "Monde"
99
99
 
100
100
  class TestDuplicated < self
101
101
  class TestTranslated < self
102
- class TestSame < self
103
- def setup
104
- @po = <<-PO
102
+ def test_same
103
+ po = <<-PO
105
104
  msgid "Hello"
106
105
  msgstr "Bonjour"
107
- PO
108
- end
106
+ PO
109
107
 
110
- def test_default
111
- assert_equal(@po, run_msgcat([@po, @po]))
112
- end
108
+ assert_equal(po, run_msgcat([po, po]))
113
109
  end
114
110
 
115
- class TestDifferent < self
116
- def setup
117
- @po1 = <<-PO
111
+ def test_different
112
+ po1 = <<-PO
118
113
  msgid "Hello"
119
114
  msgstr "Bonjour"
120
- PO
115
+ PO
121
116
 
122
- @po2 = <<-PO
117
+ po2 = <<-PO
123
118
  msgid "Hello"
124
119
  msgstr "Salut"
125
- PO
126
- end
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
- def test_default
129
- assert_equal(@po1, run_msgcat([@po1, @po2]))
130
- end
136
+ assert_equal(po_translated,
137
+ run_msgcat([po_not_translated, po_translated]))
131
138
  end
132
139
  end
133
140
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gettext
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.5
4
+ version: 3.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou