gettext 3.3.0 → 3.3.1
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 +23 -0
- data/lib/gettext/tools/msginit.rb +5 -4
- data/lib/gettext/tools/parser/gtk_builder_ui_definitions.rb +129 -0
- data/lib/gettext/tools/parser/ruby.rb +48 -22
- data/lib/gettext/tools/xgettext.rb +6 -6
- data/lib/gettext/version.rb +1 -1
- data/locale/ja/LC_MESSAGES/gettext.mo +0 -0
- data/po/bg/gettext.edit.po +12 -4
- data/po/bg/gettext.po +7 -3
- data/po/bs/gettext.edit.po +12 -4
- data/po/bs/gettext.po +7 -3
- data/po/ca/gettext.edit.po +12 -4
- data/po/ca/gettext.po +7 -3
- data/po/cs/gettext.edit.po +12 -4
- data/po/cs/gettext.po +7 -3
- data/po/de/gettext.edit.po +12 -4
- data/po/de/gettext.po +7 -3
- data/po/el/gettext.edit.po +12 -4
- data/po/el/gettext.po +7 -3
- data/po/eo/gettext.edit.po +12 -4
- data/po/eo/gettext.po +7 -3
- data/po/es/gettext.edit.po +12 -4
- data/po/es/gettext.po +7 -3
- data/po/et/gettext.edit.po +12 -4
- data/po/et/gettext.po +7 -3
- data/po/fr/gettext.edit.po +12 -4
- data/po/fr/gettext.po +7 -3
- data/po/gettext.pot +15 -9
- data/po/hr/gettext.edit.po +12 -4
- data/po/hr/gettext.po +7 -3
- data/po/hu/gettext.edit.po +12 -4
- data/po/hu/gettext.po +7 -3
- data/po/it/gettext.edit.po +12 -4
- data/po/it/gettext.po +7 -3
- data/po/ja/gettext.edit.po +14 -6
- data/po/ja/gettext.po +9 -5
- data/po/ko/gettext.edit.po +12 -4
- data/po/ko/gettext.po +7 -3
- data/po/lv/gettext.edit.po +12 -4
- data/po/lv/gettext.po +7 -3
- data/po/nb/gettext.edit.po +12 -4
- data/po/nb/gettext.po +7 -3
- data/po/nl/gettext.edit.po +12 -4
- data/po/nl/gettext.po +7 -3
- data/po/pt_BR/gettext.edit.po +12 -4
- data/po/pt_BR/gettext.po +7 -3
- data/po/ru/gettext.edit.po +12 -4
- data/po/ru/gettext.po +7 -3
- data/po/sr/gettext.edit.po +12 -4
- data/po/sr/gettext.po +7 -3
- data/po/sv/gettext.edit.po +12 -4
- data/po/sv/gettext.po +7 -3
- data/po/uk/gettext.edit.po +12 -4
- data/po/uk/gettext.po +7 -3
- data/po/vi/gettext.edit.po +12 -4
- data/po/vi/gettext.po +7 -3
- data/po/zh/gettext.edit.po +12 -4
- data/po/zh/gettext.po +7 -3
- data/po/zh_TW/gettext.edit.po +12 -4
- data/po/zh_TW/gettext.po +7 -3
- data/samples/cgi/po/helloerb1.pot +3 -3
- data/samples/cgi/po/helloerb2.pot +3 -3
- data/samples/cgi/po/hellolib.pot +3 -3
- data/samples/cgi/po/main.pot +3 -3
- data/samples/po/hello.pot +3 -3
- data/samples/po/hello2.pot +4 -4
- data/samples/po/hello_glade2.pot +4 -4
- data/samples/po/hello_gtk2.pot +4 -4
- data/samples/po/hello_gtk_builder.pot +5 -4
- data/samples/po/hello_noop.pot +4 -4
- data/samples/po/hello_plural.pot +4 -4
- data/samples/po/hello_tk.pot +4 -4
- data/test/fixtures/_/backtick.rb +30 -0
- data/test/fixtures/_/block_parameter.rb +2 -2
- data/test/fixtures/_/double_quote_in_double_quote.rb +2 -2
- data/test/fixtures/_/double_quote_in_single_quote.rb +2 -2
- data/test/fixtures/_/literal_concatenation_with_continuation_line.rb +2 -2
- data/test/fixtures/_/middle_new_line.rb +2 -2
- data/test/fixtures/_/multiple_lines_literal.rb +2 -2
- data/test/fixtures/_/multiple_messages_in_same_line.rb +2 -2
- data/test/fixtures/_/multiple_same_messages.rb +2 -2
- data/test/fixtures/_/one_line.rb +2 -2
- data/test/fixtures/_/one_new_line.rb +2 -2
- data/test/{gettext-test-utils.rb → fixtures/_/percent_strings.rb} +21 -26
- data/test/fixtures/_/quoted_symbol.rb +34 -0
- data/test/fixtures/gtk_builder_ui_definitions.ui +68 -0
- data/test/fixtures/ns_/custom.rb +2 -2
- data/test/fixtures/s_/custom.rb +2 -2
- data/test/helper.rb +99 -0
- data/test/po/_.pot +2 -6
- data/test/po/backslash.pot +4 -6
- data/test/po/hello.pot +3 -3
- data/test/po/ja/_.edit.po +0 -4
- data/test/po/ja/hello.edit.po +1 -0
- data/test/po/non_ascii.pot +4 -4
- data/test/po/np_.pot +5 -8
- data/test/po/ns_.pot +4 -6
- data/test/po/p_.pot +3 -3
- data/test/po/s_.pot +4 -6
- data/test/po/untranslated.pot +4 -4
- data/test/run-test.rb +2 -2
- data/test/test_parser.rb +11 -10
- data/test/test_po_parser.rb +2 -2
- data/test/test_string.rb +1 -1
- data/test/tools/parser/test_gtk_builder_ui_definitions.rb +45 -0
- data/test/tools/parser/test_ruby.rb +26 -39
- data/test/tools/test_msgmerge.rb +3 -3
- data/test/tools/test_xgettext.rb +2 -2
- metadata +20 -14
data/test/po/ja/_.edit.po
CHANGED
|
@@ -93,10 +93,6 @@ msgid ""
|
|
|
93
93
|
"Here document2\n"
|
|
94
94
|
msgstr ""
|
|
95
95
|
|
|
96
|
-
#: ../fixtures/_.rb:109
|
|
97
|
-
msgid "in_quote"
|
|
98
|
-
msgstr ""
|
|
99
|
-
|
|
100
96
|
#. TRANSLATORS: This is a proper name. See the gettext
|
|
101
97
|
#. manual, section Names. Note this is actually a non-ASCII
|
|
102
98
|
#. name: The first name is (with Unicode escapes)
|
data/test/po/ja/hello.edit.po
CHANGED
data/test/po/non_ascii.pot
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# SOME DESCRIPTIVE TITLE.
|
|
2
2
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
|
3
|
-
# This file is distributed under the same license as the
|
|
3
|
+
# This file is distributed under the same license as the gettext package.
|
|
4
4
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
5
5
|
#
|
|
6
6
|
#, fuzzy
|
|
7
7
|
msgid ""
|
|
8
8
|
msgstr ""
|
|
9
|
-
"Project-Id-Version:
|
|
9
|
+
"Project-Id-Version: gettext 3.0.0\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
|
-
"POT-Creation-Date:
|
|
12
|
-
"PO-Revision-Date:
|
|
11
|
+
"POT-Creation-Date: 2013-08-30 22:00+0900\n"
|
|
12
|
+
"PO-Revision-Date: 2013-08-30 22:00+0900\n"
|
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
15
15
|
"Language: \n"
|
data/test/po/np_.pot
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
# SOME DESCRIPTIVE TITLE.
|
|
2
2
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
|
3
|
-
# This file is distributed under the same license as the
|
|
3
|
+
# This file is distributed under the same license as the PACKAGE package.
|
|
4
4
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
5
5
|
#
|
|
6
6
|
#, fuzzy
|
|
7
7
|
msgid ""
|
|
8
8
|
msgstr ""
|
|
9
|
-
"Project-Id-Version:
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"PO-Revision-Date: 2018-06-16 12:12+0900\n"
|
|
9
|
+
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
|
+
"POT-Creation-Date: 2012-08-19 22:14+0900\n"
|
|
11
|
+
"PO-Revision-Date: 2012-08-19 22:14+0900\n"
|
|
13
12
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
13
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
15
|
-
"Language: \n"
|
|
16
14
|
"MIME-Version: 1.0\n"
|
|
17
15
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
18
16
|
"Content-Transfer-Encoding: 8bit\n"
|
|
19
17
|
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
|
20
18
|
|
|
21
|
-
#: ../fixtures/np_.rb:28 ../fixtures/np_.rb:29 ../fixtures/np_.rb:33
|
|
22
|
-
#: ../fixtures/np_.rb:34
|
|
19
|
+
#: ../fixtures/np_.rb:28 ../fixtures/np_.rb:29 ../fixtures/np_.rb:33 ../fixtures/np_.rb:34
|
|
23
20
|
msgctxt "Magazine"
|
|
24
21
|
msgid "a book"
|
|
25
22
|
msgid_plural "%{num} books"
|
data/test/po/ns_.pot
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
# SOME DESCRIPTIVE TITLE.
|
|
2
2
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
|
3
|
-
# This file is distributed under the same license as the
|
|
3
|
+
# This file is distributed under the same license as the PACKAGE package.
|
|
4
4
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
5
5
|
#
|
|
6
6
|
#, fuzzy
|
|
7
7
|
msgid ""
|
|
8
8
|
msgstr ""
|
|
9
|
-
"Project-Id-Version:
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"PO-Revision-Date: 2018-06-16 12:12+0900\n"
|
|
9
|
+
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
|
+
"POT-Creation-Date: 2012-08-19 22:38+0900\n"
|
|
11
|
+
"PO-Revision-Date: 2012-08-19 22:38+0900\n"
|
|
13
12
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
13
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
15
|
-
"Language: \n"
|
|
16
14
|
"MIME-Version: 1.0\n"
|
|
17
15
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
18
16
|
"Content-Transfer-Encoding: 8bit\n"
|
data/test/po/p_.pot
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
#, fuzzy
|
|
7
7
|
msgid ""
|
|
8
8
|
msgstr ""
|
|
9
|
-
"Project-Id-Version: p_ 3.
|
|
9
|
+
"Project-Id-Version: p_ 3.1.3\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
|
-
"POT-Creation-Date:
|
|
12
|
-
"PO-Revision-Date:
|
|
11
|
+
"POT-Creation-Date: 2014-07-09 15:25+0900\n"
|
|
12
|
+
"PO-Revision-Date: 2014-07-09 15:25+0900\n"
|
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
15
15
|
"Language: \n"
|
data/test/po/s_.pot
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
# SOME DESCRIPTIVE TITLE.
|
|
2
2
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
|
3
|
-
# This file is distributed under the same license as the
|
|
3
|
+
# This file is distributed under the same license as the PACKAGE package.
|
|
4
4
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
5
5
|
#
|
|
6
6
|
#, fuzzy
|
|
7
7
|
msgid ""
|
|
8
8
|
msgstr ""
|
|
9
|
-
"Project-Id-Version:
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"PO-Revision-Date: 2018-06-16 12:12+0900\n"
|
|
9
|
+
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
|
+
"POT-Creation-Date: 2012-08-19 22:25+0900\n"
|
|
11
|
+
"PO-Revision-Date: 2012-08-19 22:25+0900\n"
|
|
13
12
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
13
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
15
|
-
"Language: \n"
|
|
16
14
|
"MIME-Version: 1.0\n"
|
|
17
15
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
18
16
|
"Content-Transfer-Encoding: 8bit\n"
|
data/test/po/untranslated.pot
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# SOME DESCRIPTIVE TITLE.
|
|
2
2
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
|
3
|
-
# This file is distributed under the same license as the
|
|
3
|
+
# This file is distributed under the same license as the gettext package.
|
|
4
4
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
5
5
|
#
|
|
6
6
|
#, fuzzy
|
|
7
7
|
msgid ""
|
|
8
8
|
msgstr ""
|
|
9
|
-
"Project-Id-Version:
|
|
9
|
+
"Project-Id-Version: gettext 3.0.0\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
|
-
"POT-Creation-Date:
|
|
12
|
-
"PO-Revision-Date:
|
|
11
|
+
"POT-Creation-Date: 2013-08-30 22:00+0900\n"
|
|
12
|
+
"PO-Revision-Date: 2013-08-30 22:00+0900\n"
|
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
15
15
|
"Language: \n"
|
data/test/run-test.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
#
|
|
3
|
-
# Copyright (C) 2012 Kouhei
|
|
3
|
+
# Copyright (C) 2012-2020 Sutou Kouhei <kou@clear-code.com>
|
|
4
4
|
#
|
|
5
5
|
# License: Ruby's or LGPL
|
|
6
6
|
#
|
|
@@ -32,7 +32,7 @@ require "test-unit"
|
|
|
32
32
|
require "test/unit/notify"
|
|
33
33
|
require "test/unit/rr"
|
|
34
34
|
|
|
35
|
-
require "
|
|
35
|
+
require "helper"
|
|
36
36
|
|
|
37
37
|
Dir.chdir(test_dir) do
|
|
38
38
|
Dir.glob("**/test_*.rb").each do |test_file_path|
|
data/test/test_parser.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
#
|
|
3
3
|
# Copyright (C) 2012 Haruka Yoshihara <yoshihara@clear-code.com>
|
|
4
|
-
# Copyright (C) 2012-
|
|
4
|
+
# Copyright (C) 2012-2020 Sutou Kouhei <kou@clear-code.com>
|
|
5
5
|
# Copyright (C) 2010 masone (Christian Felder) <ema@rh-productions.ch>
|
|
6
6
|
# Copyright (C) 2009 Vladimir Dobriakov <vladimir@geekq.net>
|
|
7
7
|
# Copyright (C) 2009-2010 Masao Mutoh
|
|
@@ -160,7 +160,7 @@ class TestGetTextParser < Test::Unit::TestCase
|
|
|
160
160
|
end
|
|
161
161
|
|
|
162
162
|
class TestErbParser < self
|
|
163
|
-
include
|
|
163
|
+
include Helper::Path
|
|
164
164
|
|
|
165
165
|
def test_detect_encoding
|
|
166
166
|
euc_file = Tempfile.new("euc-jp.rhtml")
|
|
@@ -175,19 +175,20 @@ class TestGetTextParser < Test::Unit::TestCase
|
|
|
175
175
|
end
|
|
176
176
|
|
|
177
177
|
def test_ascii
|
|
178
|
-
|
|
178
|
+
path = fixture_path("erb", "ascii.rhtml")
|
|
179
|
+
@ary = GetText::ErbParser.parse(path)
|
|
179
180
|
|
|
180
|
-
assert_target 'aaa', [
|
|
181
|
-
assert_target "aaa\n", [
|
|
182
|
-
assert_target 'bbb', [
|
|
183
|
-
assert_plural_target "ccc1", "ccc2", [
|
|
181
|
+
assert_target 'aaa', ["#{path}:8"]
|
|
182
|
+
assert_target "aaa\n", ["#{path}:11"]
|
|
183
|
+
assert_target 'bbb', ["#{path}:12"]
|
|
184
|
+
assert_plural_target "ccc1", "ccc2", ["#{path}:13"]
|
|
184
185
|
end
|
|
185
186
|
|
|
186
187
|
def test_non_ascii
|
|
187
|
-
|
|
188
|
-
@ary = GetText::ErbParser.parse(
|
|
188
|
+
path = fixture_path("erb", "non_ascii.rhtml")
|
|
189
|
+
@ary = GetText::ErbParser.parse(path)
|
|
189
190
|
|
|
190
|
-
assert_target('わたし', ["#{
|
|
191
|
+
assert_target('わたし', ["#{path}:12"])
|
|
191
192
|
end
|
|
192
193
|
end
|
|
193
194
|
|
data/test/test_po_parser.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2012-
|
|
1
|
+
# Copyright (C) 2012-2020 Sutou Kouhei <kou@clear-code.com>
|
|
2
2
|
# Copyright (C) 2012 Haruka Yoshihara <yoshihara@clear-code.com>
|
|
3
3
|
#
|
|
4
4
|
# License: Ruby's or LGPL
|
|
@@ -60,7 +60,7 @@ EOP
|
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
class TestPO < self
|
|
63
|
-
include
|
|
63
|
+
include Helper::Warning
|
|
64
64
|
|
|
65
65
|
def test_msgstr
|
|
66
66
|
po_file = create_po_file(<<-EOP)
|
data/test/test_string.rb
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Copyright (C) 2020 Sutou Kouhei <kou@clear-code.com>
|
|
2
|
+
#
|
|
3
|
+
# License: Ruby's or LGPL
|
|
4
|
+
#
|
|
5
|
+
# This library is free software: you can redistribute it and/or modify
|
|
6
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
|
7
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
# (at your option) any later version.
|
|
9
|
+
#
|
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
# GNU Lesser General Public License for more details.
|
|
14
|
+
#
|
|
15
|
+
# You should have received a copy of the GNU Lesser General Public License
|
|
16
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
|
|
18
|
+
require "gettext/tools/parser/gtk_builder_ui_definitions"
|
|
19
|
+
|
|
20
|
+
class TestGtkBuilderUIDefinitionsParser < Test::Unit::TestCase
|
|
21
|
+
include Helper::Parser
|
|
22
|
+
|
|
23
|
+
def parse(file)
|
|
24
|
+
GetText::GtkBuilderUIDefinitionsParser.parse(fixture_path(file))
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def test_all
|
|
28
|
+
assert_parse([
|
|
29
|
+
{
|
|
30
|
+
:msgid => "label with context",
|
|
31
|
+
:msgctxt => "context",
|
|
32
|
+
:references => ["gtk_builder_ui_definitions.ui:19"],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
:msgid => "label simple",
|
|
36
|
+
:references => ["gtk_builder_ui_definitions.ui:31"],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
:msgid => "multiple\n" + "lines\n" + "label",
|
|
40
|
+
:references => ["gtk_builder_ui_definitions.ui:55"],
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
"gtk_builder_ui_definitions.ui")
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
#
|
|
3
3
|
# Copyright (C) 2012 Haruka Yoshihara <yoshihara@clear-code.com>
|
|
4
|
-
# Copyright (C) 2012-
|
|
4
|
+
# Copyright (C) 2012-2020 Sutou Kouhei <kou@clear-code.com>
|
|
5
5
|
# Copyright (C) 2010 masone (Christian Felder) <ema@rh-productions.ch>
|
|
6
6
|
# Copyright (C) 2009 Vladimir Dobriakov <vladimir@geekq.net>
|
|
7
7
|
# Copyright (C) 2009-2010 Masao Mutoh
|
|
@@ -24,49 +24,12 @@
|
|
|
24
24
|
require "gettext/tools/parser/ruby"
|
|
25
25
|
|
|
26
26
|
class TestRubyParser < Test::Unit::TestCase
|
|
27
|
-
include
|
|
27
|
+
include Helper::Parser
|
|
28
28
|
|
|
29
|
-
private
|
|
30
29
|
def parse(file)
|
|
31
30
|
GetText::RubyParser.parse(fixture_path(file))
|
|
32
31
|
end
|
|
33
32
|
|
|
34
|
-
def assert_parse(expected, file)
|
|
35
|
-
assert_equal(normalize_expected(expected),
|
|
36
|
-
normalize_actual(parse(file)))
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def normalize_expected(messages)
|
|
40
|
-
messages.collect do |message|
|
|
41
|
-
default = {
|
|
42
|
-
:msgid => nil,
|
|
43
|
-
:msgid_plural => nil,
|
|
44
|
-
:msgstr => nil,
|
|
45
|
-
:separator => nil,
|
|
46
|
-
:references => nil,
|
|
47
|
-
}
|
|
48
|
-
default.merge(message)
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def normalize_actual(po)
|
|
53
|
-
po.collect do |po_entry|
|
|
54
|
-
{
|
|
55
|
-
:msgid => po_entry.msgid,
|
|
56
|
-
:msgid_plural => po_entry.msgid_plural,
|
|
57
|
-
:msgstr => po_entry.msgstr,
|
|
58
|
-
:separator => po_entry.separator,
|
|
59
|
-
:references => normalize_references(po_entry.references),
|
|
60
|
-
}
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
def normalize_references(references)
|
|
65
|
-
references.collect do |reference|
|
|
66
|
-
reference.sub(/\A#{Regexp.escape(fixture_path)}\//, "")
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
|
70
33
|
class TestDetectEncoding < self
|
|
71
34
|
def test_ascii_and_hyphen
|
|
72
35
|
assert_equal("euc-jp", detect_encoding("# coding: euc-jp"))
|
|
@@ -227,6 +190,30 @@ class TestRubyParser < Test::Unit::TestCase
|
|
|
227
190
|
path)
|
|
228
191
|
end
|
|
229
192
|
|
|
193
|
+
|
|
194
|
+
def test_percent_strings
|
|
195
|
+
path = "percent_strings.rb"
|
|
196
|
+
assert_parse([
|
|
197
|
+
{
|
|
198
|
+
:msgid => "hello world",
|
|
199
|
+
:references => ["#{path}:34"],
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
path)
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
def test_quoted_symbol
|
|
206
|
+
path = "quoted_symbol.rb"
|
|
207
|
+
assert_parse([],
|
|
208
|
+
path)
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
def test_backtick
|
|
212
|
+
path = "backtick.rb"
|
|
213
|
+
assert_parse([],
|
|
214
|
+
path)
|
|
215
|
+
end
|
|
216
|
+
|
|
230
217
|
private
|
|
231
218
|
def fixture_path(*components)
|
|
232
219
|
super("_", *components)
|
data/test/tools/test_msgmerge.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
#
|
|
3
|
-
# Copyright (C) 2012-
|
|
3
|
+
# Copyright (C) 2012-2020 Sutou Kouhei <kou@clear-code.com>
|
|
4
4
|
# Copyright (C) 2010 Eddie Lau <tatonlto@gmail.com>
|
|
5
5
|
#
|
|
6
6
|
# License: Ruby's or LGPL
|
|
@@ -363,7 +363,7 @@ EOC
|
|
|
363
363
|
end
|
|
364
364
|
|
|
365
365
|
class TestCommand < self
|
|
366
|
-
include
|
|
366
|
+
include Helper::Tmpdir
|
|
367
367
|
|
|
368
368
|
def setup
|
|
369
369
|
@msgmerge = GetText::Tools::MsgMerge.new
|
|
@@ -480,7 +480,7 @@ EOP
|
|
|
480
480
|
end
|
|
481
481
|
|
|
482
482
|
class TestMessage < self
|
|
483
|
-
include
|
|
483
|
+
include Helper::Warning
|
|
484
484
|
|
|
485
485
|
def po_content
|
|
486
486
|
<<-PO
|
data/test/tools/test_xgettext.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
#
|
|
3
|
-
# Copyright (C) 2012-
|
|
3
|
+
# Copyright (C) 2012-2020 Sutou Kouhei <kou@clear-code.com>
|
|
4
4
|
# Copyright (C) 2012 Haruka Yoshihara <yoshihara@clear-code.com>
|
|
5
5
|
#
|
|
6
6
|
# License: Ruby's or LGPL
|
|
@@ -22,7 +22,7 @@ require "locale"
|
|
|
22
22
|
require "gettext/tools/xgettext"
|
|
23
23
|
|
|
24
24
|
class TestToolsXGetText < Test::Unit::TestCase
|
|
25
|
-
include
|
|
25
|
+
include Helper::Tmpdir
|
|
26
26
|
|
|
27
27
|
def setup
|
|
28
28
|
@xgettext = GetText::Tools::XGetText.new
|
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.3.
|
|
4
|
+
version: 3.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kouhei Sutou
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2020-01-
|
|
12
|
+
date: 2020-01-11 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: locale
|
|
@@ -145,11 +145,11 @@ email:
|
|
|
145
145
|
- kou@clear-code.com
|
|
146
146
|
- mutomasa at gmail.com
|
|
147
147
|
executables:
|
|
148
|
-
- rmsgfmt
|
|
149
148
|
- rmsgmerge
|
|
149
|
+
- rmsginit
|
|
150
150
|
- rmsgcat
|
|
151
151
|
- rxgettext
|
|
152
|
-
-
|
|
152
|
+
- rmsgfmt
|
|
153
153
|
extensions: []
|
|
154
154
|
extra_rdoc_files: []
|
|
155
155
|
files:
|
|
@@ -185,6 +185,7 @@ files:
|
|
|
185
185
|
- lib/gettext/tools/msgmerge.rb
|
|
186
186
|
- lib/gettext/tools/parser/erb.rb
|
|
187
187
|
- lib/gettext/tools/parser/glade.rb
|
|
188
|
+
- lib/gettext/tools/parser/gtk_builder_ui_definitions.rb
|
|
188
189
|
- lib/gettext/tools/parser/ruby.rb
|
|
189
190
|
- lib/gettext/tools/task.rb
|
|
190
191
|
- lib/gettext/tools/xgettext.rb
|
|
@@ -1513,6 +1514,7 @@ files:
|
|
|
1513
1514
|
- samples/po/zh_TW/hello_tk.po.time_stamp
|
|
1514
1515
|
- src/po_parser.ry
|
|
1515
1516
|
- test/fixtures/_.rb
|
|
1517
|
+
- test/fixtures/_/backtick.rb
|
|
1516
1518
|
- test/fixtures/_/block_parameter.rb
|
|
1517
1519
|
- test/fixtures/_/double_quote_in_double_quote.rb
|
|
1518
1520
|
- test/fixtures/_/double_quote_in_single_quote.rb
|
|
@@ -1523,11 +1525,14 @@ files:
|
|
|
1523
1525
|
- test/fixtures/_/multiple_same_messages.rb
|
|
1524
1526
|
- test/fixtures/_/one_line.rb
|
|
1525
1527
|
- test/fixtures/_/one_new_line.rb
|
|
1528
|
+
- test/fixtures/_/percent_strings.rb
|
|
1529
|
+
- test/fixtures/_/quoted_symbol.rb
|
|
1526
1530
|
- test/fixtures/backslash.rb
|
|
1527
1531
|
- test/fixtures/erb/ascii.rhtml
|
|
1528
1532
|
- test/fixtures/erb/ascii.rxml
|
|
1529
1533
|
- test/fixtures/erb/non_ascii.rhtml
|
|
1530
1534
|
- test/fixtures/gladeparser.glade
|
|
1535
|
+
- test/fixtures/gtk_builder_ui_definitions.ui
|
|
1531
1536
|
- test/fixtures/hello.rb
|
|
1532
1537
|
- test/fixtures/lower_n_.rb
|
|
1533
1538
|
- test/fixtures/multi_text_domain.rb
|
|
@@ -1541,7 +1546,7 @@ files:
|
|
|
1541
1546
|
- test/fixtures/simple.rb
|
|
1542
1547
|
- test/fixtures/untranslated.rb
|
|
1543
1548
|
- test/fixtures/upper_n_.rb
|
|
1544
|
-
- test/
|
|
1549
|
+
- test/helper.rb
|
|
1545
1550
|
- test/locale/cr/LC_MESSAGES/plural.mo
|
|
1546
1551
|
- test/locale/da/LC_MESSAGES/plural.mo
|
|
1547
1552
|
- test/locale/da/LC_MESSAGES/plural_error.mo
|
|
@@ -1652,6 +1657,7 @@ files:
|
|
|
1652
1657
|
- test/tools/files/simple_2.po
|
|
1653
1658
|
- test/tools/files/simple_translation.rb
|
|
1654
1659
|
- test/tools/files/version.po
|
|
1660
|
+
- test/tools/parser/test_gtk_builder_ui_definitions.rb
|
|
1655
1661
|
- test/tools/parser/test_ruby.rb
|
|
1656
1662
|
- test/tools/test.pot
|
|
1657
1663
|
- test/tools/test_msgcat.rb
|
|
@@ -1685,16 +1691,16 @@ specification_version: 4
|
|
|
1685
1691
|
summary: Gettext is a pure Ruby libary and tools to localize messages.
|
|
1686
1692
|
test_files:
|
|
1687
1693
|
- test/test_mo.rb
|
|
1688
|
-
- test/
|
|
1689
|
-
- test/test_locale_path.rb
|
|
1690
|
-
- test/test_text_domain_bind.rb
|
|
1691
|
-
- test/test_po_entry.rb
|
|
1694
|
+
- test/test_parser.rb
|
|
1692
1695
|
- test/test_po_parser.rb
|
|
1693
|
-
- test/
|
|
1694
|
-
- test/test_string.rb
|
|
1695
|
-
- test/test_gettext.rb
|
|
1696
|
+
- test/test_text_domain_bind.rb
|
|
1696
1697
|
- test/test_text_domain.rb
|
|
1697
|
-
- test/
|
|
1698
|
-
- test/
|
|
1698
|
+
- test/test_string.rb
|
|
1699
|
+
- test/test_locale_path.rb
|
|
1699
1700
|
- test/test_thread.rb
|
|
1700
1701
|
- test/test_class_info.rb
|
|
1702
|
+
- test/test_text_domain_multi.rb
|
|
1703
|
+
- test/test_po_entry.rb
|
|
1704
|
+
- test/test_gettext.rb
|
|
1705
|
+
- test/test_text_domain_toplevel.rb
|
|
1706
|
+
- test/test_po.rb
|