gettext 3.4.8 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/doc/text/news.md +13 -0
  3. data/lib/gettext/po_entry.rb +23 -15
  4. data/lib/gettext/tools/msgcat.rb +9 -2
  5. data/lib/gettext/tools/msginit.rb +2 -2
  6. data/lib/gettext/tools/msgmerge.rb +11 -6
  7. data/lib/gettext/tools/parser/ruby.rb +13 -13
  8. data/lib/gettext/tools/xgettext.rb +9 -4
  9. data/lib/gettext/version.rb +2 -2
  10. data/locale/ja/LC_MESSAGES/gettext.mo +0 -0
  11. data/po/bg/gettext.edit.po +60 -56
  12. data/po/bg/gettext.po +3 -0
  13. data/po/bs/gettext.edit.po +60 -56
  14. data/po/bs/gettext.po +3 -0
  15. data/po/ca/gettext.edit.po +60 -56
  16. data/po/ca/gettext.po +3 -0
  17. data/po/cs/gettext.edit.po +60 -56
  18. data/po/cs/gettext.po +3 -0
  19. data/po/de/gettext.edit.po +60 -56
  20. data/po/de/gettext.po +3 -0
  21. data/po/el/gettext.edit.po +60 -56
  22. data/po/el/gettext.po +3 -0
  23. data/po/eo/gettext.edit.po +60 -56
  24. data/po/eo/gettext.po +3 -0
  25. data/po/es/gettext.edit.po +60 -56
  26. data/po/es/gettext.po +3 -0
  27. data/po/et/gettext.edit.po +60 -56
  28. data/po/et/gettext.po +3 -0
  29. data/po/fr/gettext.edit.po +60 -56
  30. data/po/fr/gettext.po +3 -0
  31. data/po/gettext.pot +72 -67
  32. data/po/hr/gettext.edit.po +60 -56
  33. data/po/hr/gettext.po +3 -0
  34. data/po/hu/gettext.edit.po +60 -56
  35. data/po/hu/gettext.po +3 -0
  36. data/po/it/gettext.edit.po +60 -56
  37. data/po/it/gettext.po +3 -0
  38. data/po/ja/gettext.edit.po +61 -57
  39. data/po/ja/gettext.po +4 -1
  40. data/po/ko/gettext.edit.po +60 -56
  41. data/po/ko/gettext.po +3 -0
  42. data/po/lv/gettext.edit.po +60 -56
  43. data/po/lv/gettext.po +3 -0
  44. data/po/nb/gettext.edit.po +60 -56
  45. data/po/nb/gettext.po +3 -0
  46. data/po/nl/gettext.edit.po +60 -56
  47. data/po/nl/gettext.po +3 -0
  48. data/po/pt_BR/gettext.edit.po +60 -56
  49. data/po/pt_BR/gettext.po +3 -0
  50. data/po/ru/gettext.edit.po +60 -56
  51. data/po/ru/gettext.po +3 -0
  52. data/po/sr/gettext.edit.po +60 -56
  53. data/po/sr/gettext.po +3 -0
  54. data/po/sv/gettext.edit.po +60 -56
  55. data/po/sv/gettext.po +3 -0
  56. data/po/uk/gettext.edit.po +60 -56
  57. data/po/uk/gettext.po +3 -0
  58. data/po/vi/gettext.edit.po +60 -56
  59. data/po/vi/gettext.po +3 -0
  60. data/po/zh/gettext.edit.po +60 -56
  61. data/po/zh/gettext.po +3 -0
  62. data/po/zh_TW/gettext.edit.po +60 -56
  63. data/po/zh_TW/gettext.po +3 -0
  64. data/test/locale/ja/LC_MESSAGES/_.mo +0 -0
  65. data/test/po/ja/_.edit.po +3 -3
  66. data/test/tools/test_msgcat.rb +21 -1
  67. data/test/tools/test_msginit.rb +9 -7
  68. data/test/tools/test_msgmerge.rb +41 -3
  69. data/test/tools/test_xgettext.rb +15 -3
  70. metadata +4 -6
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2018 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2014-2023 Sutou Kouhei <kou@clear-code.com>
2
2
  #
3
3
  # License: Ruby's or LGPL
4
4
  #
@@ -243,6 +243,7 @@ msgstr ""
243
243
  @po = <<-PO
244
244
  # translator comment
245
245
  #: a.rb:1
246
+ #: a.rb:2
246
247
  msgid "Hello"
247
248
  msgstr ""
248
249
  PO
@@ -252,6 +253,25 @@ msgstr ""
252
253
  assert_equal(<<-PO, run_msgcat([@po], "--no-location"))
253
254
  # translator comment
254
255
  msgid "Hello"
256
+ msgstr ""
257
+ PO
258
+ end
259
+
260
+ def test_wrap
261
+ assert_equal(<<-PO, run_msgcat([@po], "--wrap"))
262
+ # translator comment
263
+ #: a.rb:1 a.rb:2
264
+ msgid "Hello"
265
+ msgstr ""
266
+ PO
267
+ end
268
+
269
+ def test_use_one_line_per_reference
270
+ assert_equal(<<-PO, run_msgcat([@po], "--wrap", "--use-one-line-per-reference"))
271
+ # translator comment
272
+ #: a.rb:1
273
+ #: a.rb:2
274
+ msgid "Hello"
255
275
  msgstr ""
256
276
  PO
257
277
  end
@@ -32,12 +32,10 @@ class TestToolsMsgInit < Test::Unit::TestCase
32
32
  stub(@msginit).revision_date {@po_revision_date}
33
33
 
34
34
  Locale.current = "ja_JP.UTF-8"
35
- end
36
35
 
37
- def run(*args, &blcok)
38
36
  Dir.mktmpdir do |dir|
39
37
  Dir.chdir(dir) do
40
- super
38
+ yield
41
39
  end
42
40
  end
43
41
  end
@@ -171,9 +169,11 @@ EOF
171
169
 
172
170
  class TestOutput < self
173
171
  def setup
174
- super
175
- @pot_file_path = "test.pot"
176
- create_pot_file(@pot_file_path)
172
+ super do
173
+ @pot_file_path = "test.pot"
174
+ create_pot_file(@pot_file_path)
175
+ yield
176
+ end
177
177
  end
178
178
 
179
179
  def test_default
@@ -313,8 +313,10 @@ EOF
313
313
 
314
314
  class TestPluralForms < self
315
315
  def setup
316
- super
317
316
  omit("Red Datasets is required") unless defined?(Datasets::CLDRPlurals)
317
+ super do
318
+ yield
319
+ end
318
320
  end
319
321
 
320
322
  def run_msginit(pot_header_options={})
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2012-2020 Sutou Kouhei <kou@clear-code.com>
1
+ # Copyright (C) 2012-2023 Sutou Kouhei <kou@clear-code.com>
4
2
  # Copyright (C) 2010 Eddie Lau <tatonlto@gmail.com>
5
3
  #
6
4
  # License: Ruby's or LGPL
@@ -654,6 +652,46 @@ msgstr ""
654
652
  end
655
653
  end
656
654
 
655
+ class TestUseOneLinePerReference < self
656
+ def pot_content
657
+ super + <<-POT
658
+
659
+ #: hello.rb:10
660
+ #: hello.rb:20
661
+ #: hello.rb:30
662
+ msgid "Good morning"
663
+ msgstr ""
664
+ POT
665
+ end
666
+
667
+ def test_with_wrap
668
+ @msgmerge.run("--update",
669
+ "--wrap",
670
+ "--use-one-line-per-reference",
671
+ @po_file_path, @pot_file_path)
672
+ assert_equal(<<-PO, File.read(@po_file_path))
673
+ #{po_header(@pot_formatted_time, @po_formatted_time)}
674
+ #: hello.rb:1
675
+ msgid "Hello"
676
+ msgstr ""
677
+
678
+ #: hello.rb:2
679
+ msgid "World"
680
+ msgstr "Translated World"
681
+
682
+ #: hello.rb:3
683
+ msgid "Good-bye"
684
+ msgstr ""
685
+
686
+ #: hello.rb:10
687
+ #: hello.rb:20
688
+ #: hello.rb:30
689
+ msgid "Good morning"
690
+ msgstr ""
691
+ PO
692
+ end
693
+ end
694
+
657
695
  class TestWidth < self
658
696
  def pot_content
659
697
  <<-POT
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2012-2020 Sutou Kouhei <kou@clear-code.com>
1
+ # Copyright (C) 2012-2023 Sutou Kouhei <kou@clear-code.com>
4
2
  # Copyright (C) 2012 Haruka Yoshihara <yoshihara@clear-code.com>
5
3
  #
6
4
  # License: Ruby's or LGPL
@@ -116,6 +114,20 @@ msgid "Hello"
116
114
  msgstr ""
117
115
  EOP
118
116
  end
117
+
118
+ def test_use_one_line_per_reference
119
+ pot_content = generate(<<-RUBY, "--use-one-line-per-reference")
120
+ _("Hello")
121
+ _("Hello")
122
+ RUBY
123
+ assert_equal(<<-POT, pot_content)
124
+ #{header}
125
+ #: ../lib/xgettext.rb:1
126
+ #: ../lib/xgettext.rb:2
127
+ msgid "Hello"
128
+ msgstr ""
129
+ POT
130
+ end
119
131
  end
120
132
 
121
133
  class TestParser < self
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gettext
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.8
4
+ version: 3.5.0
5
5
  platform: ruby
6
+ original_platform: ''
6
7
  authors:
7
8
  - Kouhei Sutou
8
9
  - Masao Mutoh
9
- autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-10-21 00:00:00.000000000 Z
12
+ date: 2024-12-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: erubi
@@ -1713,7 +1713,6 @@ licenses:
1713
1713
  - Ruby
1714
1714
  - LGPL-3.0+
1715
1715
  metadata: {}
1716
- post_install_message:
1717
1716
  rdoc_options: []
1718
1717
  require_paths:
1719
1718
  - lib
@@ -1728,8 +1727,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1728
1727
  - !ruby/object:Gem::Version
1729
1728
  version: '0'
1730
1729
  requirements: []
1731
- rubygems_version: 3.5.0.dev
1732
- signing_key:
1730
+ rubygems_version: 3.6.0.dev
1733
1731
  specification_version: 4
1734
1732
  summary: Gettext is a pure Ruby libary and tools to localize messages.
1735
1733
  test_files: