gettext 3.3.5 → 3.3.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5391b52687ca78f695890c2d0b7d78b322ba32ce7b4978c12de1cbde7f2e682f
4
- data.tar.gz: b589d0b3dc0a057526b17b5a196171365280d1e60fdc2f939be5a2381ecd1e4d
3
+ metadata.gz: e644842bf5dd767497cbcb53f5ad651604e709bc4a484e460bfd8d2e1040b1cd
4
+ data.tar.gz: 798048056cf35d51a238480448139a4316fab5decaa26f161add7c1cd53e91e3
5
5
  SHA512:
6
- metadata.gz: 774e933f6950156d08af1957e0f67d4a07b717ca42761c84fd6bf9ee2758304eb5ac0e58bdfbd6cce0a892ecce7ea6de4708cfee5ba39e58a64e325cb5acb885
7
- data.tar.gz: c614dbf745ba89e691e4e40c38f73a2daba026eb58af0af0f638753a169f5ef18f2b93e9bf1311df4f086e916294db73ab0d3597f26fdd9ad51cf539c923ff26
6
+ metadata.gz: 81e13f5f41667f9885f27b65ad6179151b7c25fdf05e7ac49964d45827e0725fa72bc7b40a6e0a52e69a5a86f46c98f2efb36eb606796636bf407072b372ad01
7
+ data.tar.gz: 887292f88d3bf9baef49bbf2af55082689b889010a1328f69ec2387b65abf346b348080b5932ac7dd3393c39d5f2a79e9d375fc48c89d28e8ba242cb54f5b95c
@@ -1,5 +1,24 @@
1
1
  # News
2
2
 
3
+ ## 3.3.6: 2020-08-04 {#version-3-3-6}
4
+
5
+ ### Improvements
6
+
7
+ * erb: Added support for `-%>`.
8
+ [GitHub#77][Reported by lremes]
9
+
10
+ * Removed ChangeLog.
11
+ [GitHub#76][Reported by Will Stephenson]
12
+
13
+ * Don't assume `RbConfig::CONFIG["datadir"]` is available. For
14
+ example, TruffleRuby doesn't provide it.
15
+
16
+ ### Thanks
17
+
18
+ * lremes
19
+
20
+ * Will Stephenson
21
+
3
22
  ## 3.3.5: 2020-02-15 {#version-3-3-5}
4
23
 
5
24
  ### Improvements
@@ -850,3 +869,157 @@ Ruby 1.9 support release.
850
869
  * Gunnar Wolf
851
870
  * Ivan Pirlik
852
871
  * Tatsuki Sugiura
872
+
873
+ ## 2.2.1: 2012-05-20
874
+
875
+ ### Changes
876
+
877
+ * Supported non ASCII string in msgid. [GitHub#1]
878
+ [Patch by Urban Hafner]
879
+ * Stopped overriding String#% on Ruby 1.9.
880
+ * Fixed a bug that "\" is too escaped.
881
+ * Removed GetText.bindtext dependency from GetText::PoParser.
882
+ * Ranamed GetText::MOFile to GetText::MoFile but GetText::MOFile
883
+ is still available.
884
+
885
+ ### Thanks
886
+
887
+ * Urban Hafner
888
+
889
+ ## 2.2.0: 2012-03-11
890
+
891
+ ### Changes
892
+
893
+ * Supported ruby-1.9. [Patch by hallelujah]
894
+ * Supported $SAFE=1. [Patch by bon]
895
+ * Improved argument check. [Suggested by Morus Walter]
896
+ * Supported ruby-1.8.6 again. [Bug#27447] [Reported by Mamoru Tasaka]
897
+ * Fixed Ukrainan translation path. [Bug#28277] [Reported by Gunnar Wolf]
898
+ * Fixed a bug that only the last path in GETTEXT_PATH environment
899
+ variable is used. [Bug#28345] [Reported by Ivan Pirlik]
900
+ * Fixed a bug that Ruby-GetText-Package modifies $LOAD_PATH. [Bug#28094]
901
+ [Reported by Tatsuki Sugiura]
902
+
903
+ ### Thanks
904
+
905
+ * hallelujah
906
+ * bon
907
+ * Morus Walter
908
+ * Mamoru Tasaka
909
+ * Gunnar Wolf
910
+ * Ivan Pirlik
911
+ * Tatsuki Sugiura
912
+
913
+
914
+ ## 2.1.0: 2009-11-14
915
+
916
+ ### Changes
917
+
918
+ * Implemented parsing of translator comments (GNU gettext feature)
919
+ [by Vladimir Dobriakov]
920
+ * Refactor the directory structure.
921
+ * Move files for runtime to lib/gettext/runtime/*.
922
+ * Move files for development(rgettext/rmsgfmt) to
923
+ lib/gettext/tools/*.
924
+ * Refactor parsers for po. po-message object is defined as GetText::PoMessage
925
+ class. [by Vladimir Dobriakov, Masao Mutoh]
926
+ * Speed up when lots of objects are created to share the textdomain in each
927
+ objects. [Reported by Gaël Séchaud.]
928
+ * Fix "%{foo.bar}" %{"foo.bar".to_sym => "a"} doesn't work.
929
+ [Bug#26663, Reported by Danilo Castilho]
930
+ * lib/gettext.rb: Fixed to work unless gem. [Reported by Vladimir Dobriakov]
931
+ * Fixed a wrong String literal in a CGI sample.
932
+ [Bug #26531, by Eugene Mikhailov]
933
+ * Update license information(explicit to use ruby's or LGPL).
934
+ [Pointed out by Masateru Yoshikawa]
935
+ * Code cleanup.
936
+ * Update minor version.
937
+
938
+ ## 2.0.4: 2009-05-23
939
+
940
+ ### Changes
941
+
942
+ * Fix String#% return nil when the string have no place holders. [by okkez]
943
+ * Update pofiles and remove old messages.
944
+ * suppress some warnings on Ruby 1.9.x. [by Nobuhiro IMAI]
945
+ * Fix not to run tests on Win32.
946
+
947
+ ## 2.0.3: 2009-05-09
948
+
949
+ ### Changes
950
+
951
+ * Fixed the dependencies. [Reported by Hans de Graaff]
952
+
953
+ ## 2.0.2: 2009-05-04
954
+
955
+ ### Changes
956
+
957
+ * Support ruby-1.9.1 style format string such as `%<foo>d`.
958
+ * Apply new `Locale.set_app_language_tags` and Locale.candidates.
959
+ [Suggested by Vladimir Dobriakov]
960
+ * Enhance to support ruby-1.9.x [by OZAWA Sakuro]
961
+ * poparser work with proper encoding.
962
+ * string.rb: #bytesize alias to #size in older ruby version such as 1.8.5.
963
+ * Fixed bugs
964
+ * `n_()` to work when Plural-Forms line in po-file is not correct.
965
+ [Reported by Sava Chankov (Bug#25570)]
966
+ * GetText::Locale.default_rules_path : $LOAD_PATH is not well parsed.
967
+ [by hallelujah]
968
+ * locale_path.rb: Fixed warning message.
969
+
970
+ ### Thanks
971
+
972
+ * hallelujah
973
+ * Sava Chankov
974
+ * OZAWA Sakuro
975
+ * Vladimir Dobriakov
976
+
977
+ ## 2.0.1: 2009-04-17
978
+
979
+ ### Changes
980
+
981
+ * Fixed bugs
982
+ * doesn't work with ruby-1.8.5. [Reported by Dan Coutu]
983
+ * GetText.locale= can't keep the locale. [Reported by Adam Ilan]
984
+ * Break backward compatibility of bindtextdomain
985
+ [Reported by Mamoru Tasaka(#24947), Mathieu Blondel]
986
+ * Other trivial fixes/improvement.
987
+ * 1.8 times faster than 2.0.0.
988
+ * GetText::LocalePath is separated from GetText::TextDomainManager.
989
+ Improve to find the locale path.
990
+ * Enhance to support ruby-1.9.x [by OZAWA Sakuro]
991
+
992
+ ### Thanks
993
+
994
+ * OZAWA Sakuro
995
+ * Tietew
996
+ * Adam Ilan
997
+ * Mamoru Tasaka
998
+ * Mathieu Blondel
999
+
1000
+ ## 2.0.0: 2009-03-21
1001
+
1002
+ ### Changes
1003
+
1004
+ * Separate this library to locale and rails-support to locale,
1005
+ locale\_rails, gettext\_activerecord, gettext\_rails.
1006
+ * Depends on locale(ruby-locale).
1007
+ * Removes to support rails.
1008
+ * A lot of referctoring, improvements.
1009
+ * Thread safe.
1010
+ * New APIs for gettext/tools instead of gettext/utils.
1011
+ * Move to github.com.
1012
+
1013
+ ### Special thanks
1014
+
1015
+ * Michael Grosser: A lot of improvement.
1016
+
1017
+ ### Thanks
1018
+
1019
+ * Tietew
1020
+ * Kazuhiro NISHIYAMA
1021
+ * Fabio M.A.
1022
+ * Tuptus
1023
+ * Morus Walter
1024
+ * Vladimir Dobriakov
1025
+ * Ramsey
@@ -36,7 +36,6 @@ So you can use GNU gettext tools for maintaining.
36
36
  s.add_development_dependency("yard")
37
37
  s.add_development_dependency("kramdown")
38
38
  s.add_development_dependency("test-unit")
39
- s.add_development_dependency("test-unit-notify")
40
39
  s.add_development_dependency("test-unit-rr")
41
40
  s.license = "Ruby or LGPLv3+"
42
41
  end
@@ -17,14 +17,18 @@ module GetText
17
17
  class LocalePath
18
18
  # The default locale paths.
19
19
  CONFIG_PREFIX = RbConfig::CONFIG['prefix'].gsub(/\/local/, "")
20
- DEFAULT_RULES = [
21
- "./locale/%{lang}/LC_MESSAGES/%{name}.mo",
22
- "./locale/%{lang}/%{name}.mo",
23
- "#{RbConfig::CONFIG['datadir']}/locale/%{lang}/LC_MESSAGES/%{name}.mo",
24
- "#{RbConfig::CONFIG['datadir'].gsub(/\/local/, "")}/locale/%{lang}/LC_MESSAGES/%{name}.mo",
25
- "#{CONFIG_PREFIX}/share/locale/%{lang}/LC_MESSAGES/%{name}.mo",
26
- "#{CONFIG_PREFIX}/local/share/locale/%{lang}/LC_MESSAGES/%{name}.mo"
27
- ].uniq
20
+ default_rules_candidates = [
21
+ "./locale/%{lang}/LC_MESSAGES/%{name}.mo",
22
+ "./locale/%{lang}/%{name}.mo",
23
+ ]
24
+ data_dir = RbConfig::CONFIG["datadir"]
25
+ if data_dir
26
+ default_rules_candidates << "#{data_dir}/locale/%{lang}/LC_MESSAGES/%{name}.mo"
27
+ default_rules_candidates << "#{data_dir.gsub(/\/local/, "")}/locale/%{lang}/LC_MESSAGES/%{name}.mo"
28
+ end
29
+ default_rules_candidates << "#{CONFIG_PREFIX}/share/locale/%{lang}/LC_MESSAGES/%{name}.mo"
30
+ default_rules_candidates << "#{CONFIG_PREFIX}/local/share/locale/%{lang}/LC_MESSAGES/%{name}.mo"
31
+ DEFAULT_RULES = default_rules_candidates.uniq
28
32
 
29
33
  class << self
30
34
  # Add default locale path. Usually you should use GetText.add_default_locale_path instead.
@@ -57,12 +57,20 @@ module GetText
57
57
  @options = options
58
58
  end
59
59
 
60
+ @@erb_accept_keyword_arguments =
61
+ ERB.instance_method(:initialize).parameters.any? {|type, _| type == :key}
62
+
60
63
  # Extracts messages from @path.
61
64
  #
62
65
  # @return [Array<POEntry>] Extracted messages
63
66
  def parse
64
67
  content = IO.read(@path)
65
- src = ERB.new(content).src
68
+ if @@erb_accept_keyword_arguments
69
+ erb = ERB.new(content, trim_mode: "-")
70
+ else
71
+ erb = ERB.new(content, nil, "-")
72
+ end
73
+ src = erb.src
66
74
 
67
75
  # Force the src encoding back to the encoding in magic comment
68
76
  # or original content.
@@ -50,9 +50,6 @@ module GetText
50
50
  end
51
51
  end
52
52
 
53
- TARGET1 = /<property.*translatable="yes">(.*)/
54
- TARGET2 = /(.*)<\/property>/
55
-
56
53
  def initialize(path, options={})
57
54
  @path = path
58
55
  @options = options
@@ -9,5 +9,5 @@
9
9
  =end
10
10
 
11
11
  module GetText
12
- VERSION = "3.3.5"
12
+ VERSION = "3.3.6"
13
13
  end
@@ -6,10 +6,10 @@
6
6
  #, fuzzy
7
7
  msgid ""
8
8
  msgstr ""
9
- "Project-Id-Version: gettext 3.3.5\n"
9
+ "Project-Id-Version: gettext 3.3.6\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2020-02-15 19:46+0900\n"
12
- "PO-Revision-Date: 2020-02-15 19:46+0900\n"
11
+ "POT-Creation-Date: 2020-08-04 06:06+0900\n"
12
+ "PO-Revision-Date: 2020-08-04 06:06+0900\n"
13
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
15
  "Language: \n"
@@ -0,0 +1,12 @@
1
+ <%
2
+ require 'gettext'
3
+ include GetText
4
+ bindtextdomain("helloerb", :path => "locale")
5
+ %>
6
+ <html>
7
+ <head>
8
+ <title><%= _("Hello") -%></title>
9
+ </head>
10
+ <body>
11
+ </body>
12
+ </html>
@@ -0,0 +1,68 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- Generated with glade 3.22.1 -->
3
+ <interface>
4
+ <requires lib="gtk+" version="3.20"/>
5
+ <object class="GtkWindow">
6
+ <property name="can_focus">False</property>
7
+ <child>
8
+ <placeholder/>
9
+ </child>
10
+ <child>
11
+ <object class="GtkBox">
12
+ <property name="visible">True</property>
13
+ <property name="can_focus">False</property>
14
+ <property name="orientation">vertical</property>
15
+ <child>
16
+ <object class="GtkLabel">
17
+ <property name="visible">True</property>
18
+ <property name="can_focus">False</property>
19
+ <property name="label" translatable="yes" context="context" comments="comment">label with context</property>
20
+ </object>
21
+ <packing>
22
+ <property name="expand">False</property>
23
+ <property name="fill">True</property>
24
+ <property name="position">0</property>
25
+ </packing>
26
+ </child>
27
+ <child>
28
+ <object class="GtkLabel">
29
+ <property name="visible">True</property>
30
+ <property name="can_focus">False</property>
31
+ <property name="label" translatable="yes">label simple</property>
32
+ </object>
33
+ <packing>
34
+ <property name="expand">False</property>
35
+ <property name="fill">True</property>
36
+ <property name="position">1</property>
37
+ </packing>
38
+ </child>
39
+ <child>
40
+ <object class="GtkLabel">
41
+ <property name="visible">True</property>
42
+ <property name="can_focus">False</property>
43
+ <property name="label">not trnanslatable label</property>
44
+ </object>
45
+ <packing>
46
+ <property name="expand">False</property>
47
+ <property name="fill">True</property>
48
+ <property name="position">2</property>
49
+ </packing>
50
+ </child>
51
+ <child>
52
+ <object class="GtkLabel">
53
+ <property name="visible">True</property>
54
+ <property name="can_focus">False</property>
55
+ <property name="label" translatable="yes">multiple
56
+ lines
57
+ label</property>
58
+ </object>
59
+ <packing>
60
+ <property name="expand">False</property>
61
+ <property name="fill">True</property>
62
+ <property name="position">3</property>
63
+ </packing>
64
+ </child>
65
+ </object>
66
+ </child>
67
+ </object>
68
+ </interface>
@@ -29,7 +29,6 @@ $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
34
  require "helper"
@@ -190,6 +190,13 @@ class TestGetTextParser < Test::Unit::TestCase
190
190
 
191
191
  assert_target('わたし', ["#{path}:12"])
192
192
  end
193
+
194
+ def test_minus
195
+ path = fixture_path("erb", "minus.rhtml")
196
+ @ary = GetText::ErbParser.parse(path)
197
+
198
+ assert_target("Hello", ["#{path}:8"])
199
+ end
193
200
  end
194
201
 
195
202
  def test_xgettext_parse
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.5
4
+ version: 3.3.6
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-02-15 00:00:00.000000000 Z
12
+ date: 2020-08-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: locale
@@ -109,20 +109,6 @@ dependencies:
109
109
  - - ">="
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
- - !ruby/object:Gem::Dependency
113
- name: test-unit-notify
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- version: '0'
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- version: '0'
126
112
  - !ruby/object:Gem::Dependency
127
113
  name: test-unit-rr
128
114
  requirement: !ruby/object:Gem::Requirement
@@ -145,11 +131,11 @@ email:
145
131
  - kou@clear-code.com
146
132
  - mutomasa at gmail.com
147
133
  executables:
148
- - rmsgmerge
149
- - rmsginit
150
134
  - rmsgcat
151
- - rxgettext
152
135
  - rmsgfmt
136
+ - rmsginit
137
+ - rmsgmerge
138
+ - rxgettext
153
139
  extensions: []
154
140
  extra_rdoc_files: []
155
141
  files:
@@ -1531,9 +1517,11 @@ files:
1531
1517
  - test/fixtures/backslash.rb
1532
1518
  - test/fixtures/erb/ascii.rhtml
1533
1519
  - test/fixtures/erb/ascii.rxml
1520
+ - test/fixtures/erb/minus.rhtml
1534
1521
  - test/fixtures/erb/non_ascii.rhtml
1535
1522
  - test/fixtures/gladeparser.glade
1536
1523
  - test/fixtures/gtk_builder_ui_definitions.ui
1524
+ - test/fixtures/gtk_builder_ui_definitions.ui~
1537
1525
  - test/fixtures/hello.rb
1538
1526
  - test/fixtures/lower_n_.rb
1539
1527
  - test/fixtures/multi_text_domain.rb
@@ -1689,23 +1677,22 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1689
1677
  - !ruby/object:Gem::Version
1690
1678
  version: '0'
1691
1679
  requirements: []
1692
- rubyforge_project:
1693
- rubygems_version: 2.7.6.2
1680
+ rubygems_version: 3.2.0.rc.1
1694
1681
  signing_key:
1695
1682
  specification_version: 4
1696
1683
  summary: Gettext is a pure Ruby libary and tools to localize messages.
1697
1684
  test_files:
1685
+ - test/test_class_info.rb
1686
+ - test/test_gettext.rb
1687
+ - test/test_locale_path.rb
1698
1688
  - test/test_mo.rb
1699
1689
  - test/test_parser.rb
1690
+ - test/test_po.rb
1691
+ - test/test_po_entry.rb
1700
1692
  - test/test_po_parser.rb
1701
- - test/test_text_domain_bind.rb
1702
- - test/test_text_domain.rb
1703
1693
  - test/test_string.rb
1704
- - test/test_locale_path.rb
1705
- - test/test_thread.rb
1706
- - test/test_class_info.rb
1694
+ - test/test_text_domain.rb
1695
+ - test/test_text_domain_bind.rb
1707
1696
  - test/test_text_domain_multi.rb
1708
- - test/test_po_entry.rb
1709
- - test/test_gettext.rb
1710
1697
  - test/test_text_domain_toplevel.rb
1711
- - test/test_po.rb
1698
+ - test/test_thread.rb