gettext 1.9.0 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (328) hide show
  1. data/ChangeLog +122 -1
  2. data/NEWS +21 -0
  3. data/README +30 -22
  4. data/data/locale/bs/LC_MESSAGES/rails.mo +0 -0
  5. data/data/locale/bs/LC_MESSAGES/rgettext.mo +0 -0
  6. data/data/locale/ca/LC_MESSAGES/rails.mo +0 -0
  7. data/data/locale/ca/LC_MESSAGES/rgettext.mo +0 -0
  8. data/data/locale/cs/LC_MESSAGES/rails.mo +0 -0
  9. data/data/locale/cs/LC_MESSAGES/rgettext.mo +0 -0
  10. data/data/locale/de/LC_MESSAGES/rails.mo +0 -0
  11. data/data/locale/de/LC_MESSAGES/rgettext.mo +0 -0
  12. data/data/locale/el/LC_MESSAGES/rails.mo +0 -0
  13. data/data/locale/el/LC_MESSAGES/rgettext.mo +0 -0
  14. data/data/locale/eo/LC_MESSAGES/rails.mo +0 -0
  15. data/data/locale/eo/LC_MESSAGES/rgettext.mo +0 -0
  16. data/data/locale/es/LC_MESSAGES/rails.mo +0 -0
  17. data/data/locale/es/LC_MESSAGES/rgettext.mo +0 -0
  18. data/data/locale/et/LC_MESSAGES/rails.mo +0 -0
  19. data/data/locale/fr/LC_MESSAGES/rails.mo +0 -0
  20. data/data/locale/fr/LC_MESSAGES/rgettext.mo +0 -0
  21. data/data/locale/hr/LC_MESSAGES/rails.mo +0 -0
  22. data/data/locale/hr/LC_MESSAGES/rgettext.mo +0 -0
  23. data/data/locale/it/LC_MESSAGES/rails.mo +0 -0
  24. data/data/locale/it/LC_MESSAGES/rgettext.mo +0 -0
  25. data/data/locale/ja/LC_MESSAGES/rails.mo +0 -0
  26. data/data/locale/ja/LC_MESSAGES/rgettext.mo +0 -0
  27. data/data/locale/ko/LC_MESSAGES/rails.mo +0 -0
  28. data/data/locale/ko/LC_MESSAGES/rgettext.mo +0 -0
  29. data/data/locale/nb/LC_MESSAGES/rails.mo +0 -0
  30. data/data/locale/nb/LC_MESSAGES/rgettext.mo +0 -0
  31. data/data/locale/nl/LC_MESSAGES/rails.mo +0 -0
  32. data/data/locale/nl/LC_MESSAGES/rgettext.mo +0 -0
  33. data/data/locale/pt_BR/LC_MESSAGES/rails.mo +0 -0
  34. data/data/locale/pt_BR/LC_MESSAGES/rgettext.mo +0 -0
  35. data/data/locale/ru/LC_MESSAGES/rails.mo +0 -0
  36. data/data/locale/ru/LC_MESSAGES/rgettext.mo +0 -0
  37. data/data/locale/sv/LC_MESSAGES/rgettext.mo +0 -0
  38. data/data/locale/vi/LC_MESSAGES/rails.mo +0 -0
  39. data/data/locale/vi/LC_MESSAGES/rgettext.mo +0 -0
  40. data/data/locale/zh/LC_MESSAGES/rails.mo +0 -0
  41. data/data/locale/zh/LC_MESSAGES/rgettext.mo +0 -0
  42. data/data/locale/zh_TW/LC_MESSAGES/rails.mo +0 -0
  43. data/data/locale/zh_TW/LC_MESSAGES/rgettext.mo +0 -0
  44. data/lib/gettext.rb +119 -37
  45. data/lib/gettext/active_record.rb +51 -31
  46. data/lib/gettext/locale_win32.rb +2 -1
  47. data/lib/gettext/parser/active_record.rb +2 -2
  48. data/lib/gettext/parser/ruby.rb +2 -2
  49. data/lib/gettext/poparser.rb +19 -14
  50. data/lib/gettext/rails.rb +104 -50
  51. data/lib/gettext/rails_compat.rb +16 -0
  52. data/lib/gettext/rgettext.rb +37 -3
  53. data/lib/gettext/textdomain.rb +45 -6
  54. data/lib/gettext/utils.rb +7 -0
  55. data/lib/gettext/version.rb +1 -1
  56. data/po/bs/rails.po +148 -0
  57. data/po/bs/rgettext.po +131 -0
  58. data/po/ca/rails.po +45 -26
  59. data/po/ca/rgettext.po +21 -21
  60. data/po/cs/rails.po +46 -24
  61. data/po/cs/rgettext.po +21 -21
  62. data/po/de/rails.po +46 -27
  63. data/po/de/rgettext.po +21 -21
  64. data/po/el/rails.po +46 -25
  65. data/po/el/rgettext.po +22 -22
  66. data/po/eo/rails.po +49 -30
  67. data/po/eo/rgettext.po +21 -21
  68. data/po/es/rails.po +45 -24
  69. data/po/es/rgettext.po +21 -21
  70. data/po/et/rails.po +49 -30
  71. data/po/fr/rails.po +47 -28
  72. data/po/fr/rgettext.po +31 -29
  73. data/po/hr/rails.po +148 -0
  74. data/po/hr/rgettext.po +131 -0
  75. data/po/it/rails.po +42 -24
  76. data/po/it/rgettext.po +21 -21
  77. data/po/ja/rails.po +43 -25
  78. data/po/ja/rgettext.po +21 -21
  79. data/po/ko/rails.po +44 -24
  80. data/po/ko/rgettext.po +21 -21
  81. data/po/nb/rails.po +140 -0
  82. data/po/nb/rgettext.po +127 -0
  83. data/po/nl/rails.po +50 -30
  84. data/po/nl/rgettext.po +21 -21
  85. data/po/pt_BR/rails.po +48 -29
  86. data/po/pt_BR/rgettext.po +21 -21
  87. data/po/rails.pot +42 -24
  88. data/po/rgettext.pot +21 -21
  89. data/po/ru/rails.po +50 -31
  90. data/po/ru/rgettext.po +21 -21
  91. data/po/sv/rgettext.po +21 -21
  92. data/po/vi/rails.po +141 -0
  93. data/po/vi/rgettext.po +126 -0
  94. data/po/zh/rails.po +60 -43
  95. data/po/zh/rgettext.po +22 -22
  96. data/po/zh_TW/rails.po +61 -43
  97. data/po/zh_TW/rgettext.po +22 -22
  98. data/samples/cgi/locale/bs/LC_MESSAGES/helloerb1.mo +0 -0
  99. data/samples/cgi/locale/bs/LC_MESSAGES/helloerb2.mo +0 -0
  100. data/samples/cgi/locale/bs/LC_MESSAGES/hellolib.mo +0 -0
  101. data/samples/cgi/locale/bs/LC_MESSAGES/main.mo +0 -0
  102. data/samples/cgi/locale/ca/LC_MESSAGES/helloerb1.mo +0 -0
  103. data/samples/cgi/locale/ca/LC_MESSAGES/helloerb2.mo +0 -0
  104. data/samples/cgi/locale/de/LC_MESSAGES/helloerb1.mo +0 -0
  105. data/samples/cgi/locale/de/LC_MESSAGES/helloerb2.mo +0 -0
  106. data/samples/cgi/locale/hr/LC_MESSAGES/helloerb1.mo +0 -0
  107. data/samples/cgi/locale/hr/LC_MESSAGES/helloerb2.mo +0 -0
  108. data/samples/cgi/locale/hr/LC_MESSAGES/hellolib.mo +0 -0
  109. data/samples/cgi/locale/hr/LC_MESSAGES/main.mo +0 -0
  110. data/samples/cgi/locale/it/LC_MESSAGES/helloerb1.mo +0 -0
  111. data/samples/cgi/locale/it/LC_MESSAGES/helloerb2.mo +0 -0
  112. data/samples/cgi/locale/ko/LC_MESSAGES/helloerb1.mo +0 -0
  113. data/samples/cgi/locale/ko/LC_MESSAGES/helloerb2.mo +0 -0
  114. data/samples/cgi/locale/nb/LC_MESSAGES/helloerb1.mo +0 -0
  115. data/samples/cgi/locale/nb/LC_MESSAGES/helloerb2.mo +0 -0
  116. data/samples/cgi/locale/nb/LC_MESSAGES/hellolib.mo +0 -0
  117. data/samples/cgi/locale/nb/LC_MESSAGES/main.mo +0 -0
  118. data/samples/cgi/locale/vi/LC_MESSAGES/helloerb1.mo +0 -0
  119. data/samples/cgi/locale/vi/LC_MESSAGES/helloerb2.mo +0 -0
  120. data/samples/cgi/locale/vi/LC_MESSAGES/hellolib.mo +0 -0
  121. data/samples/cgi/locale/vi/LC_MESSAGES/main.mo +0 -0
  122. data/samples/cgi/po/bs/helloerb1.po +59 -0
  123. data/samples/cgi/po/bs/helloerb2.po +51 -0
  124. data/samples/cgi/po/bs/hellolib.po +23 -0
  125. data/samples/cgi/po/bs/main.po +83 -0
  126. data/samples/cgi/po/hr/helloerb1.po +59 -0
  127. data/samples/cgi/po/hr/helloerb2.po +51 -0
  128. data/samples/cgi/po/hr/hellolib.po +23 -0
  129. data/samples/cgi/po/hr/main.po +83 -0
  130. data/samples/cgi/po/nb/helloerb1.po +58 -0
  131. data/samples/cgi/po/nb/helloerb2.po +50 -0
  132. data/samples/cgi/po/nb/hellolib.po +22 -0
  133. data/samples/cgi/po/nb/main.po +82 -0
  134. data/samples/cgi/po/vi/helloerb1.po +65 -0
  135. data/samples/cgi/po/vi/helloerb2.po +52 -0
  136. data/samples/cgi/po/vi/hellolib.po +24 -0
  137. data/samples/cgi/po/vi/main.po +77 -0
  138. data/samples/locale/bs/LC_MESSAGES/hello.mo +0 -0
  139. data/samples/locale/bs/LC_MESSAGES/hello2.mo +0 -0
  140. data/samples/locale/bs/LC_MESSAGES/hello_noop.mo +0 -0
  141. data/samples/locale/bs/LC_MESSAGES/hello_plural.mo +0 -0
  142. data/samples/locale/bs/LC_MESSAGES/helloglade2.mo +0 -0
  143. data/samples/locale/bs/LC_MESSAGES/hellogtk.mo +0 -0
  144. data/samples/locale/bs/LC_MESSAGES/hellotk.mo +0 -0
  145. data/samples/locale/hr/LC_MESSAGES/hello.mo +0 -0
  146. data/samples/locale/hr/LC_MESSAGES/hello2.mo +0 -0
  147. data/samples/locale/hr/LC_MESSAGES/hello_noop.mo +0 -0
  148. data/samples/locale/hr/LC_MESSAGES/hello_plural.mo +0 -0
  149. data/samples/locale/hr/LC_MESSAGES/helloglade2.mo +0 -0
  150. data/samples/locale/hr/LC_MESSAGES/hellogtk.mo +0 -0
  151. data/samples/locale/hr/LC_MESSAGES/hellotk.mo +0 -0
  152. data/samples/locale/ja/LC_MESSAGES/hello_plural.mo +0 -0
  153. data/samples/locale/nb/LC_MESSAGES/hello.mo +0 -0
  154. data/samples/locale/nb/LC_MESSAGES/hello2.mo +0 -0
  155. data/samples/locale/nb/LC_MESSAGES/hello_noop.mo +0 -0
  156. data/samples/locale/nb/LC_MESSAGES/hello_plural.mo +0 -0
  157. data/samples/locale/nb/LC_MESSAGES/helloglade2.mo +0 -0
  158. data/samples/locale/nb/LC_MESSAGES/hellogtk.mo +0 -0
  159. data/samples/locale/nb/LC_MESSAGES/hellotk.mo +0 -0
  160. data/samples/locale/vi/LC_MESSAGES/hello.mo +0 -0
  161. data/samples/locale/vi/LC_MESSAGES/hello2.mo +0 -0
  162. data/samples/locale/vi/LC_MESSAGES/hello_noop.mo +0 -0
  163. data/samples/locale/vi/LC_MESSAGES/hello_plural.mo +0 -0
  164. data/samples/locale/vi/LC_MESSAGES/helloglade2.mo +0 -0
  165. data/samples/locale/vi/LC_MESSAGES/hellogtk.mo +0 -0
  166. data/samples/locale/vi/LC_MESSAGES/hellotk.mo +0 -0
  167. data/samples/po/bs/hello.po +23 -0
  168. data/samples/po/bs/hello2.po +31 -0
  169. data/samples/po/bs/hello_noop.po +27 -0
  170. data/samples/po/bs/hello_plural.po +26 -0
  171. data/samples/po/bs/helloglade2.po +31 -0
  172. data/samples/po/bs/hellogtk.po +23 -0
  173. data/samples/po/bs/hellotk.po +23 -0
  174. data/samples/po/hr/hello.po +23 -0
  175. data/samples/po/hr/hello2.po +31 -0
  176. data/samples/po/hr/hello_noop.po +27 -0
  177. data/samples/po/hr/hello_plural.po +26 -0
  178. data/samples/po/hr/helloglade2.po +31 -0
  179. data/samples/po/hr/hellogtk.po +23 -0
  180. data/samples/po/hr/hellotk.po +23 -0
  181. data/samples/po/ja/hello_plural.po +1 -1
  182. data/samples/po/nb/hello.po +22 -0
  183. data/samples/po/nb/hello2.po +31 -0
  184. data/samples/po/nb/hello_noop.po +26 -0
  185. data/samples/po/nb/hello_plural.po +24 -0
  186. data/samples/po/nb/helloglade2.po +30 -0
  187. data/samples/po/nb/hellogtk.po +22 -0
  188. data/samples/po/nb/hellotk.po +22 -0
  189. data/samples/po/vi/hello.po +23 -0
  190. data/samples/po/vi/hello2.po +31 -0
  191. data/samples/po/vi/hello_noop.po +27 -0
  192. data/samples/po/vi/hello_plural.po +26 -0
  193. data/samples/po/vi/helloglade2.po +38 -0
  194. data/samples/po/vi/hellogtk.po +23 -0
  195. data/samples/po/vi/hellotk.po +24 -0
  196. data/samples/rails/locale/bs/LC_MESSAGES/blog.mo +0 -0
  197. data/samples/rails/locale/en/LC_MESSAGES/blog.mo +0 -0
  198. data/samples/rails/locale/hr/LC_MESSAGES/blog.mo +0 -0
  199. data/samples/rails/locale/nb/LC_MESSAGES/blog.mo +0 -0
  200. data/samples/rails/locale/vi/LC_MESSAGES/blog.mo +0 -0
  201. data/samples/rails/po/bs/blog.po +106 -0
  202. data/samples/rails/po/hr/blog.po +106 -0
  203. data/samples/rails/po/nb/blog.po +104 -0
  204. data/samples/rails/po/vi/blog.po +110 -0
  205. data/samples/rails/vendor/plugins/gettext/locale/bs/LC_MESSAGES/gettext_plugin.mo +0 -0
  206. data/samples/rails/vendor/plugins/gettext/locale/hr/LC_MESSAGES/gettext_plugin.mo +0 -0
  207. data/samples/rails/vendor/plugins/gettext/locale/nb/LC_MESSAGES/gettext_plugin.mo +0 -0
  208. data/samples/rails/vendor/plugins/gettext/locale/vi/LC_MESSAGES/gettext_plugin.mo +0 -0
  209. data/samples/rails/vendor/plugins/gettext/po/bs/gettext_plugin.po +27 -0
  210. data/samples/rails/vendor/plugins/gettext/po/hr/gettext_plugin.po +27 -0
  211. data/samples/rails/vendor/plugins/gettext/po/nb/gettext_plugin.po +27 -0
  212. data/samples/rails/vendor/plugins/gettext/po/vi/gettext_plugin.po +28 -0
  213. data/src/poparser.ry +9 -4
  214. data/test/README +2 -0
  215. data/test/Rakefile +2 -0
  216. data/test/db/mysql.drop.sql +4 -0
  217. data/test/db/mysql.sql +44 -0
  218. data/test/gettext_test.rb +51 -13
  219. data/test/gettext_test_active_record.rb +33 -0
  220. data/test/gettext_test_parser.rb +5 -0
  221. data/test/gettext_test_rails_caching.rb +211 -0
  222. data/test/locale/da/LC_MESSAGES/plural_error.mo +0 -0
  223. data/test/locale/fr/LC_MESSAGES/plural.mo +0 -0
  224. data/test/locale/fr/LC_MESSAGES/plural_error.mo +0 -0
  225. data/test/locale/ja/LC_MESSAGES/active_record.mo +0 -0
  226. data/test/locale/ja/LC_MESSAGES/plural.mo +0 -0
  227. data/test/locale/ja/LC_MESSAGES/plural_error.mo +0 -0
  228. data/test/locale/ja/LC_MESSAGES/test_nsgettext.mo +0 -0
  229. data/test/locale/ja/LC_MESSAGES/test_sgettext.mo +0 -0
  230. data/test/locale/la/LC_MESSAGES/plural_error.mo +0 -0
  231. data/test/po/da/plural_error.po +3 -3
  232. data/test/po/fr/plural.po +6 -0
  233. data/test/po/fr/plural_error.po +3 -3
  234. data/test/po/ja/plural.po +6 -0
  235. data/test/po/ja/plural_error.po +2 -2
  236. data/test/po/ja/test_nsgettext.po +65 -0
  237. data/test/po/la/plural_error.po +3 -3
  238. data/test/rails/README +5 -0
  239. data/test/rails/Rakefile +35 -0
  240. data/test/rails/app/controllers/application.rb +8 -0
  241. data/test/rails/app/controllers/articles_controller.rb +61 -0
  242. data/test/rails/app/controllers/mailer_controller.rb +19 -0
  243. data/test/rails/app/helpers/application_helper.rb +3 -0
  244. data/test/rails/app/helpers/articles_helper.rb +2 -0
  245. data/test/rails/app/helpers/mailer_helper.rb +2 -0
  246. data/test/rails/app/models/article.rb +5 -0
  247. data/test/rails/app/models/mailer.rb +38 -0
  248. data/test/rails/app/models/user.rb +3 -0
  249. data/test/rails/app/views/articles/_form.rhtml +13 -0
  250. data/test/rails/app/views/articles/edit.rhtml +9 -0
  251. data/test/rails/app/views/articles/list.rhtml +30 -0
  252. data/test/rails/app/views/articles/list_fr.rhtml +1 -0
  253. data/test/rails/app/views/articles/multi_error_messages_for.rhtml +19 -0
  254. data/test/rails/app/views/articles/new.rhtml +8 -0
  255. data/test/rails/app/views/articles/show.rhtml +28 -0
  256. data/test/rails/app/views/layouts/application.rhtml +14 -0
  257. data/test/rails/app/views/layouts/mailer.rhtml +20 -0
  258. data/test/rails/app/views/mailer/coverpage.rhtml +6 -0
  259. data/test/rails/app/views/mailer/coverpage_fr.rhtml +6 -0
  260. data/test/rails/app/views/mailer/singlepart.rhtml +3 -0
  261. data/test/rails/app/views/mailer/singlepart_fr.rhtml +3 -0
  262. data/test/rails/config/boot.rb +45 -0
  263. data/test/rails/config/database.yml +36 -0
  264. data/test/rails/config/environment.rb +64 -0
  265. data/test/rails/config/environments/development.rb +21 -0
  266. data/test/rails/config/environments/production.rb +18 -0
  267. data/test/rails/config/environments/test.rb +19 -0
  268. data/test/rails/config/routes.rb +23 -0
  269. data/test/rails/db/schema.rb +27 -0
  270. data/test/rails/log/development.log +29 -0
  271. data/test/rails/log/test.log +329 -0
  272. data/test/rails/po/ja/rails_test.po +142 -0
  273. data/test/rails/po/rails_test.pot +147 -0
  274. data/test/rails/public/404.html +30 -0
  275. data/test/rails/public/500.html +30 -0
  276. data/test/rails/public/dispatch.cgi +10 -0
  277. data/test/rails/public/dispatch.fcgi +24 -0
  278. data/test/rails/public/dispatch.rb +10 -0
  279. data/test/rails/public/favicon.ico +0 -0
  280. data/test/rails/public/images/rails.png +0 -0
  281. data/test/rails/public/index.html +277 -0
  282. data/test/rails/public/javascripts/application.js +2 -0
  283. data/test/rails/public/javascripts/controls.js +833 -0
  284. data/test/rails/public/javascripts/dragdrop.js +942 -0
  285. data/test/rails/public/javascripts/effects.js +1088 -0
  286. data/test/rails/public/javascripts/prototype.js +2515 -0
  287. data/test/rails/public/robots.txt +1 -0
  288. data/test/rails/public/stylesheets/scaffold.css +74 -0
  289. data/test/rails/script/about +3 -0
  290. data/test/rails/script/breakpointer +3 -0
  291. data/test/rails/script/console +3 -0
  292. data/test/rails/script/destroy +3 -0
  293. data/test/rails/script/generate +3 -0
  294. data/test/rails/script/performance/benchmarker +3 -0
  295. data/test/rails/script/performance/profiler +3 -0
  296. data/test/rails/script/plugin +3 -0
  297. data/test/rails/script/process/inspector +3 -0
  298. data/test/rails/script/process/reaper +3 -0
  299. data/test/rails/script/process/spawner +3 -0
  300. data/test/rails/script/runner +3 -0
  301. data/test/rails/script/server +3 -0
  302. data/test/rails/test/fixtures/articles.yml +11 -0
  303. data/test/rails/test/functional/articles_controller_test.rb +109 -0
  304. data/test/rails/test/functional/mailer_controller_test.rb +93 -0
  305. data/test/rails/test/integration/general_stories_test.rb +58 -0
  306. data/test/rails/test/result/en/create_error.html +95 -0
  307. data/test/rails/test/result/en/list.html +65 -0
  308. data/test/rails/test/result/en/multi_error_messages_for.html +153 -0
  309. data/test/rails/test/result/en/multipart.html +67 -0
  310. data/test/rails/test/result/en/new.html +95 -0
  311. data/test/rails/test/result/en/show.html +50 -0
  312. data/test/rails/test/result/en/singlepart.html +10 -0
  313. data/test/rails/test/result/fr/list.html +15 -0
  314. data/test/rails/test/result/fr/multipart.html +67 -0
  315. data/test/rails/test/result/fr/singlepart.html +10 -0
  316. data/test/rails/test/result/ja/create_error.html +95 -0
  317. data/test/rails/test/result/ja/list.html +65 -0
  318. data/test/rails/test/result/ja/multi_error_messages_for.html +153 -0
  319. data/test/rails/test/result/ja/multipart.html +67 -0
  320. data/test/rails/test/result/ja/new.html +95 -0
  321. data/test/rails/test/result/ja/show.html +50 -0
  322. data/test/rails/test/result/ja/singlepart.html +10 -0
  323. data/test/rails/test/test_helper.rb +28 -0
  324. data/test/rails/test/unit/article_test.rb +18 -0
  325. data/test/test.sh +4 -0
  326. data/test/test_nsgettext.rb +44 -0
  327. data/test/test_rubyparser_n_.rb +10 -0
  328. metadata +587 -288
data/ChangeLog CHANGED
@@ -1,3 +1,124 @@
1
+ 2007-07-06 Masao Mutoh <mutoh@highway.ne.jp>
2
+
3
+ * lib/gettext/rails.rb: Add to support Action/Fragment caching.
4
+ * test/gettext_test_rails_caching.rb, test.sh: Added the test for caching.
5
+ * NEWS: Updated.
6
+
7
+ 2007-07-05 Masao Mutoh <mutoh@highway.ne.jp>
8
+
9
+ * src/poparser.ry, lib/gettext/poparser.rb:
10
+ Fixed a bug of previous change.
11
+
12
+ 2007-07-04 Masao Mutoh <mutoh@highway.ne.jp>
13
+
14
+ * NEWS: Updated.
15
+ * lib/gettext/version.rb: Increment minor version.
16
+ * lib/gettext/active_record.rb: Work with script/generate
17
+ scaffold_resource. Reported by Bart ten Brinke(Bug#8308)
18
+ * lib/gettext/utils.rb: On the Win32 default environment,
19
+ use "msgmerge" program provided by Ruby-GNOME2 Win32 Installer.
20
+ * lib/gettext/locale_win32.rb: Fix to find a charset from a locale.
21
+
22
+ 2007-07-03 Masao Mutoh <mutoh@highway.ne.jp>
23
+
24
+ * lib/gettext/rails.rb:error_messages_for accept plural models.
25
+ Reported by Florian Hufsky.
26
+ Fixed set_error_message_title|explanation.
27
+ * test/rails/app/model/users.rb, test/rails/test/*: Add tests for
28
+ error_messages_for with plural models.
29
+ * lib/gettext/parser/active_record.rb:
30
+ remove to require 'application.rb' to avoid the effect
31
+ of application.rb when parse models. Pointed out by Michel Loiseleur.
32
+ * po/ca/rails.po: Updated by Ramon Salvadó.
33
+ * src/poparser.ry, lib/gettext/poparser.rb: Don't append
34
+ msgids/msgstrs if the msgstrs don't set.
35
+ * lib/gettext.rb, lib/gettext/parser/ruby.rb:
36
+ Added GetText.nsgettext, ns_. This method has n_ + s_ function.
37
+ (e.g.) ns_("File|A file", "%{num} files", i).
38
+ * test/test_nsgettext.rb, test/po/ja/test_nsgettext.po: Added for
39
+ the test ns_(), nsgettext.
40
+ * lib/gettext/rgettext.rb: Normalize msgids.
41
+ _("Foo") and n_("Foo", "Foos", i) become same msgid "Foo\000Foos".
42
+ This is the same behavior with xgettext.
43
+ Reported by Sava Chankov.
44
+ * lib/gettext/textdomain.rb: Follow above changes.
45
+ _("Foo") matches the single msgid of n_("Foo", "Foos", i).
46
+
47
+ 2007-06-29 Masao Mutoh <mutoh@highway.ne.jp>
48
+
49
+ * lib/gettext.rb: Add GetText.cached=, .cached?, clear_cache.
50
+ messages are cached in default. If the value is false
51
+ or $DEBUG = true then messages are not cached.
52
+ _ and n_ become 1.2-1.9 times faster than older versions.
53
+ * lib/gettext/textdomain.rb, rails.rb: follow the changes
54
+ below.
55
+
56
+ 2007-06-28 Masao Mutoh <mutoh@highway.ne.jp>
57
+
58
+ * README: Updated.
59
+ * po/vi/rails.po: Updated by Ngoc Dao.
60
+ * po/(zh|zh_TW)/rails.po: Updated by Yang Bob.
61
+
62
+ 2007-06-27 Masao Mutoh <mutoh@highway.ne.jp>
63
+
64
+ * po/nl/rails.po: Updated by Menno Jonker
65
+ * po/(bs|hr)/rails.po: Updated by Sanjin Sehic.
66
+ * po/pt_BR/rails.po: Updated by Joao Pedrosa.
67
+ * po/eo/rails.po: Updated by Malte Milatz.
68
+ * po/de/rails.po: Updated by Patrick Lenz.
69
+ * po/fr/rgettext.po, rails.po: Updated by David Sulc.
70
+ * po/et/rails.po: Updated by Erkki Eilonen .
71
+ *
72
+ 2007-06-26 Masao Mutoh <mutoh@highway.ne.jp>
73
+
74
+ * test/rails/*: Added tests for ActionMailer.
75
+
76
+ 2007-04-17 Masao Mutoh <mutoh@highway.ne.jp>
77
+
78
+ * test/rails/* : Added tests for rails.
79
+
80
+ 2007-04-16 Masao Mutoh <mutoh@highway.ne.jp>
81
+
82
+ * lib/gettext/rails.rb: TestRequest#cgi returns GetTextMockGGI, not CGI.
83
+
84
+ 2007-04-08 Masao Mutoh <mutoh@highway.ne.jp>
85
+
86
+ * lib/gettext/active_record.rb: Work ActiveRecord::Base::Validation
87
+ with non ActiveRecord::Base object again. Reported by Maksim Bartenev.
88
+ * test/gettext_test_activerecord.rb: Add a test for the above change.
89
+
90
+ 2007-04-07 Masao Mutoh <mutoh@highway.ne.jp>
91
+
92
+ * **/po/nb/*.po: Added nb locales by Runar Ingebrigtsen.
93
+
94
+ 2007-03-24 Masao Mutoh <mutoh@highway.ne.jp>
95
+
96
+ * **/po/(bs|hr)/*.po: Added bs/hr locales by Sanjin Sehic.
97
+
98
+ 2007-03-23 Masao Mutoh <mutoh@highway.ne.jp>
99
+
100
+ * **/po/vi/*.po: Added vi locale by Ngoc Dao.
101
+
102
+ 2007-02-11 Masao Mutoh <mutoh@highway.ne.jp>
103
+
104
+ * lib/gettext/rails_compat.rb: Added for Rails-1.1.6.
105
+ (Works with both Rails-1.1.6 and 1.2.2)
106
+
107
+ 2007-02-09 Masao Mutoh <mutoh@highway.ne.jp>
108
+
109
+ * po/nl/rails.po: Fixed wrong translations.
110
+ Reported by Bart ten Brinke [Bug #8449]
111
+
112
+ 2007-01-30 Masao Mutoh <mutoh@highway.ne.jp>
113
+
114
+ * po/nl/rails.po: Fixed wrong translations.
115
+ Reported by Dirkjan Bussink
116
+
117
+ 2007-01-25 Masao Mutoh <mutoh@highway.ne.jp>
118
+
119
+ * lib/gettext/active_record.rb: Fixed #columns again.
120
+ [Feature Requests #7428]
121
+
1
122
  2007-01-22 Masao Mutoh <mutoh@highway.ne.jp>
2
123
 
3
124
  * NEWS: Updated.
@@ -29,7 +150,7 @@
29
150
 
30
151
  2006-12-22 Masao Mutoh <mutoh@highway.ne.jp>
31
152
 
32
- * **/po/ca/*.po: Added ca(Catalan) locale by Ramon Salvadó.
153
+ * **/po/ca/*.po: Added ca(Catalan) locale by Ramon Salvad坦.
33
154
 
34
155
  2006-12-17 Masao Mutoh <mutoh@highway.ne.jp>
35
156
 
data/NEWS CHANGED
@@ -1,3 +1,24 @@
1
+ = Ruby-GetText-Package-1.10.0 (2007-07-06)
2
+
3
+ * Support Vietnamese(vi), Bosnian(bs), Croatian(hr), Norwegian(nb)
4
+ * Cache messages. Both _() and n_() become 1.3-1.8 times faster
5
+ than older version.
6
+ * Add GetText.ns_()
7
+ * Fix bugs.
8
+ * Enhance to support Ruby on Rails.
9
+ * Work with script/generate scaffold_resource.
10
+ * error_messages_for accepts plural models.
11
+ * Support Action/Fragment caching.
12
+
13
+ Thanks to:
14
+ Translators:
15
+ Dirkjan Bussink, Bart ten Brinke, Ngoc Dao, Sanjin Sehic,
16
+ Runar Ingebrigtsen, Menno Jonker, Joao Pedrosa, Malte Milatz,
17
+ Patrick Lenz, David Sulc, Erkki Eilonen, Yang Bob, Ramon Salvadó
18
+ Bug reports, suggestions and patches:
19
+ Maksim Bartenev, Bart ten Brinke, Florian Hufsky,
20
+ Michel Loiseleur, Sava Chankov
21
+
1
22
  = Ruby-GetText-Package-1.9.0 (2007-01-22)
2
23
 
3
24
  * Support Catalan(ca), Esperanto(eo)
data/README CHANGED
@@ -98,15 +98,15 @@ License
98
98
  (See the file 'COPYING'.)
99
99
 
100
100
  * mo.rb
101
- Copyright (C) 2001-2006 Masao Mutoh <mutoh at highwhay.ne.jp>
101
+ Copyright (C) 2001-2007 Masao Mutoh <mutoh at highwhay.ne.jp>
102
102
  Copyright (C) 2001,2002 Masahiro Sakai <s01397ms at sfc.keio.ac.jp>
103
103
 
104
104
  * gettext.rb
105
- Copyright (C) 2001-2006 Masao Mutoh <mutoh at highwhay.ne.jp>
105
+ Copyright (C) 2001-2007 Masao Mutoh <mutoh at highwhay.ne.jp>
106
106
  Copyright (C) 2001,2002 Masahiro Sakai <s01397ms at sfc.keio.ac.jp>
107
107
 
108
108
  * rgettext
109
- Copyright (C) 2001-2006 Masao Mutoh <mutoh at highwhay.ne.jp>
109
+ Copyright (C) 2001-2007 Masao Mutoh <mutoh at highwhay.ne.jp>
110
110
  Copyright (C) 2001,2002 Yasushi Shoji <yashi at atmark-techno.com>
111
111
 
112
112
  * setup.rb
@@ -114,22 +114,24 @@ License
114
114
  This file is released under LGPL. See the top of the install.rb.
115
115
 
116
116
  * Others
117
- Copyright (C) 2001-2006 Masao Mutoh <mutoh at highwhay.ne.jp>
117
+ Copyright (C) 2001-2007 Masao Mutoh <mutoh at highwhay.ne.jp>
118
118
 
119
119
 
120
120
  Translators
121
121
  -----------
122
+ Bosnian(bs) - Sanjin Sehic <saserr at gmail.com>
122
123
  Catalan(ca) - Ramon Salvadó <rsalvado at gnuine.com>
123
124
  Chinese(Simplified)(zh_CN) - Yang Bob <bob.yang.dev at gmail.com> (current)
124
125
  Yingfeng <blogyingfeng at gmail.com>
125
126
  Chinese(Traditional)(zh_TW)- Yang Bob <bob.yang.dev at gmail.com> (current)
126
127
  LIN CHUNG-YI <xmarsh at gmail.com>
128
+ Croatian(hr) - Sanjin Sehic <saserr at gmail.com>
127
129
  Czech(cs) - Karel Miarka <kajism at yahoo.com>
128
130
  Dutch(nl) - Menno Jonkers <ruby-gettext at jonkers.com>
129
131
  Esperanto(eo) - Malte Milatz <malte at gmx-topmail.de>
130
132
  Estonian(et) - Erkki Eilonen <erkki at itech.ee>
131
- French(fr) - Laurent Sansonetti <laurent.sansonetti at gmail.com> (current)
132
- David Sulc <davidsulc at gmail.com>
133
+ French(fr) - David Sulc <davidsulc at gmail.com> (current)
134
+ Laurent Sansonetti <laurent.sansonetti at gmail.com>
133
135
  German(de) - Patrick Lenz <patrick at limited-overload.de> (current)
134
136
  Detlef Reichl <detlef.reichl at gmx.org>
135
137
  Sven Herzberg <herzi at abi02.de>
@@ -139,33 +141,39 @@ Italian(it) - Marco Lazzeri <marco.lazzeri at gmail.com>
139
141
  Gabriele Renzi <surrender_it at yahoo.it>
140
142
  Japanese(ja) - Masao Mutoh <mutoh at highway.ne.jp>
141
143
  Korean(ko) - Gyoung-Yoon Noh <nohmad at gmail.com>
144
+ Norwegian(nb) - Runar Ingebrigtsen <runar at mopo.no>
142
145
  Portuguese(Brazil)(pt_BR) - Antonio S. de A. Terceiro <terceiro at softwarelivre.org>
143
146
  Joao Pedrosa <joaopedrosa at gmail.com> (current)
144
147
  Russian(ru) - Yuri Kozlov <kozlov.y at gmail.com>
145
148
  Spanish(es) - David Espada <davinci at escomposlinux.org> (current)
146
149
  David Moreno Garza <damog at damog.net>
147
150
  Swedish(sv) - Nikolai Weibull <mailing-lists.ruby-talk at rawuncut.elitemail.org>
151
+ Vietnamese(vi) - Ngoc Dao <ngocdaothanh at gmail.com>
148
152
 
149
153
  Status of translations
150
154
  ----------------------
151
- Catalan(ca) - 1.9.0 (new)
152
- Chinese(zh_CN) - 1.9.0
153
- Chinese(zh_TW) - 1.9.0
154
- Czech(cs) - 1.9.0
155
- Dutch(nl) - 1.9.0
156
- English(default) - 1.9.0
157
- Esperanto(eo) - 1.9.0 (new)
158
- Estonian(et) - 1.8.0 (rails.po only)
159
- French(fr) - 1.8.0 (old)
160
- German(de) - 1.9.0
161
- Greek(el) - 1.9.0
162
- Spanish(es) - 1.9.0
155
+ Bosnian(bs) - 1.10.0 (new)
156
+ Catalan(ca) - 1.10.0
157
+ Croatian(hr) - 1.10.0 (new)
158
+ Chinese(zh_CN) - 1.10.0
159
+ Chinese(zh_TW) - 1.10.0
160
+ Czech(cs) - 1.9.0 (old)
161
+ Dutch(nl) - 1.10.0
162
+ English(default) - 1.9.0 (old)
163
+ Esperanto(eo) - 1.10.0
164
+ Estonian(et) - 1.10.0 (rails.po only)
165
+ French(fr) - 1.10.0
166
+ German(de) - 1.10.0
167
+ Greek(el) - 1.9.0 (old)
168
+ Spanish(es) - 1.9.0 (old)
163
169
  Italian(it) - 1.6.0 (old)
164
- Japanese(ja) - 1.9.0
165
- Korean(ko) - 1.9.0
166
- Portuguese(Brazil)(pt_BR) - 1.9.0
167
- Russian(ru) - 1.9.0
170
+ Japanese(ja) - 1.10.0
171
+ Korean(ko) - 1.9.0 (old)
172
+ Norwegian(nb) - 1.9.0 (new)
173
+ Portuguese(Brazil)(pt_BR) - 1.10.0
174
+ Russian(ru) - 1.10.0
168
175
  Swedish(sv) - 0.8.0 (old)
176
+ Vietnamese(vi) - 1.10.0 (new)
169
177
 
170
178
  Maintainer
171
179
  ----------
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
data/lib/gettext.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  gettext.rb - GetText module
3
3
 
4
- Copyright (C) 2001-2006 Masao Mutoh
4
+ Copyright (C) 2001-2007 Masao Mutoh
5
5
  Copyright (C) 2001-2003 Masahiro Sakai
6
6
 
7
7
  Masao Mutoh <mutoh@highway.ne.jp>
@@ -10,7 +10,7 @@
10
10
  You may redistribute it and/or modify it under the same
11
11
  license terms as Ruby.
12
12
 
13
- $Id: gettext.rb,v 1.22 2006/12/03 16:26:59 mutoh Exp $
13
+ $Id: gettext.rb,v 1.27 2007/07/05 05:29:28 mutoh Exp $
14
14
  =end
15
15
 
16
16
  require 'rbconfig'
@@ -29,6 +29,29 @@ module GetText
29
29
  mod.extend self
30
30
  end
31
31
 
32
+ @@__cached = true
33
+
34
+ # Set the value whether cache messages or not.
35
+ # true to cache messages, otherwise false.
36
+ #
37
+ # Default is true. If $DEBUG is false, messages are not checked even if
38
+ # this value is true.
39
+ def cached=(val)
40
+ @@__cached = val
41
+ GetText::TextDomain.check_mo = ! val
42
+ end
43
+
44
+ # Return the cached value.
45
+ def cached?
46
+ @@__cached
47
+ end
48
+
49
+ # Clear the cached messages.
50
+ def clear_cache
51
+ @@__cache_msgids = {}
52
+ @@__cache_nmsgids = {}
53
+ end
54
+
32
55
  @@__textdomainmanagers = Hash.new
33
56
 
34
57
  # call-seq:
@@ -156,6 +179,8 @@ module GetText
156
179
  ((ret + klass.ancestors + [GetText]) & @@__textdomainmanagers.keys).uniq
157
180
  end
158
181
 
182
+ @@__cache_msgids = {}
183
+
159
184
  # call-seq:
160
185
  # gettext(msgid)
161
186
  # _(msgid)
@@ -164,14 +189,44 @@ module GetText
164
189
  # * msgid: the message id.
165
190
  # * Returns: localized text by msgid. If there are not binded mo-file, it will return msgid.
166
191
  def gettext(msgid)
167
- ret = nil
192
+ sgettext(msgid, nil)
193
+ end
194
+
195
+ # call-seq:
196
+ # sgettext(msgid, div = '|')
197
+ # s_(msgid, div = '|')
198
+ #
199
+ # Translates msgid, but if there are no localized text,
200
+ # it returns a last part of msgid separeted "div".
201
+ #
202
+ # * msgid: the message id.
203
+ # * div: separator or nil.
204
+ # * Returns: the localized text by msgid. If there are no localized text,
205
+ # it returns a last part of msgid separeted "div".
206
+ # See: http://www.gnu.org/software/gettext/manual/html_mono/gettext.html#SEC151
207
+ def sgettext(msgid, div = '|')
208
+ cached_key = [bound_target, Locale.current, msgid]
209
+ if (@@__cached or ! $DEBUG)
210
+ if @@__cache_msgids.keys.include?(cached_key)
211
+ return @@__cache_msgids[cached_key]
212
+ end
213
+ end
214
+ msg = nil
168
215
  each_textdomain {|textdomain|
169
- ret = textdomain.gettext(msgid)
170
- break if ret
216
+ msg = textdomain.gettext(msgid)
217
+ break if msg
171
218
  }
172
- ret ? ret : msgid
219
+ msg ||= msgid
220
+ if div and msg == msgid
221
+ if index = msg.rindex(div)
222
+ msg = msg[(index + 1)..-1]
223
+ end
224
+ end
225
+ @@__cache_msgids[cached_key] = msg
173
226
  end
174
227
 
228
+ @@__cache_nmsgids = {}
229
+
175
230
  # call-seq:
176
231
  # ngettext(msgid, msgid_plural, n)
177
232
  # ngettext(msgids, n) # msgids = [msgid, msgid_plural]
@@ -187,21 +242,7 @@ module GetText
187
242
  # * Returns: the localized text which key is msgid_plural if n is plural(follow plural-rule) or msgid.
188
243
  # "plural-rule" is defined in po-file.
189
244
  def ngettext(arg1, arg2, arg3 = nil)
190
- if arg1.kind_of?(Array)
191
- msgid = arg1[0]
192
- msgid_plural = arg1[1]
193
- n = arg2
194
- else
195
- msgid = arg1
196
- msgid_plural = arg2
197
- n = arg3
198
- end
199
- ret = nil
200
- each_textdomain {|textdomain|
201
- ret = textdomain.ngettext(msgid, msgid_plural, n)
202
- break if ret
203
- }
204
- ret ? ret : (n == 1 ? msgid : msgid_plural)
245
+ nsgettext(arg1, arg2, arg3, nil)
205
246
  end
206
247
 
207
248
  # This function does nothing. But it is required in order to recognize the msgid by rgettext.
@@ -219,26 +260,66 @@ module GetText
219
260
  [msgid, msgid_plural]
220
261
  end
221
262
 
263
+
222
264
  # call-seq:
223
- # sgettext(msgid, div = '|')
224
- # s_(msgid, div = '|')
265
+ # nsgettext(msgid, msgid_plural, n, div = "|")
266
+ # nsgettext(msgids, n, div = "|") # msgids = [msgid, msgid_plural]
267
+ # n_(msgid, msgid_plural, n, div = "|")
268
+ # n_(msgids, n, div = "|") # msgids = [msgid, msgid_plural]
225
269
  #
226
- # Translates msgid, but if there are no localized text,
270
+ # The nsgettext is similar to the ngettext.
271
+ # But if there are no localized text,
227
272
  # it returns a last part of msgid separeted "div".
228
273
  #
229
- # * msgid: the message id.
230
- # * div: separator or nil.
231
- # * Returns: the localized text by msgid. If there are no localized text,
232
- # it returns a last part of msgid separeted "div".
233
- # See: http://www.gnu.org/software/gettext/manual/html_mono/gettext.html#SEC151
234
- def sgettext(msgid, div = '|')
235
- msg = gettext(msgid)
236
- if msg == msgid
237
- if index = msg.rindex(div)
238
- msg = msg[(index + 1)..-1]
274
+ # * msgid: the singular form with "div". (e.g. "Special|An apple")
275
+ # * msgid_plural: the plural form. (e.g. "%{num} Apples")
276
+ # * n: a number used to determine the plural form.
277
+ # * Returns: the localized text which key is msgid_plural if n is plural(follow plural-rule) or msgid.
278
+ # "plural-rule" is defined in po-file.
279
+ def nsgettext(arg1, arg2, arg3 = "|", arg4 = "|")
280
+ if arg1.kind_of?(Array)
281
+ msgid = arg1[0]
282
+ msgid_plural = arg1[1]
283
+ n = arg2
284
+ if arg3 and arg3.kind_of? Numeric
285
+ raise ArgumentError, _("3rd parmeter is wrong: value = %{number}") % {:number => arg3}
239
286
  end
287
+ div = arg3
288
+ else
289
+ msgid = arg1
290
+ msgid_plural = arg2
291
+ n = arg3
292
+ div = arg4
240
293
  end
241
- msg
294
+
295
+ cached_key = [bound_target, Locale.current, msgid + "\000" + msgid_plural]
296
+ msgs = nil
297
+ if (@@__cached or ! $DEBUG)
298
+ if @@__cache_nmsgids.keys.include?(cached_key)
299
+ msgs = @@__cache_nmsgids[cached_key] # [msgstr, cond_as_string]
300
+ end
301
+ end
302
+ unless msgs
303
+ each_textdomain {|textdomain|
304
+ msgs = textdomain.ngettext_data(msgid, msgid_plural)
305
+ break if msgs
306
+ }
307
+ msgs = [[msgid, msgid_plural], "n != 1"] unless msgs
308
+ @@__cache_nmsgids[cached_key] = msgs
309
+ end
310
+ msgstrs = msgs[0]
311
+ if div and msgstrs[0] == msgid
312
+ if index = msgstrs[0].rindex(div)
313
+ msgstrs[0] = msgstrs[0][(index + 1)..-1]
314
+ end
315
+ end
316
+ plural = eval(msgs[1])
317
+ if plural.kind_of?(Numeric)
318
+ ret = msgstrs[plural]
319
+ else
320
+ ret = plural ? msgstrs[1] : msgstrs[0]
321
+ end
322
+ ret
242
323
  end
243
324
 
244
325
  # Sets the current locale to the current class/module
@@ -391,9 +472,10 @@ module GetText
391
472
  alias :_ :gettext #:nodoc:
392
473
  alias :n_ :ngettext #:nodoc:
393
474
  alias :s_ :sgettext #:nodoc:
475
+ alias :ns_ :nsgettext #:nodoc:
394
476
 
395
- module_function :bindtextdomain, :textdomain, :each_textdomain,
396
- :N_, :gettext, :_, :ngettext, :n_, :sgettext, :s_, :bound_target, :bound_targets,
477
+ module_function :bindtextdomain, :textdomain, :each_textdomain, :cached=, :cached?, :clear_cache,
478
+ :N_, :gettext, :_, :ngettext, :n_, :sgettext, :s_, :nsgettext, :ns_, :bound_target, :bound_targets,
397
479
  :setlocale, :set_locale, :locale=, :set_locale_all, :locale, :charset=, :set_charset,
398
480
  :set_output_charset, :output_charset=, :output_charset, :current_textdomain_info
399
481
  end