gettext 1.9.0 → 1.10.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 (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
@@ -0,0 +1,16 @@
1
+ #
2
+ # This file is for Rails-1.1.6.
3
+ # From activesupport-1.4.1/lib/active_support/core_ext/module/aliasing.rb
4
+ #
5
+ class Module
6
+ unless defined? alias_method_chain
7
+ def alias_method_chain(target, feature)
8
+ # Strip out punctuation on predicates or bang methods since
9
+ # e.g. target?_without_feature is not a valid method name.
10
+ aliased_target, punctuation = target.to_s.sub(/([?!=])$/, ''), $1
11
+ yield(aliased_target, punctuation) if block_given?
12
+ alias_method "#{aliased_target}_without_#{feature}#{punctuation}", target
13
+ alias_method target, "#{aliased_target}_with_#{feature}#{punctuation}"
14
+ end
15
+ end
16
+ end
@@ -25,7 +25,7 @@ module GetText
25
25
 
26
26
  # constant values
27
27
  VERSION = GetText::VERSION
28
- DATE = %w($Date: 2006/12/14 16:35:57 $)[1]
28
+ DATE = %w($Date: 2007/07/02 16:40:18 $)[1]
29
29
  MAX_LINE_LEN = 70
30
30
 
31
31
  @ex_parsers = []
@@ -123,6 +123,41 @@ msgstr ""
123
123
  str
124
124
  end
125
125
 
126
+ def normalize(ary) # :nodoc:
127
+ used_plural_msgs = []
128
+ ary.select{|item| item[0].include? "\000"}.each do |plural_msg|
129
+ next if used_plural_msgs.include?(plural_msg[0])
130
+
131
+ key = plural_msg[0].split("\000")[0]
132
+
133
+ ary.dup.each do |single_msg|
134
+ if single_msg[0] == key or
135
+ (single_msg[0] =~ /#{Regexp.quote(key)}\000/ and
136
+ single_msg[0] != plural_msg[0])
137
+ if single_msg[0] != key
138
+ warn %Q[Warning: n_("#{plural_msg[0].gsub(/\000/, '", "')}") and n_("#{single_msg[0].gsub(/\000/, '", "')}") are duplicated. First msgid was used.]
139
+ used_plural_msgs << single_msg[0]
140
+ end
141
+
142
+ single_msg[1..-1].each do |line_info|
143
+ plural_msg << line_info
144
+ fname = line_info.split(/:/)[0]
145
+ sorted = plural_msg[1..-1].select{|l| l.split(/:/)[0].include?(fname)}.collect{|l|
146
+ aline = l.split(/:/)
147
+ [aline[0], aline[1] =~ /[0-9]+/ ? aline[1].to_i : aline[1]]
148
+ }.sort.collect{|l| "#{l[0]}:#{l[1]}"}
149
+ plural_msg.delete_if{|i| sorted.include?(i)}
150
+ sorted.each {|i|
151
+ plural_msg << i
152
+ }
153
+ end
154
+ ary.delete(single_msg)
155
+ end
156
+ end
157
+ end
158
+ ary.collect{|i| i.uniq}
159
+ end
160
+
126
161
  def parse(files) # :nodoc:
127
162
  ary = []
128
163
  files.each do |file|
@@ -138,8 +173,7 @@ msgstr ""
138
173
  raise
139
174
  end
140
175
  end
141
-
142
- ary
176
+ normalize(ary)
143
177
  end
144
178
 
145
179
  def check_options # :nodoc:
@@ -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: textdomain.rb,v 1.20 2006/09/11 16:30:31 mutoh Exp $
13
+ $Id: textdomain.rb,v 1.22 2007/07/02 16:40:18 mutoh Exp $
14
14
  =end
15
15
 
16
16
  require 'gettext/string'
@@ -116,14 +116,34 @@ module GetText
116
116
  # * Returns: the translated string or nil if not found.
117
117
  def gettext(msgid)
118
118
  return "" if msgid == "" or msgid.nil?
119
- if @current_mo and @current_mo[msgid] and (@current_mo[msgid].size > 0)
120
- @current_mo[msgid]
119
+ return nil unless @current_mo
120
+ if @current_mo[msgid] and (@current_mo[msgid].size > 0)
121
+ @current_mo[msgid]
122
+ elsif msgid.include?("\000")
123
+ ret = nil
124
+ msgid_single = msgid.split("\000")[0]
125
+ @current_mo.each{|key, val|
126
+ if key =~ /^#{Regexp.quote(msgid_single)}\000/
127
+ # Usually, this is not caused to make po-files from rgettext.
128
+ warn %Q[Warning: n_("#{msgid_single}", "#{msgid.split("\000")[1]}") and n_("#{key.gsub(/\000/, '", "')}") are duplicated.] if $DEBUG
129
+ ret = val
130
+ break
131
+ end
132
+ }
133
+ ret
121
134
  else
122
- nil
135
+ ret = nil
136
+ @current_mo.each{|key, val|
137
+ if key =~ /^#{Regexp.quote(msgid)}\000/
138
+ ret = val.split("\000")[0]
139
+ break
140
+ end
141
+ }
142
+ ret
123
143
  end
124
144
  end
125
145
 
126
- # Gets the translated string.
146
+ # Gets the translated string. (Deprecated. Don't call this method directly)
127
147
  # * msgid: the original message(single).
128
148
  # * msgid: the original message(plural).
129
149
  # * n: the number
@@ -132,7 +152,7 @@ module GetText
132
152
  key = msgid + "\000" + msgid_plural
133
153
  msg = gettext(key)
134
154
  if ! msg
135
- nil
155
+ nil # do nothing.
136
156
  elsif msg == key
137
157
  msg = n == 1 ? msgid : msgid_plural
138
158
  elsif msg.include?("\000")
@@ -151,6 +171,25 @@ module GetText
151
171
  msg
152
172
  end
153
173
 
174
+ def ngettext_data(msgid, msgid_plural) #:nodoc:
175
+ key = msgid + "\000" + msgid_plural
176
+ msg = gettext(key)
177
+ ret = nil
178
+ if ! msg
179
+ ret = nil
180
+ elsif msg == key
181
+ ret = nil
182
+ elsif msg.include?("\000")
183
+ # [[msgstr[0], msgstr[1], msgstr[2],...], cond]
184
+ cond = @current_mo ? @current_mo.plural : nil
185
+ cond ||= "n != 1"
186
+ ret = [msg.split("\000"), cond]
187
+ else
188
+ ret = [[msg], "0"]
189
+ end
190
+ ret
191
+ end
192
+
154
193
  # Compare this object has the same name, topdir and locale.
155
194
  # * name: the textdomain name
156
195
  # * topdir: the top directory of mo files or nil.
data/lib/gettext/utils.rb CHANGED
@@ -7,6 +7,13 @@
7
7
  license terms as Ruby.
8
8
  =end
9
9
 
10
+ require 'rbconfig'
11
+ if /mingw|mswin|mswin32/ =~ RUBY_PLATFORM
12
+ ENV['PATH'] = %w(bin lib).collect{|dir|
13
+ "#{Config::CONFIG["prefix"]}\\lib\\GTK\\#{dir};"
14
+ }.join('') + ENV['PATH']
15
+ end
16
+
10
17
  require 'gettext/rgettext'
11
18
  require 'gettext/rmsgfmt'
12
19
  require 'fileutils'
@@ -8,5 +8,5 @@
8
8
  license terms as Ruby.
9
9
  =end
10
10
  module GetText
11
- VERSION = "1.9.0"
11
+ VERSION = "1.10.0"
12
12
  end
data/po/bs/rails.po ADDED
@@ -0,0 +1,148 @@
1
+ # translation of rails.po to Bosnian
2
+ #
3
+ # a po-file for Ruby-GetText-Package and Ruby on Rails.
4
+ #
5
+ # Copyright (C) 2005-2007 Masao Mutoh
6
+ #
7
+ # This file is distributed under the same license as the Ruby-GetText-Package.
8
+ #
9
+ # Sanjin Sehic <saserr at gmail.com>, 2007.
10
+ msgid ""
11
+ msgstr ""
12
+ "Project-Id-Version: rails\n"
13
+ "POT-Creation-Date: 2007-06-26 14:02+0900\n"
14
+ "PO-Revision-Date: 2007-06-26 19:02+0200\n"
15
+ "Last-Translator: Sanjin Sehic <saserr at gmail.com>\n"
16
+ "Language-Team: Bosnian <saserr at gmail.com>\n"
17
+ "MIME-Version: 1.0\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
19
+ "Content-Transfer-Encoding: 8bit\n"
20
+ "Plural-Forms: n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
21
+ "X-Generator: KBabel 1.11.4\n"
22
+
23
+ #: lib/gettext/rails.rb:293
24
+ msgid "%{num} error prohibited this %{record} from being saved"
25
+ msgid_plural "%{num} errors prohibited this %{record} from being saved"
26
+ msgstr[0] "%{num} greška je spriječila %{record} od spašavanja"
27
+ msgstr[1] "%{num} greške su spriječile %{record} od spašavanja"
28
+ msgstr[2] "%{num} grešaka su spriječile %{record} od spašavanja"
29
+
30
+ #: lib/gettext/rails.rb:295
31
+ msgid "There was a problem with the following field:"
32
+ msgid_plural "There were problems with the following fields:"
33
+ msgstr[0] "Postoji problem u sljedečem polju:"
34
+ msgstr[1] "Postoje problemi u sljedečim poljima:"
35
+ msgstr[2] "Postoje problemi u sljedečim poljima:"
36
+
37
+ #: lib/gettext/rails.rb:382
38
+ msgid "less than 5 seconds"
39
+ msgstr "manje od 5 sekundi"
40
+
41
+ #: lib/gettext/rails.rb:382
42
+ msgid "less than 10 seconds"
43
+ msgstr "manje od 10 sekundi"
44
+
45
+ #: lib/gettext/rails.rb:382
46
+ msgid "less than 20 seconds"
47
+ msgstr "manje od 20 sekundi"
48
+
49
+ #: lib/gettext/rails.rb:383
50
+ msgid "half a minute"
51
+ msgstr "pola minute"
52
+
53
+ #: lib/gettext/rails.rb:383
54
+ msgid "less than a minute"
55
+ msgstr "manje od minute"
56
+
57
+ #: lib/gettext/rails.rb:383
58
+ msgid "about 1 month"
59
+ msgstr "oko 1 mjesec"
60
+
61
+ #: lib/gettext/rails.rb:384
62
+ msgid "about 1 year"
63
+ msgstr "oko godinu dana"
64
+
65
+ #: lib/gettext/rails.rb:384
66
+ msgid "over 2 years"
67
+ msgstr "preko 2 godine"
68
+
69
+ #: lib/gettext/rails.rb:385
70
+ msgid "1 minute"
71
+ msgid_plural "%{num} minutes"
72
+ msgstr[0] "1 minuta"
73
+ msgstr[1] "%{num} minute"
74
+ msgstr[2] "%{num} minuta"
75
+
76
+ #: lib/gettext/rails.rb:386
77
+ msgid "about 1 hour"
78
+ msgid_plural "about %{num} hours"
79
+ msgstr[0] "oko 1 sat"
80
+ msgstr[1] "oko %{num} sata"
81
+ msgstr[2] "oko %{num} sati"
82
+
83
+ #: lib/gettext/rails.rb:387
84
+ msgid "1 day"
85
+ msgid_plural "%{num} days"
86
+ msgstr[0] "1 dan"
87
+ msgstr[1] "%{num} dana"
88
+ msgstr[2] "%{num} dana"
89
+
90
+ #: lib/gettext/rails.rb:388
91
+ msgid "1 month"
92
+ msgid_plural "%{num} months"
93
+ msgstr[0] "1 mjesec"
94
+ msgstr[1] "%{num} mjeseca"
95
+ msgstr[2] "%{num} mjeseci"
96
+
97
+ #: lib/gettext/active_record.rb:28
98
+ msgid "Validation failed: %{error_messages}"
99
+ msgstr "Provjera nije uspjela: %{error_messages}"
100
+
101
+ #: lib/gettext/active_record.rb:215
102
+ msgid "%{fn} is not included in the list"
103
+ msgstr "%{fn} nije u listi"
104
+
105
+ #: lib/gettext/active_record.rb:216
106
+ msgid "%{fn} is reserved"
107
+ msgstr "%{fn} je rezervisano"
108
+
109
+ #: lib/gettext/active_record.rb:217
110
+ msgid "%{fn} is invalid"
111
+ msgstr "%{fn} je pogrešan"
112
+
113
+ #: lib/gettext/active_record.rb:218
114
+ msgid "%{fn} doesn't match confirmation"
115
+ msgstr "%{fn} se ne podudara sa potvrdom"
116
+
117
+ #: lib/gettext/active_record.rb:219
118
+ msgid "%{fn} must be accepted"
119
+ msgstr "%{fn} se mora prihvatiti"
120
+
121
+ #: lib/gettext/active_record.rb:220
122
+ msgid "%{fn} can't be empty"
123
+ msgstr "%{fn} ne može biti prazan"
124
+
125
+ #: lib/gettext/active_record.rb:221
126
+ msgid "%{fn} can't be blank"
127
+ msgstr "%{fn} ne može biti prazan"
128
+
129
+ #: lib/gettext/active_record.rb:222
130
+ msgid "%{fn} is too long (maximum is %d characters)"
131
+ msgstr "%{fn} je previše dugo (maksimum je %d karaktera)"
132
+
133
+ #: lib/gettext/active_record.rb:223
134
+ msgid "%{fn} is too short (minimum is %d characters)"
135
+ msgstr "%{fn} nije dovoljno dugo (maksimum je %d karaktera)"
136
+
137
+ #: lib/gettext/active_record.rb:224
138
+ msgid "%{fn} is the wrong length (should be %d characters)"
139
+ msgstr "%{fn} je pogrešne dužine (trebalo bi biti %d karaktera)"
140
+
141
+ #: lib/gettext/active_record.rb:225
142
+ msgid "%{fn} has already been taken"
143
+ msgstr "%{fn} se već koristi"
144
+
145
+ #: lib/gettext/active_record.rb:226
146
+ msgid "%{fn} is not a number"
147
+ msgstr "%{fn} nije broj"
148
+
data/po/bs/rgettext.po ADDED
@@ -0,0 +1,131 @@
1
+ # translation of rgettext.po to Bosnian
2
+ #
3
+ # a po-file for Ruby-GetText-Package
4
+ #
5
+ # Copyright (C) 2004-2006 Masao Mutoh
6
+ # This file is distributed under the same license as the Ruby-GetText-Package.
7
+ #
8
+ # Sanjin Sehic <saserr@gmail.com>, 2007.
9
+ msgid ""
10
+ msgstr ""
11
+ "Project-Id-Version: ruby-gettext 1.9.0\n"
12
+ "POT-Creation-Date: 2007-06-26 14:09+0900\n"
13
+ "PO-Revision-Date: 2007-03-17 16:19+0100\n"
14
+ "Last-Translator: Sanjin Sehic <saserr@gmail.com>\n"
15
+ "Language-Team: Bosnian <saserr@gmail.com>\n"
16
+ "MIME-Version: 1.0\n"
17
+ "Content-Type: text/plain; charset=UTF-8\n"
18
+ "Content-Transfer-Encoding: 8bit\n"
19
+ "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
20
+ "10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
21
+ "X-Generator: KBabel 1.11.4\n"
22
+
23
+ #: lib/gettext/utils.rb:52
24
+ msgid "Failed to merge with %{defpo} - skipping!"
25
+ msgstr "Spajanje sa %{defpo} nije uspjelo - nastavljam dalje!"
26
+
27
+ #: lib/gettext/utils.rb:53
28
+ msgid "Please check new .pot in %{failed_filename}"
29
+ msgstr "Molim da provjerite novi .pot u %{failed_filename}"
30
+
31
+ #: lib/gettext/rmsgfmt.rb:31 lib/gettext/rgettext.rb:196
32
+ msgid "no input files"
33
+ msgstr "nema ulaznih datoteka"
34
+
35
+ #: lib/gettext/rmsgfmt.rb:47
36
+ msgid "Usage: %s input.po [-o output.mo]"
37
+ msgstr "Korištenje: %s ulaz.po [-o izlaz.mo]"
38
+
39
+ #: lib/gettext/rmsgfmt.rb:49
40
+ msgid "Generate binary message catalog from textual translation description."
41
+ msgstr "Generiši binarni katalog poruka iz tekstualnog opisa prevoda"
42
+
43
+ #: lib/gettext/rmsgfmt.rb:51 lib/gettext/rmsgmerge.rb:408
44
+ #: lib/gettext/rgettext.rb:153
45
+ msgid "Specific options:"
46
+ msgstr "Specifične opcije:"
47
+
48
+ #: lib/gettext/rmsgfmt.rb:53 lib/gettext/rmsgmerge.rb:410
49
+ #: lib/gettext/rgettext.rb:155
50
+ msgid "write output to specified file"
51
+ msgstr "zapiši izlaz u specifičnu datoteku"
52
+
53
+ #: lib/gettext/rmsgfmt.rb:57 lib/gettext/rmsgmerge.rb:421
54
+ #: lib/gettext/rgettext.rb:172
55
+ msgid "display version information and exit"
56
+ msgstr "prikaži informaciju o verziji i završi"
57
+
58
+ #: lib/gettext/rmsgmerge.rb:403
59
+ msgid "Usage: %s def.po ref.pot [-o output.pot]"
60
+ msgstr "Korištenje: %s def.po ref.pot [-o izlaz.pot]"
61
+
62
+ #: lib/gettext/rmsgmerge.rb:406
63
+ msgid ""
64
+ "Merges two Uniforum style .po files together. The def.po file is an existing "
65
+ "PO file with translations. The ref.pot file is the last created PO file with "
66
+ "up-to-date source references. ref.pot is generally created by rgettext."
67
+ msgstr ""
68
+ "Spaja dvije Uniforum style .po datoteke skupa. def.po datoteka je već "
69
+ "postojeća PO datoteka sa prevodima. ref.pot je zadnja napravljena PO "
70
+ "datoteka sa najnovijim referencama koda. ref.pot je najčešće napravljen sa "
71
+ "rgettext."
72
+
73
+ #: lib/gettext/rmsgmerge.rb:447
74
+ msgid "definition po is not given."
75
+ msgstr "definicijski po nije dat."
76
+
77
+ #: lib/gettext/rmsgmerge.rb:449
78
+ msgid "reference pot is not given."
79
+ msgstr "referencni po nije dat."
80
+
81
+ #: lib/gettext/parser/glade.rb:74
82
+ msgid "`%{file}' is not glade-2.0 format."
83
+ msgstr "'%{file}' nije glade-2.0 format."
84
+
85
+ #: lib/gettext/parser/active_record.rb:39
86
+ msgid "'%{file}' is not found."
87
+ msgstr "'%{file} nije pronađen."
88
+
89
+ #: lib/gettext/parser/active_record.rb:80
90
+ msgid "Ignored '%{file}'. Solve dependencies first."
91
+ msgstr "Ignorisano '%{file}'. Riješi prvo zavisnosti."
92
+
93
+ #: lib/gettext/parser/active_record.rb:104
94
+ msgid "No database is available."
95
+ msgstr "Databaza nije dostupna."
96
+
97
+ #: lib/gettext/parser/active_record.rb:138
98
+ msgid "rubygems are not found."
99
+ msgstr "rubygems se ne mogu pronaći."
100
+
101
+ #: lib/gettext/rgettext.rb:43
102
+ msgid "'%{klass}' is ignored."
103
+ msgstr "%{klass} je ignorisan."
104
+
105
+ #: lib/gettext/rgettext.rb:149
106
+ msgid "Usage: %s input.rb [-r parser.rb] [-o output.pot]"
107
+ msgstr "Korištenje: %s ulaz.rb [-r parser.rb] [-o izlaz.pot]"
108
+
109
+ #: lib/gettext/rgettext.rb:151
110
+ msgid "Extract translatable strings from given input files."
111
+ msgstr "Izvadi niske za prevođenje iz date ulazne datoteke."
112
+
113
+ #: lib/gettext/rgettext.rb:159
114
+ msgid "File '%s' already exists."
115
+ msgstr "Datoteka '%s' već postoji."
116
+
117
+ #: lib/gettext/rgettext.rb:164
118
+ msgid "require the library before executing rgettext"
119
+ msgstr "zahtjevaj biblioteku prije izvršavanja rgettext-a"
120
+
121
+ #: lib/gettext/rgettext.rb:168
122
+ msgid "run in debugging mode"
123
+ msgstr "pokreni u modu za nalaženje grešaka"
124
+
125
+ #: src/poparser.ry:26 src/poparser.ry:41
126
+ msgid "Warning: fuzzy message was ignored.\n"
127
+ msgstr "Upozorenje: čudna poruka je ignorisana.\n"
128
+
129
+ #: src/poparser.ry:125
130
+ msgid "Warning: obsolete msgid exists.\n"
131
+ msgstr "Upozorenje: nekorišteni msgid postoji.\n"