gettext 3.2.9 → 3.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +276 -198
- data/Rakefile +7 -4
- data/doc/text/news.md +451 -0
- data/gettext.gemspec +10 -7
- data/lib/gettext/locale_path.rb +17 -9
- data/lib/gettext/mo.rb +12 -19
- data/lib/gettext/po.rb +4 -4
- data/lib/gettext/po_entry.rb +47 -27
- data/lib/gettext/po_parser.rb +65 -59
- data/lib/gettext/text_domain.rb +1 -1
- data/lib/gettext/text_domain_manager.rb +6 -5
- data/lib/gettext/tools/msgcat.rb +9 -2
- data/lib/gettext/tools/msginit.rb +226 -54
- data/lib/gettext/tools/msgmerge.rb +24 -6
- data/lib/gettext/tools/parser/erb.rb +9 -1
- data/lib/gettext/tools/parser/erubi.rb +88 -0
- data/lib/gettext/tools/parser/glade.rb +38 -40
- data/lib/gettext/tools/parser/gtk_builder_ui_definitions.rb +129 -0
- data/lib/gettext/tools/parser/ruby.rb +288 -221
- data/lib/gettext/tools/task.rb +4 -5
- data/lib/gettext/tools/xgettext.rb +21 -10
- data/lib/gettext/version.rb +3 -3
- 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/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.edit.po +81 -572
- data/po/bg/gettext.po +7 -409
- data/po/bs/gettext.edit.po +81 -572
- data/po/bs/gettext.po +7 -409
- data/po/ca/gettext.edit.po +81 -572
- data/po/ca/gettext.po +7 -409
- data/po/cs/gettext.edit.po +81 -572
- data/po/cs/gettext.po +7 -409
- data/po/de/gettext.edit.po +81 -572
- data/po/de/gettext.po +7 -409
- data/po/el/gettext.edit.po +81 -572
- data/po/el/gettext.po +7 -409
- data/po/eo/gettext.edit.po +81 -572
- data/po/eo/gettext.po +7 -409
- data/po/es/gettext.edit.po +81 -572
- data/po/es/gettext.po +7 -409
- data/po/et/gettext.edit.po +81 -572
- data/po/et/gettext.po +7 -409
- data/po/fr/gettext.edit.po +81 -572
- data/po/fr/gettext.po +7 -409
- data/po/gettext.pot +93 -645
- data/po/hr/gettext.edit.po +81 -572
- data/po/hr/gettext.po +7 -409
- data/po/hu/gettext.edit.po +81 -572
- data/po/hu/gettext.po +7 -409
- data/po/it/gettext.edit.po +81 -572
- data/po/it/gettext.po +7 -409
- data/po/ja/gettext.edit.po +83 -574
- data/po/ja/gettext.po +9 -411
- data/po/ko/gettext.edit.po +81 -572
- data/po/ko/gettext.po +7 -409
- data/po/lv/gettext.edit.po +81 -572
- data/po/lv/gettext.po +7 -409
- data/po/nb/gettext.edit.po +81 -572
- data/po/nb/gettext.po +7 -409
- data/po/nl/gettext.edit.po +81 -572
- data/po/nl/gettext.po +7 -409
- data/po/pt_BR/gettext.edit.po +81 -572
- data/po/pt_BR/gettext.po +7 -409
- data/po/ru/gettext.edit.po +81 -572
- data/po/ru/gettext.po +7 -409
- data/po/sr/gettext.edit.po +81 -572
- data/po/sr/gettext.po +7 -409
- data/po/sv/gettext.edit.po +81 -572
- data/po/sv/gettext.po +7 -409
- data/po/uk/gettext.edit.po +81 -572
- data/po/uk/gettext.po +7 -409
- data/po/vi/gettext.edit.po +81 -572
- data/po/vi/gettext.po +7 -409
- data/po/zh/gettext.edit.po +81 -572
- data/po/zh/gettext.po +7 -409
- data/po/zh_TW/gettext.edit.po +81 -572
- data/po/zh_TW/gettext.po +7 -409
- 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/bg/hello_gtk_builder.edit.po +15 -0
- data/samples/po/bg/hello_gtk_builder.po +12 -0
- data/samples/po/bs/hello_gtk_builder.edit.po +15 -0
- data/samples/po/bs/hello_gtk_builder.po +12 -0
- data/samples/po/ca/hello_gtk_builder.edit.po +15 -0
- data/samples/po/ca/hello_gtk_builder.po +12 -0
- data/samples/po/cs/hello_gtk_builder.edit.po +15 -0
- data/samples/po/cs/hello_gtk_builder.po +12 -0
- data/samples/po/de/hello_gtk_builder.edit.po +15 -0
- data/samples/po/de/hello_gtk_builder.po +12 -0
- data/samples/po/el/hello_gtk_builder.edit.po +15 -0
- data/samples/po/el/hello_gtk_builder.po +12 -0
- data/samples/po/eo/hello_gtk_builder.edit.po +15 -0
- data/samples/po/eo/hello_gtk_builder.po +12 -0
- data/samples/po/es/hello_gtk_builder.edit.po +15 -0
- data/samples/po/es/hello_gtk_builder.po +12 -0
- data/samples/po/fr/hello_gtk_builder.edit.po +15 -0
- data/samples/po/fr/hello_gtk_builder.po +12 -0
- data/samples/po/hello.pot +3 -3
- data/samples/po/hello2.pot +4 -4
- data/samples/po/hello_glade2.pot +8 -5
- data/samples/po/hello_gtk2.pot +4 -4
- data/samples/po/hello_gtk_builder.pot +18 -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/samples/po/hr/hello_gtk_builder.edit.po +15 -0
- data/samples/po/hr/hello_gtk_builder.po +12 -0
- data/samples/po/hu/hello_gtk_builder.edit.po +15 -0
- data/samples/po/hu/hello_gtk_builder.po +12 -0
- data/samples/po/it/hello_gtk_builder.edit.po +15 -0
- data/samples/po/it/hello_gtk_builder.po +12 -0
- data/samples/po/ja/hello_gtk_builder.edit.po +15 -0
- data/samples/po/ja/hello_gtk_builder.po +12 -0
- data/samples/po/ko/hello_gtk_builder.edit.po +15 -0
- data/samples/po/ko/hello_gtk_builder.po +12 -0
- data/samples/po/lv/hello_gtk_builder.edit.po +15 -0
- data/samples/po/lv/hello_gtk_builder.po +12 -0
- data/samples/po/nb/hello_gtk_builder.edit.po +15 -0
- data/samples/po/nb/hello_gtk_builder.po +12 -0
- data/samples/po/nl/hello_gtk_builder.edit.po +15 -0
- data/samples/po/nl/hello_gtk_builder.po +12 -0
- data/samples/po/pt_BR/hello_gtk_builder.edit.po +15 -0
- data/samples/po/pt_BR/hello_gtk_builder.po +12 -0
- data/samples/po/ru/hello_gtk_builder.edit.po +15 -0
- data/samples/po/ru/hello_gtk_builder.po +12 -0
- data/samples/po/sr/hello_gtk_builder.edit.po +15 -0
- data/samples/po/sr/hello_gtk_builder.po +12 -0
- data/samples/po/sv/hello_gtk_builder.edit.po +15 -0
- data/samples/po/sv/hello_gtk_builder.po +12 -0
- data/samples/po/uk/hello_gtk_builder.edit.po +15 -0
- data/samples/po/uk/hello_gtk_builder.po +12 -0
- data/samples/po/vi/hello_gtk_builder.edit.po +15 -0
- data/samples/po/vi/hello_gtk_builder.po +12 -0
- data/samples/po/zh/hello_gtk_builder.edit.po +15 -0
- data/samples/po/zh/hello_gtk_builder.po +12 -0
- data/samples/po/zh_TW/hello_gtk_builder.edit.po +15 -0
- data/samples/po/zh_TW/hello_gtk_builder.po +12 -0
- data/src/po_parser.ry +48 -42
- 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/fixtures/_/percent_strings.rb +55 -0
- data/test/fixtures/_/pipe.rb +32 -0
- data/test/{gettext-test-utils.rb → fixtures/_/quoted_symbol.rb} +13 -23
- data/test/fixtures/_.rb +10 -1
- data/test/fixtures/erb/case.rhtml +16 -0
- data/test/fixtures/erb/minus.rhtml +12 -0
- data/test/fixtures/erb/non_ascii.rhtml +1 -0
- data/test/fixtures/glade/3.glade +63 -0
- data/test/fixtures/gtk_builder_ui_definitions.ui +68 -0
- data/test/fixtures/multi_text_domain.rb +12 -12
- data/test/fixtures/np_.rb +1 -1
- data/test/fixtures/ns_/custom.rb +2 -2
- data/test/fixtures/ns_.rb +1 -1
- data/test/fixtures/p_.rb +1 -1
- data/test/fixtures/ruby/percent_lower_i.rb +1 -0
- data/test/fixtures/ruby/percent_lower_w.rb +1 -0
- data/test/fixtures/ruby/percent_upper_i.rb +1 -0
- data/test/fixtures/ruby/percent_upper_w.rb +1 -0
- data/test/fixtures/s_/custom.rb +2 -2
- data/test/fixtures/s_.rb +1 -1
- data/test/fixtures/simple.rb +5 -1
- data/test/fixtures/upper_nn_.rb +77 -0
- data/test/helper.rb +99 -0
- data/test/locale/fr/LC_MESSAGES/plural_error.mo +0 -0
- data/test/locale/fr/LC_MESSAGES/test1.mo +0 -0
- data/test/locale/fr_BE/LC_MESSAGES/test1.mo +0 -0
- data/test/locale/fr_BE_Foo/LC_MESSAGES/test1.mo +0 -0
- data/test/locale/ja/LC_MESSAGES/_.mo +0 -0
- data/test/po/_.pot +28 -4
- data/test/po/backslash.pot +6 -4
- data/test/po/fr/plural_error.po +7 -0
- data/test/po/fr/test1.po +7 -0
- data/test/po/fr_BE/test1.po +24 -0
- data/test/po/fr_BE_Foo/test1.po +20 -0
- data/test/po/hello.pot +3 -3
- data/test/po/ja/_.edit.po +27 -3
- data/test/po/ja/_.po +20 -2
- data/test/po/ja/hello.edit.po +0 -1
- data/test/po/non_ascii.pot +4 -4
- data/test/po/np_.pot +8 -5
- data/test/po/ns_.pot +6 -4
- data/test/po/p_.pot +3 -3
- data/test/po/s_.pot +6 -4
- data/test/po/untranslated.pot +4 -4
- data/test/run-test.rb +2 -3
- data/test/test_class_info.rb +8 -9
- data/test/test_gettext.rb +30 -1
- data/test/test_locale_path.rb +12 -4
- data/test/test_parser.rb +113 -25
- data/test/test_po_entry.rb +21 -17
- data/test/test_po_parser.rb +49 -4
- data/test/test_string.rb +9 -5
- data/test/tools/parser/test_glade.rb +91 -0
- data/test/tools/parser/test_gtk_builder_ui_definitions.rb +63 -0
- data/test/tools/parser/test_ruby.rb +76 -39
- data/test/tools/test_msgcat.rb +21 -1
- data/test/tools/test_msginit.rb +82 -3
- data/test/tools/test_msgmerge.rb +81 -6
- data/test/tools/test_xgettext.rb +106 -5
- metadata +82 -34
- data/lib/gettext/tools/parser/haml.rb +0 -61
- /data/test/fixtures/{gladeparser.glade → glade/2.glade} +0 -0
data/test/po/_.pot
CHANGED
@@ -6,10 +6,10 @@
|
|
6
6
|
#, fuzzy
|
7
7
|
msgid ""
|
8
8
|
msgstr ""
|
9
|
-
"Project-Id-Version: _ 3.
|
9
|
+
"Project-Id-Version: _ 3.4.4\n"
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
11
|
-
"POT-Creation-Date:
|
12
|
-
"PO-Revision-Date:
|
11
|
+
"POT-Creation-Date: 2023-06-11 06:20+0900\n"
|
12
|
+
"PO-Revision-Date: 2023-06-11 06:20+0900\n"
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15
15
|
"Language: \n"
|
@@ -83,7 +83,7 @@ msgid "#"
|
|
83
83
|
msgstr ""
|
84
84
|
|
85
85
|
#: ../fixtures/_.rb:96
|
86
|
-
msgid "\\taaa"
|
86
|
+
msgid "\\taaa'bbb\\ccc"
|
87
87
|
msgstr ""
|
88
88
|
|
89
89
|
#: ../fixtures/_.rb:100
|
@@ -92,6 +92,10 @@ msgid ""
|
|
92
92
|
"Here document2\n"
|
93
93
|
msgstr ""
|
94
94
|
|
95
|
+
#: ../fixtures/_.rb:109
|
96
|
+
msgid "in_quote"
|
97
|
+
msgstr ""
|
98
|
+
|
95
99
|
#. TRANSLATORS: This is a proper name. See the gettext
|
96
100
|
#. manual, section Names. Note this is actually a non-ASCII
|
97
101
|
#. name: The first name is (with Unicode escapes)
|
@@ -160,3 +164,23 @@ msgstr ""
|
|
160
164
|
msgid ""
|
161
165
|
"one new line\n"
|
162
166
|
msgstr ""
|
167
|
+
|
168
|
+
#: ../fixtures/_/percent_strings.rb:31
|
169
|
+
msgid "in_symbol_array"
|
170
|
+
msgstr ""
|
171
|
+
|
172
|
+
#: ../fixtures/_/percent_strings.rb:39
|
173
|
+
msgid "hello world"
|
174
|
+
msgstr ""
|
175
|
+
|
176
|
+
#: ../fixtures/_/percent_strings.rb:47
|
177
|
+
msgid "in_string_array"
|
178
|
+
msgstr ""
|
179
|
+
|
180
|
+
#: ../fixtures/_/pipe.rb:26
|
181
|
+
msgid "Hello"
|
182
|
+
msgstr ""
|
183
|
+
|
184
|
+
#: ../fixtures/_/pipe.rb:28
|
185
|
+
msgid "World"
|
186
|
+
msgstr ""
|
data/test/po/backslash.pot
CHANGED
@@ -1,16 +1,18 @@
|
|
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 backslash 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
|
-
"
|
9
|
+
"Project-Id-Version: backslash 3.4.4\n"
|
10
|
+
"Report-Msgid-Bugs-To: \n"
|
11
|
+
"POT-Creation-Date: 2023-06-11 06:20+0900\n"
|
12
|
+
"PO-Revision-Date: 2023-06-11 06:20+0900\n"
|
12
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15
|
+
"Language: \n"
|
14
16
|
"MIME-Version: 1.0\n"
|
15
17
|
"Content-Type: text/plain; charset=UTF-8\n"
|
16
18
|
"Content-Transfer-Encoding: 8bit\n"
|
data/test/po/fr/plural_error.po
CHANGED
@@ -13,8 +13,15 @@ msgstr ""
|
|
13
13
|
"MIME-Version: 1.0\n"
|
14
14
|
"Content-Type: text/plain; charset=US-ASCII\n"
|
15
15
|
"Content-Transfer-Encoding: ENCODING\n"
|
16
|
+
"Plural-Forms: nplurals=2; plural=n>1;\n"
|
16
17
|
|
17
18
|
#: hello_plural.rb:11
|
18
19
|
msgid "first"
|
19
20
|
msgid_plural "second"
|
20
21
|
msgstr[0] "fr_first"
|
22
|
+
|
23
|
+
#: hello_plural.rb:14
|
24
|
+
msgid "first_2"
|
25
|
+
msgid_plural "second_2"
|
26
|
+
msgstr[0] "fr_first_2"
|
27
|
+
msgstr[1] ""
|
data/test/po/fr/test1.po
CHANGED
@@ -13,6 +13,7 @@ msgstr ""
|
|
13
13
|
"MIME-Version: 1.0\n"
|
14
14
|
"Content-Type: text/plain; charset=utf-8\n"
|
15
15
|
"Content-Transfer-Encoding: ENCODING\n"
|
16
|
+
"Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n"
|
16
17
|
|
17
18
|
#: simple.rb:10
|
18
19
|
msgid "language"
|
@@ -21,3 +22,9 @@ msgstr "french"
|
|
21
22
|
#: simple.rb:14
|
22
23
|
msgid "one is %d."
|
23
24
|
msgstr "FRENCH:ONE IS %d."
|
25
|
+
|
26
|
+
#: simple.rb:18
|
27
|
+
msgid "There is an apple."
|
28
|
+
msgid_plural "There are %{num} apples."
|
29
|
+
msgstr[0] "FRENCH:Il y a une pomme."
|
30
|
+
msgstr[1] "FRENCH:Il y a %{num} pommes."
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# SOME DESCRIPTIVE TITLE.
|
2
|
+
# Copyright (C) YEAR ORGANIZATION
|
3
|
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
4
|
+
#
|
5
|
+
#, fuzzy
|
6
|
+
msgid ""
|
7
|
+
msgstr ""
|
8
|
+
"Project-Id-Version: PACKAGE VERSION\n"
|
9
|
+
"POT-Creation-Date: 2002-01-01 02:24:56+0900\n"
|
10
|
+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
11
|
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
12
|
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
13
|
+
"MIME-Version: 1.0\n"
|
14
|
+
"Content-Type: text/plain; charset=utf-8\n"
|
15
|
+
"Content-Transfer-Encoding: ENCODING\n"
|
16
|
+
"Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n"
|
17
|
+
|
18
|
+
#: simple.rb:10
|
19
|
+
msgid "language"
|
20
|
+
msgstr "french-Belgium"
|
21
|
+
|
22
|
+
#: simple.rb:14
|
23
|
+
msgid "one is %d."
|
24
|
+
msgstr "FRENCH-BELGIUM:ONE IS %d."
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# SOME DESCRIPTIVE TITLE.
|
2
|
+
# Copyright (C) YEAR ORGANIZATION
|
3
|
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
4
|
+
#
|
5
|
+
#, fuzzy
|
6
|
+
msgid ""
|
7
|
+
msgstr ""
|
8
|
+
"Project-Id-Version: PACKAGE VERSION\n"
|
9
|
+
"POT-Creation-Date: 2002-01-01 02:24:56+0900\n"
|
10
|
+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
11
|
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
12
|
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
13
|
+
"MIME-Version: 1.0\n"
|
14
|
+
"Content-Type: text/plain; charset=utf-8\n"
|
15
|
+
"Content-Transfer-Encoding: ENCODING\n"
|
16
|
+
"Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n"
|
17
|
+
|
18
|
+
#: simple.rb:10
|
19
|
+
msgid "language"
|
20
|
+
msgstr "french-Belgium-Foo"
|
data/test/po/hello.pot
CHANGED
@@ -6,10 +6,10 @@
|
|
6
6
|
#, fuzzy
|
7
7
|
msgid ""
|
8
8
|
msgstr ""
|
9
|
-
"Project-Id-Version: hello 3.
|
9
|
+
"Project-Id-Version: hello 3.4.4\n"
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
11
|
-
"POT-Creation-Date:
|
12
|
-
"PO-Revision-Date:
|
11
|
+
"POT-Creation-Date: 2023-06-11 06:20+0900\n"
|
12
|
+
"PO-Revision-Date: 2023-06-11 06:20+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/ja/_.edit.po
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
msgid ""
|
6
6
|
msgstr ""
|
7
7
|
"Project-Id-Version: PACKAGE VERSION\n"
|
8
|
-
"PO-Revision-Date:
|
8
|
+
"PO-Revision-Date: 2023-10-22 06:37+0900\n"
|
9
9
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
10
10
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
11
11
|
"MIME-Version: 1.0\n"
|
@@ -84,8 +84,8 @@ msgid "#"
|
|
84
84
|
msgstr ""
|
85
85
|
|
86
86
|
#: ../fixtures/_.rb:96
|
87
|
-
msgid "
|
88
|
-
msgstr ""
|
87
|
+
msgid "\\taaa'bbb\\ccc"
|
88
|
+
msgstr "AAA"
|
89
89
|
|
90
90
|
#: ../fixtures/_.rb:100
|
91
91
|
msgid ""
|
@@ -93,6 +93,10 @@ msgid ""
|
|
93
93
|
"Here document2\n"
|
94
94
|
msgstr ""
|
95
95
|
|
96
|
+
#: ../fixtures/_.rb:109
|
97
|
+
msgid "in_quote"
|
98
|
+
msgstr ""
|
99
|
+
|
96
100
|
#. TRANSLATORS: This is a proper name. See the gettext
|
97
101
|
#. manual, section Names. Note this is actually a non-ASCII
|
98
102
|
#. name: The first name is (with Unicode escapes)
|
@@ -160,3 +164,23 @@ msgstr "ONE LINE"
|
|
160
164
|
msgid ""
|
161
165
|
"one new line\n"
|
162
166
|
msgstr ""
|
167
|
+
|
168
|
+
#: ../fixtures/_/percent_strings.rb:31
|
169
|
+
msgid "in_symbol_array"
|
170
|
+
msgstr ""
|
171
|
+
|
172
|
+
#: ../fixtures/_/percent_strings.rb:39
|
173
|
+
msgid "hello world"
|
174
|
+
msgstr ""
|
175
|
+
|
176
|
+
#: ../fixtures/_/percent_strings.rb:47
|
177
|
+
msgid "in_string_array"
|
178
|
+
msgstr ""
|
179
|
+
|
180
|
+
#: ../fixtures/_/pipe.rb:26
|
181
|
+
msgid "Hello"
|
182
|
+
msgstr ""
|
183
|
+
|
184
|
+
#: ../fixtures/_/pipe.rb:28
|
185
|
+
msgid "World"
|
186
|
+
msgstr ""
|
data/test/po/ja/_.po
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
msgid ""
|
6
6
|
msgstr ""
|
7
7
|
"Project-Id-Version: PACKAGE VERSION\n"
|
8
|
-
"PO-Revision-Date:
|
8
|
+
"PO-Revision-Date: 2018-06-17 07:37+0900\n"
|
9
9
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
10
10
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
11
11
|
"MIME-Version: 1.0\n"
|
@@ -69,7 +69,7 @@ msgstr ""
|
|
69
69
|
msgid "#"
|
70
70
|
msgstr ""
|
71
71
|
|
72
|
-
msgid "\taaa"
|
72
|
+
msgid "\taaa'bbb\\ccc"
|
73
73
|
msgstr ""
|
74
74
|
|
75
75
|
msgid ""
|
@@ -77,6 +77,9 @@ msgid ""
|
|
77
77
|
"Here document2\n"
|
78
78
|
msgstr ""
|
79
79
|
|
80
|
+
msgid "in_quote"
|
81
|
+
msgstr ""
|
82
|
+
|
80
83
|
#. TRANSLATORS: This is a proper name. See the gettext
|
81
84
|
#. manual, section Names. Note this is actually a non-ASCII
|
82
85
|
#. name: The first name is (with Unicode escapes)
|
@@ -130,3 +133,18 @@ msgstr "ONE LINE"
|
|
130
133
|
msgid ""
|
131
134
|
"one new line\n"
|
132
135
|
msgstr ""
|
136
|
+
|
137
|
+
msgid "in_symbol_array"
|
138
|
+
msgstr ""
|
139
|
+
|
140
|
+
msgid "hello world"
|
141
|
+
msgstr ""
|
142
|
+
|
143
|
+
msgid "in_string_array"
|
144
|
+
msgstr ""
|
145
|
+
|
146
|
+
msgid "Hello"
|
147
|
+
msgstr ""
|
148
|
+
|
149
|
+
msgid "World"
|
150
|
+
msgstr ""
|
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 non_ascii 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: non_ascii 3.4.4\n"
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
11
|
-
"POT-Creation-Date:
|
12
|
-
"PO-Revision-Date:
|
11
|
+
"POT-Creation-Date: 2023-06-11 06:20+0900\n"
|
12
|
+
"PO-Revision-Date: 2023-06-11 06:20+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,22 +1,25 @@
|
|
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 np_ 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
|
-
"
|
9
|
+
"Project-Id-Version: np_ 3.4.4\n"
|
10
|
+
"Report-Msgid-Bugs-To: \n"
|
11
|
+
"POT-Creation-Date: 2023-06-11 06:20+0900\n"
|
12
|
+
"PO-Revision-Date: 2023-06-11 06:20+0900\n"
|
12
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15
|
+
"Language: \n"
|
14
16
|
"MIME-Version: 1.0\n"
|
15
17
|
"Content-Type: text/plain; charset=UTF-8\n"
|
16
18
|
"Content-Transfer-Encoding: 8bit\n"
|
17
19
|
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
18
20
|
|
19
|
-
#: ../fixtures/np_.rb:28 ../fixtures/np_.rb:29 ../fixtures/np_.rb:33
|
21
|
+
#: ../fixtures/np_.rb:28 ../fixtures/np_.rb:29 ../fixtures/np_.rb:33
|
22
|
+
#: ../fixtures/np_.rb:34
|
20
23
|
msgctxt "Magazine"
|
21
24
|
msgid "a book"
|
22
25
|
msgid_plural "%{num} books"
|
data/test/po/ns_.pot
CHANGED
@@ -1,16 +1,18 @@
|
|
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 ns_ 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
|
-
"
|
9
|
+
"Project-Id-Version: ns_ 3.4.4\n"
|
10
|
+
"Report-Msgid-Bugs-To: \n"
|
11
|
+
"POT-Creation-Date: 2023-06-11 06:20+0900\n"
|
12
|
+
"PO-Revision-Date: 2023-06-11 06:20+0900\n"
|
12
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15
|
+
"Language: \n"
|
14
16
|
"MIME-Version: 1.0\n"
|
15
17
|
"Content-Type: text/plain; charset=UTF-8\n"
|
16
18
|
"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.4.4\n"
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
11
|
-
"POT-Creation-Date:
|
12
|
-
"PO-Revision-Date:
|
11
|
+
"POT-Creation-Date: 2023-06-11 06:20+0900\n"
|
12
|
+
"PO-Revision-Date: 2023-06-11 06:20+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,16 +1,18 @@
|
|
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 s_ 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
|
-
"
|
9
|
+
"Project-Id-Version: s_ 3.4.4\n"
|
10
|
+
"Report-Msgid-Bugs-To: \n"
|
11
|
+
"POT-Creation-Date: 2023-06-11 06:20+0900\n"
|
12
|
+
"PO-Revision-Date: 2023-06-11 06:20+0900\n"
|
12
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15
|
+
"Language: \n"
|
14
16
|
"MIME-Version: 1.0\n"
|
15
17
|
"Content-Type: text/plain; charset=UTF-8\n"
|
16
18
|
"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 untranslated 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: untranslated 3.4.4\n"
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
11
|
-
"POT-Creation-Date:
|
12
|
-
"PO-Revision-Date:
|
11
|
+
"POT-Creation-Date: 2023-06-11 06:20+0900\n"
|
12
|
+
"PO-Revision-Date: 2023-06-11 06:20+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
|
#
|
@@ -29,10 +29,9 @@ $LOAD_PATH.unshift(lib_dir)
|
|
29
29
|
$LOAD_PATH.unshift(test_dir)
|
30
30
|
|
31
31
|
require "test-unit"
|
32
|
-
require "test/unit/notify"
|
33
32
|
require "test/unit/rr"
|
34
33
|
|
35
|
-
require "
|
34
|
+
require "helper"
|
36
35
|
|
37
36
|
Dir.chdir(test_dir) do
|
38
37
|
Dir.glob("**/test_*.rb").each do |test_file_path|
|
data/test/test_class_info.rb
CHANGED
@@ -30,11 +30,6 @@ module M8
|
|
30
30
|
include M9
|
31
31
|
end
|
32
32
|
|
33
|
-
# Anonymous module
|
34
|
-
@@anon = Module.new
|
35
|
-
class @@anon::AC1; end
|
36
|
-
module @@anon::AM1; end
|
37
|
-
|
38
33
|
module TestClassInfoSandbox
|
39
34
|
class << self
|
40
35
|
def clear
|
@@ -57,11 +52,15 @@ class TestClassInfo < Test::Unit::TestCase
|
|
57
52
|
assert_equal TestClassInfo, normalize_class(self)
|
58
53
|
end
|
59
54
|
|
55
|
+
@@anonymous_module = Module.new
|
56
|
+
class @@anonymous_module::AC1; end
|
57
|
+
module @@anonymous_module::AM1; end
|
58
|
+
|
60
59
|
def test_normalize_class_anonymous_module
|
61
|
-
assert_equal Object, normalize_class(@@
|
62
|
-
assert_equal Object, normalize_class(@@
|
63
|
-
assert_equal Object, normalize_class(@@
|
64
|
-
assert_equal Object, normalize_class(@@
|
60
|
+
assert_equal Object, normalize_class(@@anonymous_module)
|
61
|
+
assert_equal Object, normalize_class(@@anonymous_module)
|
62
|
+
assert_equal Object, normalize_class(@@anonymous_module::AC1)
|
63
|
+
assert_equal Object, normalize_class(@@anonymous_module::AM1)
|
65
64
|
end
|
66
65
|
|
67
66
|
def test_related_classes
|
data/test/test_gettext.rb
CHANGED
@@ -59,6 +59,29 @@ class TestGetText < Test::Unit::TestCase
|
|
59
59
|
assert_equal("nomsgstr", _("nomsgstr"))
|
60
60
|
end
|
61
61
|
|
62
|
+
def test_fallbacks
|
63
|
+
bindtextdomain("test1", "locale")
|
64
|
+
test = Simple.new
|
65
|
+
|
66
|
+
# Translation present in all candidates
|
67
|
+
GetText.set_current_locale("fr_BE_Foo")
|
68
|
+
assert_equal("french-Belgium-Foo", test.test)
|
69
|
+
GetText.set_current_locale("fr_BE")
|
70
|
+
assert_equal("french-Belgium", test.test)
|
71
|
+
GetText.set_current_locale("fr")
|
72
|
+
assert_equal("french", test.test)
|
73
|
+
|
74
|
+
# Translation Missing in fr_BE_Foo (fallback to fr_BE)
|
75
|
+
GetText.set_current_locale("fr_BE_Foo")
|
76
|
+
assert_equal("FRENCH-BELGIUM:ONE IS 1.", test.test_formatted_string)
|
77
|
+
|
78
|
+
# Translation Missing in fr_BE_Foo *and* fr_BE (both languages fallback to fr)
|
79
|
+
GetText.set_current_locale("fr_BE_Foo")
|
80
|
+
assert_equal("FRENCH:Il y a 5 pommes.", test.test_plural)
|
81
|
+
GetText.set_current_locale("fr_BE")
|
82
|
+
assert_equal("FRENCH:Il y a 5 pommes.", test.test_plural)
|
83
|
+
end
|
84
|
+
|
62
85
|
def test_empty
|
63
86
|
bindtextdomain("test1", "locale")
|
64
87
|
assert_equal("japanese", gettext("language"))
|
@@ -235,7 +258,10 @@ DDD
|
|
235
258
|
set_locale("fr")
|
236
259
|
assert_equal("fr_first", n_("first", "second", 0))
|
237
260
|
assert_equal("fr_first", n_("first", "second", 1))
|
238
|
-
assert_equal("fr_first", n_("first", "second", 2))
|
261
|
+
assert_equal("fr_first", n_("first", "second", 2)) # no translation
|
262
|
+
assert_equal("fr_first_2", n_("first_2", "second_2", 0))
|
263
|
+
assert_equal("fr_first_2", n_("first_2", "second_2", 1))
|
264
|
+
assert_equal("", n_("first_2", "second_2", 2)) # empty translation
|
239
265
|
set_locale("da") # Invalid Plural-Forms.
|
240
266
|
assert_equal("da_first", n_("first", "second", 0))
|
241
267
|
assert_equal("da_first", n_("first", "second", 1))
|
@@ -352,6 +378,9 @@ DDD
|
|
352
378
|
end
|
353
379
|
|
354
380
|
def test_safe_mode
|
381
|
+
if RUBY_VERSION >= "2.6.0"
|
382
|
+
omit("Per thread $SAFE is removed since Ruby 2.6.")
|
383
|
+
end
|
355
384
|
Thread.start{
|
356
385
|
$SAFE = 1
|
357
386
|
GetText.bindtextdomain("test1", :path => "locale")
|
data/test/test_locale_path.rb
CHANGED
@@ -53,9 +53,11 @@ class TestLocalePath < Test::Unit::TestCase
|
|
53
53
|
testdir = File.dirname(File.expand_path(__FILE__))
|
54
54
|
path = GetText::LocalePath.new("test1", "#{testdir}/locale")
|
55
55
|
assert_equal({
|
56
|
-
"ja"
|
57
|
-
"fr"
|
58
|
-
"
|
56
|
+
"ja" => "#{testdir}/locale/ja/LC_MESSAGES/test1.mo",
|
57
|
+
"fr" => "#{testdir}/locale/fr/LC_MESSAGES/test1.mo",
|
58
|
+
"fr_BE" => "#{testdir}/locale/fr_BE/LC_MESSAGES/test1.mo",
|
59
|
+
"fr_BE_Foo" => "#{testdir}/locale/fr_BE_Foo/LC_MESSAGES/test1.mo",
|
60
|
+
"zh_Hant" => "#{testdir}/locale/zh_Hant/LC_MESSAGES/test1.mo"
|
59
61
|
},
|
60
62
|
path.locale_paths)
|
61
63
|
assert_equal("#{testdir}/locale/ja/LC_MESSAGES/test1.mo",
|
@@ -66,6 +68,12 @@ class TestLocalePath < Test::Unit::TestCase
|
|
66
68
|
path.current_path(Locale::Tag.parse("ja_JP.UTF-8")))
|
67
69
|
assert_equal(nil,
|
68
70
|
path.current_path(Locale::Tag.parse("en")))
|
71
|
+
assert_equal("#{testdir}/locale/fr/LC_MESSAGES/test1.mo",
|
72
|
+
path.current_path(Locale::Tag.parse("fr")))
|
73
|
+
assert_equal("#{testdir}/locale/fr_BE/LC_MESSAGES/test1.mo",
|
74
|
+
path.current_path(Locale::Tag.parse("fr-BE")))
|
75
|
+
assert_equal("#{testdir}/locale/fr_BE_Foo/LC_MESSAGES/test1.mo",
|
76
|
+
path.current_path(Locale::Tag.parse("fr-BE-Foo")))
|
69
77
|
assert_equal("#{testdir}/locale/zh_Hant/LC_MESSAGES/test1.mo",
|
70
78
|
path.current_path(Locale::Tag.parse("zh-Hant")))
|
71
79
|
end
|
@@ -73,7 +81,7 @@ class TestLocalePath < Test::Unit::TestCase
|
|
73
81
|
def test_supported_locales
|
74
82
|
testdir = File.dirname(File.expand_path(__FILE__))
|
75
83
|
path = GetText::LocalePath.new("test1", "#{testdir}/locale")
|
76
|
-
assert_equal ["fr", "ja", "zh_Hant"], path.supported_locales
|
84
|
+
assert_equal ["fr", "fr_BE", "fr_BE_Foo", "ja", "zh_Hant"], path.supported_locales
|
77
85
|
|
78
86
|
path = GetText::LocalePath.new("plural", "#{testdir}/locale")
|
79
87
|
assert_equal ["cr", "da", "fr", "ir", "ja", "la", "li", "po", "sl"], path.supported_locales
|