gettext 1.90.0 → 1.91.0

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.
Files changed (224) hide show
  1. data/ChangeLog +45 -0
  2. data/NEWS +22 -0
  3. data/README +5 -3
  4. data/Rakefile +4 -2
  5. data/bin/rgettext +2 -2
  6. data/bin/rmsgfmt +2 -2
  7. data/bin/rmsgmerge +2 -2
  8. data/data/locale/bs/LC_MESSAGES/rails.mo +0 -0
  9. data/data/locale/bs/LC_MESSAGES/rgettext.mo +0 -0
  10. data/data/locale/ca/LC_MESSAGES/rails.mo +0 -0
  11. data/data/locale/ca/LC_MESSAGES/rgettext.mo +0 -0
  12. data/data/locale/cs/LC_MESSAGES/rails.mo +0 -0
  13. data/data/locale/cs/LC_MESSAGES/rgettext.mo +0 -0
  14. data/data/locale/de/LC_MESSAGES/rails.mo +0 -0
  15. data/data/locale/de/LC_MESSAGES/rgettext.mo +0 -0
  16. data/data/locale/el/LC_MESSAGES/rails.mo +0 -0
  17. data/data/locale/el/LC_MESSAGES/rgettext.mo +0 -0
  18. data/data/locale/eo/LC_MESSAGES/rails.mo +0 -0
  19. data/data/locale/eo/LC_MESSAGES/rgettext.mo +0 -0
  20. data/data/locale/es/LC_MESSAGES/rails.mo +0 -0
  21. data/data/locale/es/LC_MESSAGES/rgettext.mo +0 -0
  22. data/data/locale/et/LC_MESSAGES/rails.mo +0 -0
  23. data/data/locale/fr/LC_MESSAGES/rails.mo +0 -0
  24. data/data/locale/fr/LC_MESSAGES/rgettext.mo +0 -0
  25. data/data/locale/hr/LC_MESSAGES/rails.mo +0 -0
  26. data/data/locale/hr/LC_MESSAGES/rgettext.mo +0 -0
  27. data/data/locale/hu/LC_MESSAGES/rails.mo +0 -0
  28. data/data/locale/hu/LC_MESSAGES/rgettext.mo +0 -0
  29. data/data/locale/it/LC_MESSAGES/rails.mo +0 -0
  30. data/data/locale/it/LC_MESSAGES/rgettext.mo +0 -0
  31. data/data/locale/ja/LC_MESSAGES/rails.mo +0 -0
  32. data/data/locale/ja/LC_MESSAGES/rgettext.mo +0 -0
  33. data/data/locale/ko/LC_MESSAGES/rails.mo +0 -0
  34. data/data/locale/ko/LC_MESSAGES/rgettext.mo +0 -0
  35. data/data/locale/nb/LC_MESSAGES/rails.mo +0 -0
  36. data/data/locale/nb/LC_MESSAGES/rgettext.mo +0 -0
  37. data/data/locale/nl/LC_MESSAGES/rails.mo +0 -0
  38. data/data/locale/nl/LC_MESSAGES/rgettext.mo +0 -0
  39. data/data/locale/pt_BR/LC_MESSAGES/rails.mo +0 -0
  40. data/data/locale/pt_BR/LC_MESSAGES/rgettext.mo +0 -0
  41. data/data/locale/ru/LC_MESSAGES/rails.mo +0 -0
  42. data/data/locale/ru/LC_MESSAGES/rgettext.mo +0 -0
  43. data/data/locale/sr/LC_MESSAGES/rails.mo +0 -0
  44. data/data/locale/sr/LC_MESSAGES/rgettext.mo +0 -0
  45. data/data/locale/sv/LC_MESSAGES/rgettext.mo +0 -0
  46. data/data/locale/ua/LC_MESSAGES/rails.mo +0 -0
  47. data/data/locale/ua/LC_MESSAGES/rgettext.mo +0 -0
  48. data/data/locale/vi/LC_MESSAGES/rails.mo +0 -0
  49. data/data/locale/vi/LC_MESSAGES/rgettext.mo +0 -0
  50. data/data/locale/zh/LC_MESSAGES/rails.mo +0 -0
  51. data/data/locale/zh/LC_MESSAGES/rgettext.mo +0 -0
  52. data/data/locale/zh_TW/LC_MESSAGES/rails.mo +0 -0
  53. data/data/locale/zh_TW/LC_MESSAGES/rgettext.mo +0 -0
  54. data/doc/classes/ActionView/Helpers/FormBuilder.html +154 -0
  55. data/doc/classes/ActiveRecord/Base.html +47 -47
  56. data/doc/classes/ActiveRecord/ConnectionAdapters/Column.html +6 -6
  57. data/doc/classes/GetText.html +379 -327
  58. data/doc/classes/GetText/ActiveRecordParser.html +12 -12
  59. data/doc/classes/GetText/ErbContainer.html +12 -12
  60. data/doc/classes/GetText/ErbParser.html +6 -6
  61. data/doc/classes/GetText/PoParser.html +6 -6
  62. data/doc/classes/GetText/Rails.html +20 -20
  63. data/doc/classes/GetText/TextDomain.html +68 -68
  64. data/doc/classes/GetText/TextDomainManager.html +54 -54
  65. data/doc/classes/Locale.html +152 -151
  66. data/doc/classes/Locale/Object.html +92 -92
  67. data/doc/classes/Locale/SystemBase.html +32 -32
  68. data/doc/classes/Locale/SystemCGI.html +31 -31
  69. data/doc/classes/Locale/SystemWin32.html +19 -34
  70. data/doc/classes/Locale/SystemWin32Table.html +123 -0
  71. data/doc/classes/MOFile.html +28 -29
  72. data/doc/created.rid +1 -1
  73. data/doc/files/ChangeLog.html +60 -1
  74. data/doc/files/README.html +11 -4
  75. data/doc/files/lib/gettext/active_record_rb.html +1 -1
  76. data/doc/files/lib/gettext/cgi_rb.html +1 -1
  77. data/doc/files/lib/gettext/container_rb.html +1 -1
  78. data/doc/files/lib/gettext/erb_rb.html +1 -1
  79. data/doc/files/lib/gettext/iconv_rb.html +1 -1
  80. data/doc/files/lib/gettext/mo_rb.html +2 -1
  81. data/doc/files/lib/gettext/parser/active_record_rb.html +1 -1
  82. data/doc/files/lib/gettext/parser/erb_rb.html +1 -1
  83. data/doc/files/lib/gettext/parser/glade_rb.html +1 -1
  84. data/doc/files/lib/gettext/parser/ruby_rb.html +1 -1
  85. data/doc/files/lib/gettext/poparser_rb.html +1 -1
  86. data/doc/files/lib/gettext/rails_compat_rb.html +1 -1
  87. data/doc/files/lib/gettext/rails_rb.html +1 -1
  88. data/doc/files/lib/gettext/rgettext_rb.html +1 -1
  89. data/doc/files/lib/gettext/rmsgfmt_rb.html +1 -1
  90. data/doc/files/lib/gettext/rmsgmerge_rb.html +1 -1
  91. data/doc/files/lib/gettext/string_rb.html +1 -1
  92. data/doc/files/lib/gettext/textdomain_rb.html +1 -1
  93. data/doc/files/lib/gettext/textdomainmanager_rb.html +1 -1
  94. data/doc/files/lib/gettext/utils_rb.html +1 -1
  95. data/doc/files/lib/gettext/version_rb.html +1 -1
  96. data/doc/files/lib/gettext_rb.html +1 -1
  97. data/doc/files/lib/locale/base_rb.html +1 -1
  98. data/doc/files/lib/locale/cgi_rb.html +1 -1
  99. data/doc/files/lib/locale/jruby_rb.html +1 -1
  100. data/doc/files/lib/locale/object_rb.html +1 -1
  101. data/doc/files/lib/locale/posix_rb.html +1 -1
  102. data/doc/files/lib/locale/win32_rb.html +1 -1
  103. data/doc/files/lib/locale/win32_table_rb.html +1 -1
  104. data/doc/files/lib/locale_rb.html +1 -1
  105. data/doc/fr_class_index.html +2 -0
  106. data/doc/fr_method_index.html +83 -81
  107. data/lib/gettext.rb +46 -21
  108. data/lib/gettext/active_record.rb +5 -5
  109. data/lib/gettext/mo.rb +4 -4
  110. data/lib/gettext/rails.rb +15 -3
  111. data/lib/gettext/textdomain.rb +44 -41
  112. data/lib/gettext/utils.rb +8 -1
  113. data/lib/gettext/version.rb +2 -2
  114. data/lib/locale/jruby.rb +3 -3
  115. data/lib/locale/win32.rb +2 -1
  116. data/lib/locale/win32_table.rb +2 -2
  117. data/po/bs/rails.po +39 -37
  118. data/po/bs/rgettext.po +63 -53
  119. data/po/ca/rails.po +39 -36
  120. data/po/ca/rgettext.po +64 -54
  121. data/po/cs/rails.po +39 -35
  122. data/po/cs/rgettext.po +63 -53
  123. data/po/de/rails.po +38 -36
  124. data/po/de/rgettext.po +67 -57
  125. data/po/el/rails.po +42 -39
  126. data/po/el/rgettext.po +63 -53
  127. data/po/eo/rails.po +39 -37
  128. data/po/eo/rgettext.po +63 -53
  129. data/po/es/rails.po +38 -35
  130. data/po/es/rgettext.po +64 -54
  131. data/po/et/rails.po +38 -36
  132. data/po/fr/rails.po +39 -37
  133. data/po/fr/rgettext.po +65 -56
  134. data/po/hr/rails.po +40 -37
  135. data/po/hr/rgettext.po +63 -53
  136. data/po/hu/rails.po +38 -35
  137. data/po/hu/rgettext.po +64 -54
  138. data/po/it/rails.po +34 -32
  139. data/po/it/rgettext.po +62 -54
  140. data/po/ja/rails.po +42 -40
  141. data/po/ja/rgettext.po +64 -54
  142. data/po/ko/rails.po +38 -36
  143. data/po/ko/rgettext.po +64 -54
  144. data/po/nb/rails.po +37 -32
  145. data/po/nb/rgettext.po +62 -52
  146. data/po/nl/rails.po +39 -38
  147. data/po/nl/rgettext.po +64 -54
  148. data/po/pt_BR/rails.po +38 -36
  149. data/po/pt_BR/rgettext.po +63 -53
  150. data/po/rails.pot +41 -39
  151. data/po/rgettext.pot +55 -47
  152. data/po/ru/rails.po +41 -37
  153. data/po/ru/rgettext.po +63 -53
  154. data/po/sr/rails.po +149 -0
  155. data/po/sr/rgettext.po +135 -0
  156. data/po/sv/rgettext.po +60 -52
  157. data/po/ua/rails.po +39 -37
  158. data/po/ua/rgettext.po +67 -57
  159. data/po/vi/rails.po +39 -37
  160. data/po/vi/rgettext.po +61 -51
  161. data/po/zh/rails.po +37 -36
  162. data/po/zh/rgettext.po +66 -56
  163. data/po/zh_TW/rails.po +37 -36
  164. data/po/zh_TW/rgettext.po +64 -54
  165. data/samples/cgi/locale/sr/LC_MESSAGES/helloerb1.mo +0 -0
  166. data/samples/cgi/locale/sr/LC_MESSAGES/helloerb2.mo +0 -0
  167. data/samples/cgi/locale/sr/LC_MESSAGES/hellolib.mo +0 -0
  168. data/samples/cgi/locale/sr/LC_MESSAGES/main.mo +0 -0
  169. data/samples/cgi/po/sr/helloerb1.po +60 -0
  170. data/samples/cgi/po/sr/helloerb2.po +52 -0
  171. data/samples/cgi/po/sr/hellolib.po +24 -0
  172. data/samples/cgi/po/sr/main.po +80 -0
  173. data/samples/locale/hu/LC_MESSAGES/hellogtk.mo +0 -0
  174. data/samples/locale/it/LC_MESSAGES/hello2.mo +0 -0
  175. data/samples/locale/sr/LC_MESSAGES/hello.mo +0 -0
  176. data/samples/locale/sr/LC_MESSAGES/hello2.mo +0 -0
  177. data/samples/locale/sr/LC_MESSAGES/hello_noop.mo +0 -0
  178. data/samples/locale/sr/LC_MESSAGES/hello_plural.mo +0 -0
  179. data/samples/locale/sr/LC_MESSAGES/helloglade2.mo +0 -0
  180. data/samples/locale/sr/LC_MESSAGES/hellogtk.mo +0 -0
  181. data/samples/locale/sr/LC_MESSAGES/hellotk.mo +0 -0
  182. data/samples/locale/zh/LC_MESSAGES/helloglade2.mo +0 -0
  183. data/samples/locale/zh/LC_MESSAGES/hellotk.mo +0 -0
  184. data/samples/po/hu/hellogtk.po +3 -3
  185. data/samples/po/it/hello2.po +1 -1
  186. data/samples/po/sr/hello.po +22 -0
  187. data/samples/po/sr/hello2.po +30 -0
  188. data/samples/po/sr/hello_noop.po +26 -0
  189. data/samples/po/sr/hello_plural.po +26 -0
  190. data/samples/po/sr/helloglade2.po +32 -0
  191. data/samples/po/sr/hellogtk.po +22 -0
  192. data/samples/po/sr/hellotk.po +24 -0
  193. data/samples/po/zh/helloglade2.po +1 -1
  194. data/samples/po/zh/hellotk.po +1 -1
  195. data/samples/rails/app/views/articles/edit.html.erb +3 -0
  196. data/samples/rails/app/views/articles/new.html.erb +3 -0
  197. data/samples/rails/config/database.yml +9 -4
  198. data/samples/rails/locale/sr/LC_MESSAGES/blog.mo +0 -0
  199. data/samples/rails/po/sr/blog.po +106 -0
  200. data/samples/rails/vendor/plugins/gettext/locale/sr/LC_MESSAGES/gettext_plugin.mo +0 -0
  201. data/samples/rails/vendor/plugins/gettext/po/sr/gettext_plugin.po +28 -0
  202. data/test/locale/fr/LC_MESSAGES/test2.mo +0 -0
  203. data/test/locale/ja/LC_MESSAGES/test2.mo +0 -0
  204. data/test/po/fr/test2.po +1 -1
  205. data/test/po/ja/test2.po +1 -1
  206. data/test/rails/app/views/articles/show.html.erb +1 -0
  207. data/test/rails/config/environment.rb +1 -1
  208. data/test/rails/test/functional/articles_controller_test.rb +2 -2
  209. data/test/rails/test/functional/mailer_controller_test.rb +3 -1
  210. data/test/rails/test/functional/users_controller_test.rb +1 -1
  211. data/test/rails/test/result/en/custom_error_message_with_plural.html +4 -4
  212. data/test/rails/test/result/en/show.html +1 -0
  213. data/test/rails/test/result/fr/custom_error_message_with_plural.html +4 -4
  214. data/test/rails/test/result/ja/custom_error_message_with_plural.html +4 -4
  215. data/test/rails/test/result/ja/show.html +2 -1
  216. data/test/test.sh +1 -0
  217. data/test/test_active_record.rb +4 -4
  218. data/test/test_gettext.rb +10 -10
  219. data/test/test_gettext_toplevel.rb +44 -0
  220. data/test/test_locale.rb +1 -19
  221. metadata +93 -42
  222. data/test/rails/locale/ja/LC_MESSAGES/rails_test.mo +0 -0
  223. data/test/rails/log/development.log +0 -136
  224. data/test/rails/log/test.log +0 -2203
@@ -7,7 +7,7 @@ end
7
7
 
8
8
  # Re-raise errors caught by the controller.
9
9
  class ArticlesController; def rescue_action(e) raise e end; end
10
-
10
+ GetText
11
11
  class ArticlesControllerTest < Test::Unit::TestCase
12
12
  fixtures :articles
13
13
 
@@ -24,7 +24,7 @@ class ArticlesControllerTest < Test::Unit::TestCase
24
24
  end
25
25
 
26
26
  def assert_html(path)
27
- unless File.exist?(path)
27
+ unless File.exist?(RESULT_DIR + path)
28
28
  save_html(path)
29
29
  end
30
30
  ary = IO.readlines(RESULT_DIR + path)
@@ -1,7 +1,9 @@
1
1
  require File.dirname(__FILE__) + '/../test_helper'
2
2
  require 'mailer_controller'
3
3
 
4
- RESULT_DIR = File.dirname(__FILE__) + "/../../test/result/"
4
+ unless defined? RESULT_DIR
5
+ RESULT_DIR = File.dirname(__FILE__) + "/../../test/result/"
6
+ end
5
7
 
6
8
  # Re-raise errors caught by the controller.
7
9
  class MailerController; def rescue_action(e) raise e end; end
@@ -22,7 +22,7 @@ class UsersControllerTest < Test::Unit::TestCase
22
22
  end
23
23
 
24
24
  def assert_html(path)
25
- unless File.exist?(path)
25
+ unless File.exist?(RESULT_DIR + path)
26
26
  save_html(path)
27
27
  end
28
28
  ary = IO.readlines(RESULT_DIR + path)
@@ -29,10 +29,10 @@
29
29
  </select>
30
30
  <select id="user_lastupdate_2i" name="user[lastupdate(2i)]">
31
31
  <option value="1">January</option>
32
- <option value="2" selected="selected">February</option>
32
+ <option value="2">February</option>
33
33
  <option value="3">March</option>
34
34
  <option value="4">April</option>
35
- <option value="5">May</option>
35
+ <option value="5" selected="selected">May</option>
36
36
  <option value="6">June</option>
37
37
  <option value="7">July</option>
38
38
  <option value="8">August</option>
@@ -44,10 +44,10 @@
44
44
  <select id="user_lastupdate_3i" name="user[lastupdate(3i)]">
45
45
  <option value="1">1</option>
46
46
  <option value="2">2</option>
47
- <option value="3" selected="selected">3</option>
47
+ <option value="3">3</option>
48
48
  <option value="4">4</option>
49
49
  <option value="5">5</option>
50
- <option value="6">6</option>
50
+ <option value="6" selected="selected">6</option>
51
51
  <option value="7">7</option>
52
52
  <option value="8">8</option>
53
53
  <option value="9">9</option>
@@ -42,6 +42,7 @@
42
42
  2 months<br/>
43
43
  about 1 year<br/>
44
44
  over 2 years<br/>
45
+ over 4 years<br/>
45
46
 
46
47
 
47
48
 
@@ -29,10 +29,10 @@
29
29
  </select>
30
30
  <select id="user_lastupdate_2i" name="user[lastupdate(2i)]">
31
31
  <option value="1">January</option>
32
- <option value="2" selected="selected">February</option>
32
+ <option value="2">February</option>
33
33
  <option value="3">March</option>
34
34
  <option value="4">April</option>
35
- <option value="5">May</option>
35
+ <option value="5" selected="selected">May</option>
36
36
  <option value="6">June</option>
37
37
  <option value="7">July</option>
38
38
  <option value="8">August</option>
@@ -44,10 +44,10 @@
44
44
  <select id="user_lastupdate_3i" name="user[lastupdate(3i)]">
45
45
  <option value="1">1</option>
46
46
  <option value="2">2</option>
47
- <option value="3" selected="selected">3</option>
47
+ <option value="3">3</option>
48
48
  <option value="4">4</option>
49
49
  <option value="5">5</option>
50
- <option value="6">6</option>
50
+ <option value="6" selected="selected">6</option>
51
51
  <option value="7">7</option>
52
52
  <option value="8">8</option>
53
53
  <option value="9">9</option>
@@ -29,10 +29,10 @@
29
29
  </select>
30
30
  <select id="user_lastupdate_2i" name="user[lastupdate(2i)]">
31
31
  <option value="1">January</option>
32
- <option value="2" selected="selected">February</option>
32
+ <option value="2">February</option>
33
33
  <option value="3">March</option>
34
34
  <option value="4">April</option>
35
- <option value="5">May</option>
35
+ <option value="5" selected="selected">May</option>
36
36
  <option value="6">June</option>
37
37
  <option value="7">July</option>
38
38
  <option value="8">August</option>
@@ -44,10 +44,10 @@
44
44
  <select id="user_lastupdate_3i" name="user[lastupdate(3i)]">
45
45
  <option value="1">1</option>
46
46
  <option value="2">2</option>
47
- <option value="3" selected="selected">3</option>
47
+ <option value="3">3</option>
48
48
  <option value="4">4</option>
49
49
  <option value="5">5</option>
50
- <option value="6">6</option>
50
+ <option value="6" selected="selected">6</option>
51
51
  <option value="7">7</option>
52
52
  <option value="8">8</option>
53
53
  <option value="9">9</option>
@@ -39,9 +39,10 @@
39
39
  1日<br/>
40
40
  2日<br/>
41
41
  約1ヵ月<br/>
42
- 2月<br/>
42
+ 2ヶ月<br/>
43
43
  約1年<br/>
44
44
  2年以上<br/>
45
+ 4年以上<br/>
45
46
 
46
47
 
47
48
 
data/test/test.sh CHANGED
@@ -7,6 +7,7 @@ for target in test_*.rb
7
7
  do
8
8
  ruby -I../lib $target
9
9
  done
10
+ exit
10
11
  cd rails
11
12
  rake -I../../lib test
12
13
  cd ..
@@ -746,7 +746,7 @@ class ValidationsTest < Test::Unit::TestCase
746
746
  end
747
747
 
748
748
  def test_optionally_validates_length_of_using_within_on_create_fn
749
- Topic.validates_length_of :title, :content, :within => 5..10, :on => :create, :too_long => N_("my string(%{fn}) is too long: %d")
749
+ Topic.validates_length_of :title, :content, :within => 5..10, :on => :create, :too_short => N_("my string(%{fn}) is too short: %d"), :too_long => N_("my string(%{fn}) is too long: %d")
750
750
 
751
751
  GetText.set_locale_all "ja_JP.UTF-8"
752
752
  t = Topic.create("title" => "thisisnotvalid", "content" => "whatever")
@@ -764,7 +764,7 @@ class ValidationsTest < Test::Unit::TestCase
764
764
  end
765
765
 
766
766
  def test_optionally_validates_length_of_using_within_on_create
767
- Topic.validates_length_of :title, :content, :within => 5..10, :on => :create, :too_long => N_("my string is too long: %d")
767
+ Topic.validates_length_of :title, :content, :within => 5..10, :on => :create, :too_short => N_("my string is too short: %d"), :too_long => N_("my string is too long: %d")
768
768
 
769
769
  GetText.set_locale_all "ja_JP.UTF-8"
770
770
  t = Topic.create("title" => "thisisnotvalid", "content" => "whatever")
@@ -782,7 +782,7 @@ class ValidationsTest < Test::Unit::TestCase
782
782
  end
783
783
 
784
784
  def test_optionally_validates_length_of_using_within_on_update_fn
785
- Topic.validates_length_of :title, :content, :within => 5..10, :on => :update, :too_short => N_("my string(%{fn}) is too short: %d")
785
+ Topic.validates_length_of :title, :content, :within => 5..10, :on => :update, :too_short => N_("my string(%{fn}) is too short: %d"), :too_long => N_("my string(%{fn}) is too long: %d")
786
786
  GetText.set_locale_all "ja_JP.UTF-8"
787
787
  t = Topic.create("title" => "vali", "content" => "whatever")
788
788
  assert !t.save
@@ -808,7 +808,7 @@ class ValidationsTest < Test::Unit::TestCase
808
808
  end
809
809
 
810
810
  def test_optionally_validates_length_of_using_within_on_update
811
- Topic.validates_length_of :title, :content, :within => 5..10, :on => :update, :too_short => N_("my string is too short: %d")
811
+ Topic.validates_length_of :title, :content, :within => 5..10, :on => :update, :too_short => N_("my string is too short: %d"), :too_long => N_("my string is too long: %d")
812
812
  GetText.set_locale_all "ja_JP.UTF-8"
813
813
  t = Topic.create("title" => "vali", "content" => "whatever")
814
814
  assert !t.save
data/test/test_gettext.rb CHANGED
@@ -353,24 +353,24 @@ DDD
353
353
  assert_equal(F::G::H, GetText.bound_target(F::G::H.new))
354
354
 
355
355
  # Anonymous classes are bound to GetText
356
- assert_equal(GetText, GetText.bound_target(@@anon::I))
357
- assert_equal(GetText, GetText.bound_target(@@anon::I.new))
356
+ assert_equal(Object, GetText.bound_target(@@anon::I))
357
+ assert_equal(Object, GetText.bound_target(@@anon::I.new))
358
358
  end
359
359
 
360
360
  def test_bound_targets
361
361
  GetText.bindtextdomain("test1", "locale")
362
362
  bindtextdomain("test1", "locale")
363
- assert_equal([TestGetText::A2, TestGetText, GetText], GetText.bound_targets(::TestGetText::A2))
364
- assert_equal([TestGetText::A2, TestGetText, GetText], GetText.bound_targets(A2))
363
+ assert_equal([TestGetText::A2, TestGetText, Object], GetText.bound_targets(::TestGetText::A2))
364
+ assert_equal([TestGetText::A2, TestGetText, Object], GetText.bound_targets(A2))
365
365
 
366
- assert_equal([A::B, A, GetText], GetText.bound_targets(A::B))
367
- assert_equal([A::B::C, A::B, A, GetText], GetText.bound_targets(A::B::C))
368
- assert_equal([A::D::E, A::D, A, GetText], GetText.bound_targets(A::D::E))
369
- assert_equal([F::G::H, F::G, F, GetText], GetText.bound_targets(F::G::H))
366
+ assert_equal([A::B, A, Object], GetText.bound_targets(A::B))
367
+ assert_equal([A::B::C, A::B, A, Object], GetText.bound_targets(A::B::C))
368
+ assert_equal([A::D::E, A::D, A, Object], GetText.bound_targets(A::D::E))
369
+ assert_equal([F::G::H, F::G, F, Object], GetText.bound_targets(F::G::H))
370
370
 
371
371
  # Anonymous classes/modules are bound to GetText
372
- assert_equal([GetText], GetText.bound_targets(@@anon::I))
373
- assert_equal([GetText], GetText.bound_targets(@@anon::J))
372
+ assert_equal([Object], GetText.bound_targets(@@anon::I))
373
+ assert_equal([Object], GetText.bound_targets(@@anon::J))
374
374
  end
375
375
 
376
376
  def test_anonymous_module
@@ -0,0 +1,44 @@
1
+ require 'test/unit'
2
+
3
+ require 'gettext.rb'
4
+ include GetText
5
+
6
+ bindtextdomain("test1", "locale")
7
+ module Mod
8
+ module_function
9
+ def module_function
10
+ _("language")
11
+ end
12
+ end
13
+
14
+ class Cls
15
+ def instance_method
16
+ _("language")
17
+ end
18
+ def self.class_method
19
+ _("language")
20
+ end
21
+ end
22
+
23
+ def toplevel_method
24
+ _("language")
25
+ end
26
+
27
+ class TestGetText < Test::Unit::TestCase
28
+ include GetText
29
+
30
+ def test_toplevel
31
+ GetText.locale = "ja"
32
+ assert_equal("japanese", toplevel_method)
33
+ assert_equal("japanese", Mod.module_function)
34
+ assert_equal("japanese", Cls.class_method)
35
+ assert_equal("japanese", Cls.new.instance_method)
36
+
37
+ GetText.remove_all_textdomains
38
+ GetText.bindtextdomain("test1", "locale")
39
+ assert_equal("japanese", toplevel_method)
40
+ assert_equal("japanese", Mod.module_function)
41
+ assert_equal("japanese", Cls.class_method)
42
+ assert_equal("japanese", Cls.new.instance_method)
43
+ end
44
+ end
data/test/test_locale.rb CHANGED
@@ -234,30 +234,12 @@ class TestLocale < Test::Unit::TestCase
234
234
  loc = Locale.set("ja_JP")
235
235
  assert_equal("ja_JP", loc.to_str)
236
236
  assert_equal("ja_JP", Locale.get.to_str)
237
- if /openbsd/ =~ RUBY_PLATFORM
238
- assert_equal(nil, Locale.codeset)
239
- else
240
- assert_equal("eucJP", Locale.codeset)
241
- end
237
+ assert_equal("eucJP", Locale.codeset)
242
238
 
243
239
  # Confirm to set Locale::Object
244
240
  assert_equal(loc, Locale.set(loc))
245
241
  end
246
242
 
247
- =begin
248
- # Deprecated
249
- loc = Locale.set(Locale::CTYPE, "ja_JP.eucJP")
250
- assert_equal("ja_JP", loc.to_str)
251
- assert_equal("ja_JP", Locale.get.to_str)
252
- assert_equal("eucJP", Locale.codeset)
253
-
254
- # Deprecated
255
- loc = Locale.set(Locale::CTYPE, "ja_JP.UTF-8")
256
- assert_equal("ja_JP", loc.to_str)
257
- assert_equal("ja_JP", Locale.get.to_str)
258
- assert_equal("UTF-8", Locale.codeset)
259
- =end
260
-
261
243
  end
262
244
  end
263
245
 
metadata CHANGED
@@ -1,33 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: gettext
5
3
  version: !ruby/object:Gem::Version
6
- version: 1.90.0
7
- date: 2008-02-03 00:00:00 +09:00
8
- summary: Ruby-GetText-Package is a libary and tools to localize messages.
9
- require_paths:
10
- - lib
11
- email: mutoh@highway.ne.jp
12
- homepage: http://gettext.rubyforge.org/
13
- rubyforge_project: gettext
14
- description: Ruby-GetText-Package is a GNU GetText-like program for Ruby. The catalog file(po-file) is same format with GNU GetText. So you can use GNU GetText tools for maintaining.
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: false
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 1.91.0
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Masao Mutoh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-05-11 00:00:00 +09:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Ruby-GetText-Package is a GNU GetText-like program for Ruby. The catalog file(po-file) is same format with GNU GetText. So you can use GNU GetText tools for maintaining.
17
+ email: mutoh@highway.ne.jp
18
+ executables:
19
+ - rgettext
20
+ - rmsgfmt
21
+ - rmsgmerge
22
+ extensions: []
23
+
24
+ extra_rdoc_files: []
25
+
31
26
  files:
32
27
  - po
33
28
  - po/es
@@ -45,6 +40,9 @@ files:
45
40
  - po/ko/rgettext.po
46
41
  - po/ko/rails.po
47
42
  - po/rgettext.pot
43
+ - po/sr
44
+ - po/sr/rgettext.po
45
+ - po/sr/rails.po
48
46
  - po/nb
49
47
  - po/nb/rgettext.po
50
48
  - po/nb/rails.po
@@ -136,12 +134,16 @@ files:
136
134
  - doc/classes/Iconv.html
137
135
  - doc/classes/Locale
138
136
  - doc/classes/Locale/Object.html
137
+ - doc/classes/Locale/SystemWin32Table.html
139
138
  - doc/classes/Locale/SystemWin32.html
140
139
  - doc/classes/Locale/SystemPosix.html
141
140
  - doc/classes/Locale/SystemBase.html
142
141
  - doc/classes/Locale/SystemCGI.html
143
142
  - doc/classes/Locale/SystemJRuby.html
144
143
  - doc/classes/Locale.html
144
+ - doc/classes/ActionView
145
+ - doc/classes/ActionView/Helpers
146
+ - doc/classes/ActionView/Helpers/FormBuilder.html
145
147
  - doc/classes/MOFile.html
146
148
  - doc/classes/Module.html
147
149
  - doc/classes/String.html
@@ -231,6 +233,14 @@ files:
231
233
  - samples/po/ko/hellotk.po
232
234
  - samples/po/ko/hellogtk.po
233
235
  - samples/po/ko/hello.po
236
+ - samples/po/sr
237
+ - samples/po/sr/hello_plural.po
238
+ - samples/po/sr/hello_noop.po
239
+ - samples/po/sr/hello2.po
240
+ - samples/po/sr/helloglade2.po
241
+ - samples/po/sr/hellotk.po
242
+ - samples/po/sr/hellogtk.po
243
+ - samples/po/sr/hello.po
234
244
  - samples/po/hellotk.pot
235
245
  - samples/po/nb
236
246
  - samples/po/nb/hello_plural.po
@@ -422,6 +432,15 @@ files:
422
432
  - samples/locale/ko/LC_MESSAGES/hello_plural.mo
423
433
  - samples/locale/ko/LC_MESSAGES/hellotk.mo
424
434
  - samples/locale/ko/LC_MESSAGES/helloglade2.mo
435
+ - samples/locale/sr
436
+ - samples/locale/sr/LC_MESSAGES
437
+ - samples/locale/sr/LC_MESSAGES/hello_noop.mo
438
+ - samples/locale/sr/LC_MESSAGES/hello.mo
439
+ - samples/locale/sr/LC_MESSAGES/hello2.mo
440
+ - samples/locale/sr/LC_MESSAGES/hellogtk.mo
441
+ - samples/locale/sr/LC_MESSAGES/hello_plural.mo
442
+ - samples/locale/sr/LC_MESSAGES/hellotk.mo
443
+ - samples/locale/sr/LC_MESSAGES/helloglade2.mo
425
444
  - samples/locale/nb
426
445
  - samples/locale/nb/LC_MESSAGES
427
446
  - samples/locale/nb/LC_MESSAGES/hello_noop.mo
@@ -591,6 +610,8 @@ files:
591
610
  - samples/rails/po/cs/blog.po
592
611
  - samples/rails/po/ko
593
612
  - samples/rails/po/ko/blog.po
613
+ - samples/rails/po/sr
614
+ - samples/rails/po/sr/blog.po
594
615
  - samples/rails/po/nb
595
616
  - samples/rails/po/nb/blog.po
596
617
  - samples/rails/po/zh
@@ -680,6 +701,9 @@ files:
680
701
  - samples/rails/locale/ko
681
702
  - samples/rails/locale/ko/LC_MESSAGES
682
703
  - samples/rails/locale/ko/LC_MESSAGES/blog.mo
704
+ - samples/rails/locale/sr
705
+ - samples/rails/locale/sr/LC_MESSAGES
706
+ - samples/rails/locale/sr/LC_MESSAGES/blog.mo
683
707
  - samples/rails/locale/nb
684
708
  - samples/rails/locale/nb/LC_MESSAGES
685
709
  - samples/rails/locale/nb/LC_MESSAGES/blog.mo
@@ -747,6 +771,7 @@ files:
747
771
  - samples/rails/test/test_helper.rb
748
772
  - samples/rails/test/unit
749
773
  - samples/rails/test/unit/article_test.rb
774
+ - samples/rails/log
750
775
  - samples/rails/config
751
776
  - samples/rails/config/initializers
752
777
  - samples/rails/config/initializers/mime_types.rb
@@ -788,6 +813,8 @@ files:
788
813
  - samples/rails/vendor/plugins/gettext/po/cs/gettext_plugin.po
789
814
  - samples/rails/vendor/plugins/gettext/po/ko
790
815
  - samples/rails/vendor/plugins/gettext/po/ko/gettext_plugin.po
816
+ - samples/rails/vendor/plugins/gettext/po/sr
817
+ - samples/rails/vendor/plugins/gettext/po/sr/gettext_plugin.po
791
818
  - samples/rails/vendor/plugins/gettext/po/nb
792
819
  - samples/rails/vendor/plugins/gettext/po/nb/gettext_plugin.po
793
820
  - samples/rails/vendor/plugins/gettext/po/zh
@@ -839,6 +866,9 @@ files:
839
866
  - samples/rails/vendor/plugins/gettext/locale/ko
840
867
  - samples/rails/vendor/plugins/gettext/locale/ko/LC_MESSAGES
841
868
  - samples/rails/vendor/plugins/gettext/locale/ko/LC_MESSAGES/gettext_plugin.mo
869
+ - samples/rails/vendor/plugins/gettext/locale/sr
870
+ - samples/rails/vendor/plugins/gettext/locale/sr/LC_MESSAGES
871
+ - samples/rails/vendor/plugins/gettext/locale/sr/LC_MESSAGES/gettext_plugin.mo
842
872
  - samples/rails/vendor/plugins/gettext/locale/nb
843
873
  - samples/rails/vendor/plugins/gettext/locale/nb/LC_MESSAGES
844
874
  - samples/rails/vendor/plugins/gettext/locale/nb/LC_MESSAGES/gettext_plugin.mo
@@ -918,6 +948,11 @@ files:
918
948
  - samples/cgi/po/ko/helloerb2.po
919
949
  - samples/cgi/po/ko/main.po
920
950
  - samples/cgi/po/ko/helloerb1.po
951
+ - samples/cgi/po/sr
952
+ - samples/cgi/po/sr/hellolib.po
953
+ - samples/cgi/po/sr/helloerb2.po
954
+ - samples/cgi/po/sr/main.po
955
+ - samples/cgi/po/sr/helloerb1.po
921
956
  - samples/cgi/po/nb
922
957
  - samples/cgi/po/nb/hellolib.po
923
958
  - samples/cgi/po/nb/helloerb2.po
@@ -1036,6 +1071,12 @@ files:
1036
1071
  - samples/cgi/locale/ko/LC_MESSAGES/main.mo
1037
1072
  - samples/cgi/locale/ko/LC_MESSAGES/hellolib.mo
1038
1073
  - samples/cgi/locale/ko/LC_MESSAGES/helloerb1.mo
1074
+ - samples/cgi/locale/sr
1075
+ - samples/cgi/locale/sr/LC_MESSAGES
1076
+ - samples/cgi/locale/sr/LC_MESSAGES/helloerb2.mo
1077
+ - samples/cgi/locale/sr/LC_MESSAGES/main.mo
1078
+ - samples/cgi/locale/sr/LC_MESSAGES/hellolib.mo
1079
+ - samples/cgi/locale/sr/LC_MESSAGES/helloerb1.mo
1039
1080
  - samples/cgi/locale/nb
1040
1081
  - samples/cgi/locale/nb/LC_MESSAGES
1041
1082
  - samples/cgi/locale/nb/LC_MESSAGES/helloerb2.mo
@@ -1221,6 +1262,7 @@ files:
1221
1262
  - test/po/active_record.pot
1222
1263
  - test/test_erb.rxml
1223
1264
  - test/test_rails_caching.rb
1265
+ - test/test_gettext_toplevel.rb
1224
1266
  - test/test.bat
1225
1267
  - test/fixtures
1226
1268
  - test/fixtures/developers.yml
@@ -1339,10 +1381,6 @@ files:
1339
1381
  - test/rails/public/stylesheets
1340
1382
  - test/rails/public/stylesheets/scaffold.css
1341
1383
  - test/rails/public/dispatch.cgi
1342
- - test/rails/locale
1343
- - test/rails/locale/ja
1344
- - test/rails/locale/ja/LC_MESSAGES
1345
- - test/rails/locale/ja/LC_MESSAGES/rails_test.mo
1346
1384
  - test/rails/db
1347
1385
  - test/rails/db/schema.rb
1348
1386
  - test/rails/README
@@ -1386,9 +1424,6 @@ files:
1386
1424
  - test/rails/test/unit/article_test.rb
1387
1425
  - test/rails/test/integration
1388
1426
  - test/rails/test/integration/general_stories_test.rb
1389
- - test/rails/log
1390
- - test/rails/log/development.log
1391
- - test/rails/log/test.log
1392
1427
  - test/rails/config
1393
1428
  - test/rails/config/boot.rb
1394
1429
  - test/rails/config/routes.rb
@@ -1465,6 +1500,10 @@ files:
1465
1500
  - data/locale/ko/LC_MESSAGES
1466
1501
  - data/locale/ko/LC_MESSAGES/rgettext.mo
1467
1502
  - data/locale/ko/LC_MESSAGES/rails.mo
1503
+ - data/locale/sr
1504
+ - data/locale/sr/LC_MESSAGES
1505
+ - data/locale/sr/LC_MESSAGES/rgettext.mo
1506
+ - data/locale/sr/LC_MESSAGES/rails.mo
1468
1507
  - data/locale/nb
1469
1508
  - data/locale/nb/LC_MESSAGES
1470
1509
  - data/locale/nb/LC_MESSAGES/rgettext.mo
@@ -1537,19 +1576,31 @@ files:
1537
1576
  - data/locale/ca/LC_MESSAGES/rgettext.mo
1538
1577
  - data/locale/ca/LC_MESSAGES/rails.mo
1539
1578
  - Rakefile
1540
- test_files: []
1541
-
1579
+ has_rdoc: true
1580
+ homepage: http://gettext.rubyforge.org/
1581
+ post_install_message:
1542
1582
  rdoc_options: []
1543
1583
 
1544
- extra_rdoc_files: []
1545
-
1546
- executables:
1547
- - rgettext
1548
- - rmsgfmt
1549
- - rmsgmerge
1550
- extensions: []
1551
-
1584
+ require_paths:
1585
+ - lib
1586
+ required_ruby_version: !ruby/object:Gem::Requirement
1587
+ requirements:
1588
+ - - ">="
1589
+ - !ruby/object:Gem::Version
1590
+ version: "0"
1591
+ version:
1592
+ required_rubygems_version: !ruby/object:Gem::Requirement
1593
+ requirements:
1594
+ - - ">="
1595
+ - !ruby/object:Gem::Version
1596
+ version: "0"
1597
+ version:
1552
1598
  requirements: []
1553
1599
 
1554
- dependencies: []
1600
+ rubyforge_project: gettext
1601
+ rubygems_version: 1.0.1
1602
+ signing_key:
1603
+ specification_version: 2
1604
+ summary: Ruby-GetText-Package is a libary and tools to localize messages.
1605
+ test_files: []
1555
1606