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
@@ -0,0 +1,104 @@
1
+ # GetText Sample Blog on RoR.
2
+ # Copyright (C) 2005,2006 Masao Mutoh
3
+ # This file is distributed under the same license as the Ruby-GetText-Package.
4
+ #
5
+ # Runar Ingebrigtsen <runar at mopo.no>, 2007.
6
+ #
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: blog 1.2.0\n"
10
+ "POT-Creation-Date: 2006-10-15 00:12+0900\n"
11
+ "PO-Revision-Date: 2007-04-03 13:24+0200\n"
12
+ "Last-Translator: Runar Ingebrigtsen\n"
13
+ "Language-Team: Norwegian\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+
19
+ #: app/helpers/blog_helper.rb:43
20
+ msgid "Ruby Links"
21
+ msgstr "Rubylenker"
22
+
23
+ #: app/helpers/blog_helper.rb:51
24
+ msgid "Old articles"
25
+ msgstr "Gamle artikler"
26
+
27
+ #: app/models/article.rb:-
28
+ msgid "article"
29
+ msgstr "artikkel"
30
+
31
+ #: app/models/article.rb:-
32
+ msgid "Article|Title"
33
+ msgstr "Tittel"
34
+
35
+ #: app/models/article.rb:-
36
+ msgid "Article|Description"
37
+ msgstr "Beskrivelse"
38
+
39
+ #: app/models/article.rb:-
40
+ msgid "Article|Lastupdate"
41
+ msgstr "Siste oppdatering"
42
+
43
+ #: app/controllers/blog_controller.rb:33
44
+ msgid "Article was successfully created."
45
+ msgstr "Artikkelen ble opprettet"
46
+
47
+ #: app/controllers/blog_controller.rb:47
48
+ msgid "Article was successfully updated."
49
+ msgstr "Artikkelen ble oppdatert"
50
+
51
+ #: app/views/blog/new.rhtml:13 app/views/blog/list.rhtml:15
52
+ msgid "New article"
53
+ msgstr "Ny artikkel"
54
+
55
+ #: app/views/blog/new.rhtml:17
56
+ msgid "Create"
57
+ msgstr "Opprett"
58
+
59
+ #: app/views/blog/new.rhtml:20 app/views/blog/edit.rhtml:21
60
+ #: app/views/blog/show.rhtml:17
61
+ msgid "Back"
62
+ msgstr "Tilbake"
63
+
64
+ #: app/views/blog/_form.rhtml:16
65
+ msgid "Lastupdate"
66
+ msgstr "Siste oppdatering"
67
+
68
+ #: app/views/blog/_form.rhtml:18
69
+ msgid "Title: Required."
70
+ msgstr "Tittel: Påkrevd."
71
+
72
+ #: app/views/blog/_form.rhtml:21
73
+ msgid "Description: More than 10 characters."
74
+ msgstr "Beskrivelse: Mer enn 10 tegn."
75
+
76
+ #: app/views/blog/list.rhtml:13 app/views/blog/show.rhtml:13
77
+ #: app/views/layouts/blog.rhtml:14
78
+ msgid "GetText Sample Blog on RoR"
79
+ msgstr "GetText eksempelblogg i Rails"
80
+
81
+ #: app/views/blog/list.rhtml:18
82
+ msgid "No articles were found."
83
+ msgstr "Ingen artikler funnet."
84
+
85
+ #: app/views/blog/edit.rhtml:12
86
+ msgid "Editing article"
87
+ msgstr "Endrer artikkel"
88
+
89
+ #: app/views/blog/edit.rhtml:16 app/views/blog/show.rhtml:16
90
+ msgid "Edit"
91
+ msgstr "Endre"
92
+
93
+ #: app/views/blog/edit.rhtml:19
94
+ msgid "Show"
95
+ msgstr "Vis"
96
+
97
+ #: app/views/blog/edit.rhtml:20
98
+ msgid "Destroy"
99
+ msgstr "Slett"
100
+
101
+ #: app/views/blog/edit.rhtml:20
102
+ msgid "Are you sure?"
103
+ msgstr "Er du sikker?"
104
+
@@ -0,0 +1,110 @@
1
+ # GetText Sample Blog on RoR.
2
+ #
3
+ # Copyright (C) 2005,2006 Masao Mutoh
4
+ #
5
+ # This file is distributed under the same license as the Ruby-GetText-Package.
6
+ #
7
+ # Ngoc DAO Thanh <ngocdaothanh at gmail.com>, 2007.
8
+ #
9
+ msgid ""
10
+ msgstr ""
11
+ "Project-Id-Version: blog 1.2.0\n"
12
+ "POT-Creation-Date: 2006-10-15 00:12+0900\n"
13
+ "PO-Revision-Date: 2007-03-21 10:10+0900\n"
14
+ "Last-Translator: Ngoc DAO Thanh <ngocdaothanh at gmail.com>\n"
15
+ "Language-Team: Vietnamese\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=2; plural=(n != 1);\n"
20
+
21
+ #: app/helpers/blog_helper.rb:43
22
+ msgid "Ruby Links"
23
+ msgstr "Liên kết Ruby"
24
+
25
+ #: app/helpers/blog_helper.rb:51
26
+ msgid "Old articles"
27
+ msgstr "Những bài viết cũ"
28
+
29
+ #: app/models/article.rb:-
30
+ msgid "article"
31
+ msgstr "bài viết"
32
+
33
+ #: app/models/article.rb:-
34
+ msgid "Article|Title"
35
+ msgstr "Tiêu đề"
36
+
37
+ #: app/models/article.rb:-
38
+ msgid "Article|Description"
39
+ msgstr "Miêu tả"
40
+
41
+ #: app/models/article.rb:-
42
+ msgid "Article|Lastupdate"
43
+ msgstr "Lần cập nhật trước"
44
+
45
+ #: app/controllers/blog_controller.rb:33
46
+ msgid "Article was successfully created."
47
+ msgstr "Bài viết đã được tạo thành công."
48
+
49
+ #: app/controllers/blog_controller.rb:47
50
+ msgid "Article was successfully updated."
51
+ msgstr "Bài viết đã được cập nhật thành công"
52
+
53
+ #: app/views/blog/new.rhtml:13
54
+ #: app/views/blog/list.rhtml:15
55
+ msgid "New article"
56
+ msgstr "Bài viết mới"
57
+
58
+ #: app/views/blog/new.rhtml:17
59
+ msgid "Create"
60
+ msgstr "Tạo"
61
+
62
+ #: app/views/blog/new.rhtml:20
63
+ #: app/views/blog/edit.rhtml:21
64
+ #: app/views/blog/show.rhtml:17
65
+ msgid "Back"
66
+ msgstr "Quay lui"
67
+
68
+ #: app/views/blog/_form.rhtml:16
69
+ msgid "Lastupdate"
70
+ msgstr "Lần cập nhật trước"
71
+
72
+ #: app/views/blog/_form.rhtml:18
73
+ msgid "Title: Required."
74
+ msgstr "Tiêu đề: Phải có."
75
+
76
+ #: app/views/blog/_form.rhtml:21
77
+ msgid "Description: More than 10 characters."
78
+ msgstr "Miêu tả: Nhiều hơn 10 kí tự."
79
+
80
+ #: app/views/blog/list.rhtml:13
81
+ #: app/views/blog/show.rhtml:13
82
+ #: app/views/layouts/blog.rhtml:14
83
+ msgid "GetText Sample Blog on RoR"
84
+ msgstr "Ví dụ mẫu về Blog dùng GetText trong RoR"
85
+
86
+ #: app/views/blog/list.rhtml:18
87
+ msgid "No articles were found."
88
+ msgstr "Không tìm thấy bài viết nào."
89
+
90
+ #: app/views/blog/edit.rhtml:12
91
+ msgid "Editing article"
92
+ msgstr "Soạn bài viết"
93
+
94
+ #: app/views/blog/edit.rhtml:16
95
+ #: app/views/blog/show.rhtml:16
96
+ msgid "Edit"
97
+ msgstr "Soạn"
98
+
99
+ #: app/views/blog/edit.rhtml:19
100
+ msgid "Show"
101
+ msgstr "Hiển thị"
102
+
103
+ #: app/views/blog/edit.rhtml:20
104
+ msgid "Destroy"
105
+ msgstr "Xóa"
106
+
107
+ #: app/views/blog/edit.rhtml:20
108
+ msgid "Are you sure?"
109
+ msgstr "Bạn có chắc chắn không?"
110
+
@@ -0,0 +1,27 @@
1
+ # translation of gettext_plugin.po to Bosnian
2
+ # GetText Sample Blog on RoR.
3
+ # Copyright (C) 2005 Masao Mutoh
4
+ # This file is distributed under the same license as the Ruby-GetText-Package.
5
+ #
6
+ # Sanjin Sehic <saserr@gmail.com>, 2007.
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: gettext_plugin\n"
10
+ "POT-Creation-Date: 2006-05-31 02:06+0900\n"
11
+ "PO-Revision-Date: 2007-03-20 20:17+0100\n"
12
+ "Last-Translator: Sanjin Sehic <saserr@gmail.com>\n"
13
+ "Language-Team: Bosnian <saserr@gmail.com>\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
18
+ "X-Generator: KBabel 1.11.4\n"
19
+
20
+ #: lib/gettext_plugin.rb:18
21
+ msgid "Select locale"
22
+ msgstr "Izaberi lokal"
23
+
24
+ #: lib/gettext_plugin.rb:30
25
+ msgid "Cookie &quot;lang&quot; is set: %s"
26
+ msgstr "Cookie &quot;lang&quot; je postavljen: %s"
27
+
@@ -0,0 +1,27 @@
1
+ # translation of gettext_plugin.po to Croatian
2
+ # GetText Sample Blog on RoR.
3
+ # Copyright (C) 2005 Masao Mutoh
4
+ # This file is distributed under the same license as the Ruby-GetText-Package.
5
+ #
6
+ # Sanjin Sehic <saserr@gmail.com>, 2007.
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: gettext_plugin\n"
10
+ "POT-Creation-Date: 2006-05-31 02:06+0900\n"
11
+ "PO-Revision-Date: 2007-03-20 20:17+0100\n"
12
+ "Last-Translator: Sanjin Sehic <saserr@gmail.com>\n"
13
+ "Language-Team: Croatian <saserr@gmail.com>\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
18
+ "X-Generator: KBabel 1.11.4\n"
19
+
20
+ #: lib/gettext_plugin.rb:18
21
+ msgid "Select locale"
22
+ msgstr "Izaberi lokal"
23
+
24
+ #: lib/gettext_plugin.rb:30
25
+ msgid "Cookie &quot;lang&quot; is set: %s"
26
+ msgstr "Cookie &quot;lang&quot; je postavljen: %s"
27
+
@@ -0,0 +1,27 @@
1
+ # GetText Sample Blog on RoR.
2
+ # Copyright (C) 2005 Masao Mutoh
3
+ # This file is distributed under the same license as the Ruby-GetText-Package.
4
+ #
5
+ # Runar Ingebrigtsen <runar at mopo.no>, 2007.
6
+ #
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: gettext_plugin 1.2.0\n"
10
+ "POT-Creation-Date: 2006-05-31 02:06+0900\n"
11
+ "PO-Revision-Date: 2007-04-03 13:25+0200\n"
12
+ "Last-Translator: Runar Ingebrigtsen\n"
13
+ "Language-Team: Norwegian\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+
19
+
20
+ #: lib/gettext_plugin.rb:18
21
+ msgid "Select locale"
22
+ msgstr "Velg språk"
23
+
24
+ #: lib/gettext_plugin.rb:30
25
+ msgid "Cookie &quot;lang&quot; is set: %s"
26
+ msgstr "Informasjonskapsel &quot;lang&quot; er satt: %s"
27
+
@@ -0,0 +1,28 @@
1
+ # GetText Sample Blog on RoR.
2
+ #
3
+ # Copyright (C) 2005 Masao Mutoh
4
+ #
5
+ # This file is distributed under the same license as the Ruby-GetText-Package.
6
+ #
7
+ # Ngoc DAO Thanh <ngocdaothanh at gmail.com>, 2007.
8
+ #
9
+ msgid ""
10
+ msgstr ""
11
+ "Project-Id-Version: gettext_plugin 1.2.0\n"
12
+ "POT-Creation-Date: 2006-05-31 02:06+0900\n"
13
+ "PO-Revision-Date: 2007-03-21 10:13+0900\n"
14
+ "Last-Translator: Ngoc DAO Thanh <ngocdaothanh at gmail.com>\n"
15
+ "Language-Team: Vietnamese\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=2; plural=(n != 1);\n"
20
+
21
+ #: lib/gettext_plugin.rb:18
22
+ msgid "Select locale"
23
+ msgstr "Chọn ngôn ngữ"
24
+
25
+ #: lib/gettext_plugin.rb:30
26
+ msgid "Cookie &quot;lang&quot; is set: %s"
27
+ msgstr "Cookie &quot;lang&quot; được đặt là: %s"
28
+
data/src/poparser.ry CHANGED
@@ -54,7 +54,11 @@ class GetText::PoParser
54
54
  msgstr_plural
55
55
  : msgstr_plural msgstr_plural_line
56
56
  {
57
- result = val[0] + "\000" + val[1]
57
+ if val[0].size > 0
58
+ result = val[0] + "\000" + val[1]
59
+ else
60
+ result = ""
61
+ end
58
62
  }
59
63
  | msgstr_plural_line
60
64
  ;
@@ -158,9 +162,10 @@ end
158
162
  end
159
163
 
160
164
  def on_message(msgid, msgstr)
161
- @data[msgid] = msgstr
162
-
163
- @data.set_comment(msgid, @comments.join("\n"))
165
+ if msgstr.size > 0
166
+ @data[msgid] = msgstr
167
+ @data.set_comment(msgid, @comments.join("\n"))
168
+ end
164
169
  @comments.clear
165
170
  end
166
171
 
data/test/README CHANGED
@@ -14,3 +14,5 @@ rake createdb # Build the MySQL test databases
14
14
  rake dropdb # Drop the MySQL test databases
15
15
  rake rebuilddb # Rebuild the MySQL test databases
16
16
 
17
+
18
+ See rails/README to test rails application.
data/test/Rakefile CHANGED
@@ -3,6 +3,8 @@ require 'gettext/utils'
3
3
  desc "Create mo files"
4
4
  task :makemo do
5
5
  GetText.create_mofiles(true, "po", "locale")
6
+ GetText.create_mofiles(true, "rails/po", "rails/locale")
7
+ mkdir "rails/log" unless File.exists? "rails/log"
6
8
  end
7
9
 
8
10
  SCHEMA_PATH = File.join(File.dirname(__FILE__), "db")
@@ -0,0 +1,4 @@
1
+ DROP TABLE topics;
2
+ DROP TABLE developers;
3
+ DROP TABLE books;
4
+ DROP TABLE users;
data/test/db/mysql.sql ADDED
@@ -0,0 +1,44 @@
1
+ CREATE TABLE `topics` (
2
+ `id` int(11) NOT NULL auto_increment,
3
+ `title` varchar(255) default NULL,
4
+ `author_name` varchar(255) default NULL,
5
+ `author_email_address` varchar(255) default NULL,
6
+ `written_on` datetime default NULL,
7
+ `bonus_time` time default NULL,
8
+ `last_read` date default NULL,
9
+ `content` text,
10
+ `approved` tinyint(1) default 1,
11
+ `replies_count` int(11) default 0,
12
+ `parent_id` int(11) default NULL,
13
+ `type` varchar(50) default NULL,
14
+ PRIMARY KEY (`id`)
15
+ ) TYPE=InnoDB;
16
+
17
+ CREATE TABLE `developers` (
18
+ `id` int(11) NOT NULL auto_increment,
19
+ `name` varchar(100) default NULL,
20
+ `salary` int(11) default 70000,
21
+ `created_at` datetime default NULL,
22
+ `updated_at` datetime default NULL,
23
+ PRIMARY KEY (`id`)
24
+ ) TYPE=InnoDB;
25
+
26
+ CREATE TABLE `books` (
27
+ `id` int(11) NOT NULL auto_increment,
28
+ `title` varchar(100) default NULL,
29
+ `price` int(11) default 70000,
30
+ `created_at` datetime default NULL,
31
+ `updated_at` datetime default NULL,
32
+ PRIMARY KEY (`id`)
33
+ ) TYPE=InnoDB;
34
+
35
+ CREATE TABLE `users` (
36
+ `id` int(11) NOT NULL auto_increment,
37
+ `first_name` varchar(100) default NULL,
38
+ `last_name` varchar(100) default NULL,
39
+ `created_at` datetime default NULL,
40
+ `updated_at` datetime default NULL,
41
+ PRIMARY KEY (`id`)
42
+ ) TYPE=InnoDB;
43
+
44
+
data/test/gettext_test.rb CHANGED
@@ -9,6 +9,7 @@ require 'testlib4.rb'
9
9
  require 'testlib6.rb'
10
10
  require 'test_rubyparser.rb'
11
11
  require 'test_sgettext.rb'
12
+ require 'test_nsgettext.rb'
12
13
 
13
14
  class TestGetText < Test::Unit::TestCase
14
15
  include GetText
@@ -54,7 +55,7 @@ class TestGetText < Test::Unit::TestCase
54
55
  assert_equal("japanese", _("language"))
55
56
  end
56
57
 
57
- def test_gettext
58
+ def test_empty
58
59
  set_locale(nil)
59
60
  bindtextdomain("test1", "locale")
60
61
  assert_equal("japanese", gettext("language"))
@@ -117,6 +118,7 @@ DDD
117
118
  def test_sgettext
118
119
  GetText.locale = nil
119
120
  testlib5 = TestSGetText.new
121
+
120
122
  assert_equal("MATCHED", testlib5.test_1)
121
123
  assert_equal("MATCHED", testlib5.test_2)
122
124
  assert_equal("AAA", testlib5.test_3)
@@ -128,6 +130,20 @@ DDD
128
130
  assert_equal("BBB", testlib5.test_9)
129
131
  end
130
132
 
133
+ def test_nsgettext
134
+ GetText.locale = nil
135
+ testlib5 = TestNSGetText.new
136
+ assert_equal(["single", "plural"], testlib5.test_1)
137
+ assert_equal(["single", "plural"], testlib5.test_2)
138
+ assert_equal(["AAA", "BBB"], testlib5.test_3)
139
+ assert_equal(["CCC", "DDD"], testlib5.test_4)
140
+ assert_equal(["CCC", "DDD"], testlib5.test_5)
141
+ assert_equal(["BBB", "CCC"], testlib5.test_6)
142
+ assert_equal(["B|BB", "CCC"], testlib5.test_7)
143
+ assert_equal(["single", "plural"], testlib5.test_8)
144
+ assert_equal(["BBB", "DDD"], testlib5.test_9)
145
+ end
146
+
131
147
  def test_plural
132
148
  GetText.locale = nil
133
149
  bindtextdomain("plural", "locale", "ja")
@@ -184,22 +200,22 @@ DDD
184
200
  setlocale(nil)
185
201
  bindtextdomain("plural_error", "locale", "ja")
186
202
  #If it defines msgstr[0] only, msgstr[0] is used everytime.
187
- assert_equal("a", n_("one", "two", 0))
188
- assert_equal("a", n_("one", "two", 1))
189
- assert_equal("a", n_("one", "two", 2))
203
+ assert_equal("a", n_("first", "second", 0))
204
+ assert_equal("a", n_("first", "second", 1))
205
+ assert_equal("a", n_("first", "second", 2))
190
206
  # Use default(plural = 0)
191
207
  setlocale("fr")
192
- assert_equal("fr_one", n_("one", "two", 0))
193
- assert_equal("fr_one", n_("one", "two", 1))
194
- assert_equal("fr_one", n_("one", "two", 2))
208
+ assert_equal("fr_first", n_("first", "second", 0))
209
+ assert_equal("fr_first", n_("first", "second", 1))
210
+ assert_equal("fr_first", n_("first", "second", 2))
195
211
  setlocale("da")
196
- assert_equal("da_one", n_("one", "two", 0))
197
- assert_equal("da_one", n_("one", "two", 1))
198
- assert_equal("da_one", n_("one", "two", 2))
212
+ assert_equal("da_first", n_("first", "second", 0))
213
+ assert_equal("da_first", n_("first", "second", 1))
214
+ assert_equal("da_first", n_("first", "second", 2))
199
215
  setlocale("la")
200
- assert_equal("la_one", n_("one", "two", 0))
201
- assert_equal("la_one", n_("one", "two", 1))
202
- assert_equal("la_one", n_("one", "two", 2))
216
+ assert_equal("la_first", n_("first", "second", 0))
217
+ assert_equal("la_first", n_("first", "second", 1))
218
+ assert_equal("la_first", n_("first", "second", 2))
203
219
  end
204
220
 
205
221
  def test_plural_array
@@ -210,6 +226,28 @@ DDD
210
226
  assert_equal("da_plural", n_(["one", "two"], 2))
211
227
  end
212
228
 
229
+ def test_plural_with_single
230
+ GetText.locale = nil
231
+ bindtextdomain("plural", "locale", "ja")
232
+ assert_equal("hitotsu", _("single"))
233
+ assert_equal("hitotsu", n_("single", "plural", 1))
234
+ assert_equal("hitotsu", n_("single", "plural", 2))
235
+ assert_equal("all", n_("one", "two", 1))
236
+ assert_equal("all", n_("one", "two", 2))
237
+ assert_equal("all", _("one"))
238
+
239
+ bindtextdomain("plural", "locale", "fr")
240
+ assert_equal("fr_hitotsu", _("single"))
241
+ assert_equal("fr_hitotsu", n_("single", "plural", 1))
242
+ assert_equal("fr_fukusu", n_("single", "plural", 2))
243
+ assert_equal("fr_one", n_("one", "two", 1))
244
+ assert_equal("fr_plural", n_("one", "two", 2))
245
+ assert_equal("fr_one", _("one"))
246
+
247
+ assert_equal("fr_hitotsu", n_("single", "not match", 1))
248
+ assert_equal("fr_fukusu", n_("single", "not match", 2))
249
+ end
250
+
213
251
  def test_Nn_
214
252
  GetText.locale = nil
215
253
  bindtextdomain("plural", "locale", "da")