gettext 3.4.8 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/text/news.md +13 -0
- data/lib/gettext/po_entry.rb +23 -15
- data/lib/gettext/tools/msgcat.rb +9 -2
- data/lib/gettext/tools/msginit.rb +2 -2
- data/lib/gettext/tools/msgmerge.rb +11 -6
- data/lib/gettext/tools/parser/ruby.rb +13 -13
- data/lib/gettext/tools/xgettext.rb +9 -4
- data/lib/gettext/version.rb +2 -2
- data/locale/ja/LC_MESSAGES/gettext.mo +0 -0
- data/po/bg/gettext.edit.po +60 -56
- data/po/bg/gettext.po +3 -0
- data/po/bs/gettext.edit.po +60 -56
- data/po/bs/gettext.po +3 -0
- data/po/ca/gettext.edit.po +60 -56
- data/po/ca/gettext.po +3 -0
- data/po/cs/gettext.edit.po +60 -56
- data/po/cs/gettext.po +3 -0
- data/po/de/gettext.edit.po +60 -56
- data/po/de/gettext.po +3 -0
- data/po/el/gettext.edit.po +60 -56
- data/po/el/gettext.po +3 -0
- data/po/eo/gettext.edit.po +60 -56
- data/po/eo/gettext.po +3 -0
- data/po/es/gettext.edit.po +60 -56
- data/po/es/gettext.po +3 -0
- data/po/et/gettext.edit.po +60 -56
- data/po/et/gettext.po +3 -0
- data/po/fr/gettext.edit.po +60 -56
- data/po/fr/gettext.po +3 -0
- data/po/gettext.pot +72 -67
- data/po/hr/gettext.edit.po +60 -56
- data/po/hr/gettext.po +3 -0
- data/po/hu/gettext.edit.po +60 -56
- data/po/hu/gettext.po +3 -0
- data/po/it/gettext.edit.po +60 -56
- data/po/it/gettext.po +3 -0
- data/po/ja/gettext.edit.po +61 -57
- data/po/ja/gettext.po +4 -1
- data/po/ko/gettext.edit.po +60 -56
- data/po/ko/gettext.po +3 -0
- data/po/lv/gettext.edit.po +60 -56
- data/po/lv/gettext.po +3 -0
- data/po/nb/gettext.edit.po +60 -56
- data/po/nb/gettext.po +3 -0
- data/po/nl/gettext.edit.po +60 -56
- data/po/nl/gettext.po +3 -0
- data/po/pt_BR/gettext.edit.po +60 -56
- data/po/pt_BR/gettext.po +3 -0
- data/po/ru/gettext.edit.po +60 -56
- data/po/ru/gettext.po +3 -0
- data/po/sr/gettext.edit.po +60 -56
- data/po/sr/gettext.po +3 -0
- data/po/sv/gettext.edit.po +60 -56
- data/po/sv/gettext.po +3 -0
- data/po/uk/gettext.edit.po +60 -56
- data/po/uk/gettext.po +3 -0
- data/po/vi/gettext.edit.po +60 -56
- data/po/vi/gettext.po +3 -0
- data/po/zh/gettext.edit.po +60 -56
- data/po/zh/gettext.po +3 -0
- data/po/zh_TW/gettext.edit.po +60 -56
- data/po/zh_TW/gettext.po +3 -0
- data/test/locale/ja/LC_MESSAGES/_.mo +0 -0
- data/test/po/ja/_.edit.po +3 -3
- data/test/tools/test_msgcat.rb +21 -1
- data/test/tools/test_msginit.rb +9 -7
- data/test/tools/test_msgmerge.rb +41 -3
- data/test/tools/test_xgettext.rb +15 -3
- metadata +4 -6
data/test/tools/test_msgcat.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2014-
|
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
|
data/test/tools/test_msginit.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
176
|
-
|
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={})
|
data/test/tools/test_msgmerge.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
#
|
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
|
data/test/tools/test_xgettext.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
#
|
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
|
+
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:
|
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.
|
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:
|