experteer-gettext 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (424) hide show
  1. data/COPYING +55 -0
  2. data/ChangeLog +57 -0
  3. data/ChangeLog-1 +2016 -0
  4. data/NEWS-1 +414 -0
  5. data/README.rdoc +251 -0
  6. data/Rakefile +260 -0
  7. data/VERSION +2 -0
  8. data/bin/rgettext +24 -0
  9. data/bin/rmsgfmt +24 -0
  10. data/bin/rmsgmerge +24 -0
  11. data/gettext.gemspec +494 -0
  12. data/lib/gettext/cgi.rb +39 -0
  13. data/lib/gettext/class_info.rb +67 -0
  14. data/lib/gettext/core_ext/iconv.rb +112 -0
  15. data/lib/gettext/core_ext/string.rb +84 -0
  16. data/lib/gettext/locale_path.rb +123 -0
  17. data/lib/gettext/mofile.rb +330 -0
  18. data/lib/gettext/parser/erb.rb +54 -0
  19. data/lib/gettext/parser/glade.rb +100 -0
  20. data/lib/gettext/parser/ruby.rb +193 -0
  21. data/lib/gettext/poparser.rb +355 -0
  22. data/lib/gettext/textdomain.rb +179 -0
  23. data/lib/gettext/textdomain_group.rb +24 -0
  24. data/lib/gettext/textdomain_manager.rb +212 -0
  25. data/lib/gettext/tools/rgettext.rb +236 -0
  26. data/lib/gettext/tools/rmsgfmt.rb +84 -0
  27. data/lib/gettext/tools/rmsgmerge.rb +498 -0
  28. data/lib/gettext/tools.rb +195 -0
  29. data/lib/gettext/translation_target.rb +93 -0
  30. data/lib/gettext/utils.rb +37 -0
  31. data/lib/gettext/version.rb +12 -0
  32. data/lib/gettext.rb +312 -0
  33. data/po/bg/rgettext.po +130 -0
  34. data/po/bs/rgettext.po +131 -0
  35. data/po/ca/rgettext.po +129 -0
  36. data/po/cs/rgettext.po +132 -0
  37. data/po/de/rgettext.po +137 -0
  38. data/po/el/rgettext.po +128 -0
  39. data/po/eo/rgettext.po +129 -0
  40. data/po/es/rgettext.po +130 -0
  41. data/po/et/rgettext.po +127 -0
  42. data/po/fr/rgettext.po +133 -0
  43. data/po/hr/rgettext.po +131 -0
  44. data/po/hu/rgettext.po +129 -0
  45. data/po/it/rgettext.po +130 -0
  46. data/po/ja/rgettext.po +129 -0
  47. data/po/ko/rgettext.po +129 -0
  48. data/po/lv/rgettext.po +130 -0
  49. data/po/nb/rgettext.po +131 -0
  50. data/po/nl/rgettext.po +130 -0
  51. data/po/pt_BR/rgettext.po +132 -0
  52. data/po/rgettext.pot +121 -0
  53. data/po/ru/rgettext.po +131 -0
  54. data/po/sr/rgettext.po +130 -0
  55. data/po/sv/rgettext.po +123 -0
  56. data/po/ua/rgettext.po +134 -0
  57. data/po/vi/rgettext.po +128 -0
  58. data/po/zh/rgettext.po +129 -0
  59. data/po/zh_TW/rgettext.po +128 -0
  60. data/samples/README +16 -0
  61. data/samples/cgi/README +43 -0
  62. data/samples/cgi/Rakefile +27 -0
  63. data/samples/cgi/cookie.cgi +64 -0
  64. data/samples/cgi/gettext.css +116 -0
  65. data/samples/cgi/helloerb.rhtml +28 -0
  66. data/samples/cgi/helloerb1.cgi +58 -0
  67. data/samples/cgi/helloerb2.cgi +51 -0
  68. data/samples/cgi/hellolib.rb +20 -0
  69. data/samples/cgi/http.rb +51 -0
  70. data/samples/cgi/index.cgi +111 -0
  71. data/samples/cgi/other.rhtml +20 -0
  72. data/samples/cgi/po/bg/helloerb1.po +59 -0
  73. data/samples/cgi/po/bg/helloerb2.po +51 -0
  74. data/samples/cgi/po/bg/hellolib.po +23 -0
  75. data/samples/cgi/po/bg/main.po +83 -0
  76. data/samples/cgi/po/bs/helloerb1.po +59 -0
  77. data/samples/cgi/po/bs/helloerb2.po +51 -0
  78. data/samples/cgi/po/bs/hellolib.po +23 -0
  79. data/samples/cgi/po/bs/main.po +83 -0
  80. data/samples/cgi/po/ca/helloerb1.po +59 -0
  81. data/samples/cgi/po/ca/helloerb2.po +51 -0
  82. data/samples/cgi/po/ca/hellolib.po +23 -0
  83. data/samples/cgi/po/ca/main.po +83 -0
  84. data/samples/cgi/po/cs/helloerb1.po +61 -0
  85. data/samples/cgi/po/cs/helloerb2.po +52 -0
  86. data/samples/cgi/po/cs/hellolib.po +25 -0
  87. data/samples/cgi/po/cs/main.po +85 -0
  88. data/samples/cgi/po/de/helloerb1.po +61 -0
  89. data/samples/cgi/po/de/helloerb2.po +52 -0
  90. data/samples/cgi/po/de/hellolib.po +24 -0
  91. data/samples/cgi/po/de/main.po +86 -0
  92. data/samples/cgi/po/el/helloerb1.po +60 -0
  93. data/samples/cgi/po/el/helloerb2.po +51 -0
  94. data/samples/cgi/po/el/hellolib.po +23 -0
  95. data/samples/cgi/po/el/main.po +84 -0
  96. data/samples/cgi/po/eo/helloerb1.po +60 -0
  97. data/samples/cgi/po/eo/helloerb2.po +52 -0
  98. data/samples/cgi/po/eo/hellolib.po +24 -0
  99. data/samples/cgi/po/eo/main.po +84 -0
  100. data/samples/cgi/po/es/helloerb1.po +59 -0
  101. data/samples/cgi/po/es/helloerb2.po +50 -0
  102. data/samples/cgi/po/es/hellolib.po +22 -0
  103. data/samples/cgi/po/es/main.po +83 -0
  104. data/samples/cgi/po/fr/helloerb1.po +59 -0
  105. data/samples/cgi/po/fr/helloerb2.po +51 -0
  106. data/samples/cgi/po/fr/hellolib.po +22 -0
  107. data/samples/cgi/po/fr/main.po +85 -0
  108. data/samples/cgi/po/helloerb1.pot +60 -0
  109. data/samples/cgi/po/helloerb2.pot +52 -0
  110. data/samples/cgi/po/hellolib.pot +24 -0
  111. data/samples/cgi/po/hr/helloerb1.po +59 -0
  112. data/samples/cgi/po/hr/helloerb2.po +51 -0
  113. data/samples/cgi/po/hr/hellolib.po +23 -0
  114. data/samples/cgi/po/hr/main.po +83 -0
  115. data/samples/cgi/po/hu/helloerb1.po +59 -0
  116. data/samples/cgi/po/hu/helloerb2.po +51 -0
  117. data/samples/cgi/po/hu/hellolib.po +23 -0
  118. data/samples/cgi/po/hu/main.po +82 -0
  119. data/samples/cgi/po/it/helloerb1.po +60 -0
  120. data/samples/cgi/po/it/helloerb2.po +52 -0
  121. data/samples/cgi/po/it/hellolib.po +24 -0
  122. data/samples/cgi/po/it/main.po +84 -0
  123. data/samples/cgi/po/ja/helloerb1.po +60 -0
  124. data/samples/cgi/po/ja/helloerb2.po +52 -0
  125. data/samples/cgi/po/ja/hellolib.po +24 -0
  126. data/samples/cgi/po/ja/main.po +85 -0
  127. data/samples/cgi/po/ko/helloerb1.po +59 -0
  128. data/samples/cgi/po/ko/helloerb2.po +51 -0
  129. data/samples/cgi/po/ko/hellolib.po +23 -0
  130. data/samples/cgi/po/ko/main.po +84 -0
  131. data/samples/cgi/po/lv/helloerb1.po +65 -0
  132. data/samples/cgi/po/lv/helloerb2.po +52 -0
  133. data/samples/cgi/po/lv/hellolib.po +24 -0
  134. data/samples/cgi/po/lv/main.po +77 -0
  135. data/samples/cgi/po/main.pot +80 -0
  136. data/samples/cgi/po/nb/helloerb1.po +60 -0
  137. data/samples/cgi/po/nb/helloerb2.po +52 -0
  138. data/samples/cgi/po/nb/hellolib.po +24 -0
  139. data/samples/cgi/po/nb/main.po +84 -0
  140. data/samples/cgi/po/nl/helloerb1.po +61 -0
  141. data/samples/cgi/po/nl/helloerb2.po +52 -0
  142. data/samples/cgi/po/nl/hellolib.po +24 -0
  143. data/samples/cgi/po/nl/main.po +86 -0
  144. data/samples/cgi/po/pt_BR/helloerb1.po +59 -0
  145. data/samples/cgi/po/pt_BR/helloerb2.po +51 -0
  146. data/samples/cgi/po/pt_BR/hellolib.po +23 -0
  147. data/samples/cgi/po/pt_BR/main.po +84 -0
  148. data/samples/cgi/po/ru/helloerb1.po +58 -0
  149. data/samples/cgi/po/ru/helloerb2.po +50 -0
  150. data/samples/cgi/po/ru/hellolib.po +22 -0
  151. data/samples/cgi/po/ru/main.po +82 -0
  152. data/samples/cgi/po/sr/helloerb1.po +60 -0
  153. data/samples/cgi/po/sr/helloerb2.po +52 -0
  154. data/samples/cgi/po/sr/hellolib.po +24 -0
  155. data/samples/cgi/po/sr/main.po +80 -0
  156. data/samples/cgi/po/ua/helloerb1.po +62 -0
  157. data/samples/cgi/po/ua/helloerb2.po +54 -0
  158. data/samples/cgi/po/ua/hellolib.po +26 -0
  159. data/samples/cgi/po/ua/main.po +84 -0
  160. data/samples/cgi/po/vi/helloerb1.po +65 -0
  161. data/samples/cgi/po/vi/helloerb2.po +52 -0
  162. data/samples/cgi/po/vi/hellolib.po +24 -0
  163. data/samples/cgi/po/vi/main.po +77 -0
  164. data/samples/cgi/po/zh/helloerb1.po +60 -0
  165. data/samples/cgi/po/zh/helloerb2.po +52 -0
  166. data/samples/cgi/po/zh/hellolib.po +24 -0
  167. data/samples/cgi/po/zh/main.po +80 -0
  168. data/samples/cgi/po/zh_TW/helloerb1.po +67 -0
  169. data/samples/cgi/po/zh_TW/helloerb2.po +54 -0
  170. data/samples/cgi/po/zh_TW/hellolib.po +26 -0
  171. data/samples/cgi/po/zh_TW/main.po +79 -0
  172. data/samples/hello.rb +36 -0
  173. data/samples/hello2.rb +23 -0
  174. data/samples/hello_glade2.glade +70 -0
  175. data/samples/hello_glade2.rb +25 -0
  176. data/samples/hello_gtk2.rb +27 -0
  177. data/samples/hello_noop.rb +31 -0
  178. data/samples/hello_plural.rb +26 -0
  179. data/samples/hello_tk.rb +19 -0
  180. data/samples/makemo.rb +4 -0
  181. data/samples/po/bg/hello.po +24 -0
  182. data/samples/po/bg/hello2.po +31 -0
  183. data/samples/po/bg/hello_glade2.po +31 -0
  184. data/samples/po/bg/hello_gtk.po +23 -0
  185. data/samples/po/bg/hello_noop.po +27 -0
  186. data/samples/po/bg/hello_plural.po +25 -0
  187. data/samples/po/bg/hello_tk.po +23 -0
  188. data/samples/po/bs/hello.po +23 -0
  189. data/samples/po/bs/hello2.po +31 -0
  190. data/samples/po/bs/hello_glade2.po +31 -0
  191. data/samples/po/bs/hello_gtk.po +23 -0
  192. data/samples/po/bs/hello_noop.po +27 -0
  193. data/samples/po/bs/hello_plural.po +26 -0
  194. data/samples/po/bs/hello_tk.po +23 -0
  195. data/samples/po/ca/hello.po +23 -0
  196. data/samples/po/ca/hello2.po +31 -0
  197. data/samples/po/ca/hello_glade2.po +31 -0
  198. data/samples/po/ca/hello_gtk.po +23 -0
  199. data/samples/po/ca/hello_noop.po +27 -0
  200. data/samples/po/ca/hello_plural.po +25 -0
  201. data/samples/po/ca/hello_tk.po +23 -0
  202. data/samples/po/cs/hello.po +23 -0
  203. data/samples/po/cs/hello2.po +31 -0
  204. data/samples/po/cs/hello_glade2.po +37 -0
  205. data/samples/po/cs/hello_gtk.po +23 -0
  206. data/samples/po/cs/hello_noop.po +27 -0
  207. data/samples/po/cs/hello_plural.po +26 -0
  208. data/samples/po/cs/hello_tk.po +23 -0
  209. data/samples/po/de/hello.po +20 -0
  210. data/samples/po/de/hello2.po +28 -0
  211. data/samples/po/de/hello_glade2.po +27 -0
  212. data/samples/po/de/hello_gtk.po +20 -0
  213. data/samples/po/de/hello_noop.po +24 -0
  214. data/samples/po/de/hello_plural.po +25 -0
  215. data/samples/po/de/hello_tk.po +20 -0
  216. data/samples/po/el/hello.po +23 -0
  217. data/samples/po/el/hello2.po +31 -0
  218. data/samples/po/el/hello_glade2.po +31 -0
  219. data/samples/po/el/hello_gtk.po +22 -0
  220. data/samples/po/el/hello_noop.po +27 -0
  221. data/samples/po/el/hello_plural.po +25 -0
  222. data/samples/po/el/hello_tk.po +23 -0
  223. data/samples/po/eo/hello.po +23 -0
  224. data/samples/po/eo/hello2.po +31 -0
  225. data/samples/po/eo/hello_glade2.po +32 -0
  226. data/samples/po/eo/hello_gtk.po +23 -0
  227. data/samples/po/eo/hello_noop.po +27 -0
  228. data/samples/po/eo/hello_plural.po +26 -0
  229. data/samples/po/eo/hello_tk.po +24 -0
  230. data/samples/po/es/hello.po +21 -0
  231. data/samples/po/es/hello2.po +28 -0
  232. data/samples/po/es/hello_glade2.po +28 -0
  233. data/samples/po/es/hello_gtk.po +20 -0
  234. data/samples/po/es/hello_noop.po +24 -0
  235. data/samples/po/es/hello_plural.po +23 -0
  236. data/samples/po/es/hello_tk.po +20 -0
  237. data/samples/po/fr/hello.po +18 -0
  238. data/samples/po/fr/hello2.po +26 -0
  239. data/samples/po/fr/hello_glade2.po +27 -0
  240. data/samples/po/fr/hello_gtk.po +18 -0
  241. data/samples/po/fr/hello_noop.po +22 -0
  242. data/samples/po/fr/hello_plural.po +21 -0
  243. data/samples/po/fr/hello_tk.po +18 -0
  244. data/samples/po/hello.pot +23 -0
  245. data/samples/po/hello2.pot +31 -0
  246. data/samples/po/hello_glade2.pot +32 -0
  247. data/samples/po/hello_gtk.pot +23 -0
  248. data/samples/po/hello_noop.pot +27 -0
  249. data/samples/po/hello_plural.pot +26 -0
  250. data/samples/po/hello_tk.pot +24 -0
  251. data/samples/po/hr/hello.po +23 -0
  252. data/samples/po/hr/hello2.po +31 -0
  253. data/samples/po/hr/hello_glade2.po +31 -0
  254. data/samples/po/hr/hello_gtk.po +23 -0
  255. data/samples/po/hr/hello_noop.po +27 -0
  256. data/samples/po/hr/hello_plural.po +26 -0
  257. data/samples/po/hr/hello_tk.po +23 -0
  258. data/samples/po/hu/hello.po +22 -0
  259. data/samples/po/hu/hello2.po +30 -0
  260. data/samples/po/hu/hello_glade2.po +31 -0
  261. data/samples/po/hu/hello_gtk.po +22 -0
  262. data/samples/po/hu/hello_noop.po +26 -0
  263. data/samples/po/hu/hello_plural.po +25 -0
  264. data/samples/po/hu/hello_tk.po +23 -0
  265. data/samples/po/it/hello.po +20 -0
  266. data/samples/po/it/hello2.po +28 -0
  267. data/samples/po/it/hello_glade2.po +28 -0
  268. data/samples/po/it/hello_gtk.po +21 -0
  269. data/samples/po/it/hello_noop.po +24 -0
  270. data/samples/po/it/hello_plural.po +23 -0
  271. data/samples/po/it/hello_tk.po +21 -0
  272. data/samples/po/ja/hello.po +20 -0
  273. data/samples/po/ja/hello2.po +28 -0
  274. data/samples/po/ja/hello_glade2.po +26 -0
  275. data/samples/po/ja/hello_gtk.po +19 -0
  276. data/samples/po/ja/hello_noop.po +23 -0
  277. data/samples/po/ja/hello_plural.po +21 -0
  278. data/samples/po/ja/hello_tk.po +19 -0
  279. data/samples/po/ko/hello.po +18 -0
  280. data/samples/po/ko/hello2.po +26 -0
  281. data/samples/po/ko/hello_glade2.po +29 -0
  282. data/samples/po/ko/hello_gtk.po +18 -0
  283. data/samples/po/ko/hello_noop.po +22 -0
  284. data/samples/po/ko/hello_plural.po +25 -0
  285. data/samples/po/ko/hello_tk.po +19 -0
  286. data/samples/po/lv/hello.po +24 -0
  287. data/samples/po/lv/hello2.po +32 -0
  288. data/samples/po/lv/hello_glade2.po +38 -0
  289. data/samples/po/lv/hello_gtk.po +24 -0
  290. data/samples/po/lv/hello_noop.po +28 -0
  291. data/samples/po/lv/hello_plural.po +26 -0
  292. data/samples/po/lv/hello_tk.po +24 -0
  293. data/samples/po/nb/hello.po +23 -0
  294. data/samples/po/nb/hello2.po +31 -0
  295. data/samples/po/nb/hello_glade2.po +31 -0
  296. data/samples/po/nb/hello_gtk.po +23 -0
  297. data/samples/po/nb/hello_noop.po +27 -0
  298. data/samples/po/nb/hello_plural.po +26 -0
  299. data/samples/po/nb/hello_tk.po +24 -0
  300. data/samples/po/nl/hello.po +24 -0
  301. data/samples/po/nl/hello2.po +32 -0
  302. data/samples/po/nl/hello_glade2.po +31 -0
  303. data/samples/po/nl/hello_gtk.po +24 -0
  304. data/samples/po/nl/hello_noop.po +28 -0
  305. data/samples/po/nl/hello_plural.po +25 -0
  306. data/samples/po/nl/hello_tk.po +24 -0
  307. data/samples/po/pt_BR/hello.po +21 -0
  308. data/samples/po/pt_BR/hello2.po +29 -0
  309. data/samples/po/pt_BR/hello_glade2.po +29 -0
  310. data/samples/po/pt_BR/hello_gtk.po +21 -0
  311. data/samples/po/pt_BR/hello_noop.po +25 -0
  312. data/samples/po/pt_BR/hello_plural.po +23 -0
  313. data/samples/po/pt_BR/hello_tk.po +21 -0
  314. data/samples/po/ru/hello.po +22 -0
  315. data/samples/po/ru/hello2.po +30 -0
  316. data/samples/po/ru/hello_glade2.po +30 -0
  317. data/samples/po/ru/hello_gtk.po +22 -0
  318. data/samples/po/ru/hello_noop.po +26 -0
  319. data/samples/po/ru/hello_plural.po +28 -0
  320. data/samples/po/ru/hello_tk.po +22 -0
  321. data/samples/po/sr/hello.po +22 -0
  322. data/samples/po/sr/hello2.po +30 -0
  323. data/samples/po/sr/hello_glade2.po +32 -0
  324. data/samples/po/sr/hello_gtk.po +22 -0
  325. data/samples/po/sr/hello_noop.po +26 -0
  326. data/samples/po/sr/hello_plural.po +26 -0
  327. data/samples/po/sr/hello_tk.po +24 -0
  328. data/samples/po/sv/hello.po +20 -0
  329. data/samples/po/sv/hello2.po +28 -0
  330. data/samples/po/sv/hello_glade2.po +28 -0
  331. data/samples/po/sv/hello_gtk.po +20 -0
  332. data/samples/po/sv/hello_noop.po +24 -0
  333. data/samples/po/sv/hello_plural.po +23 -0
  334. data/samples/po/sv/hello_tk.po +20 -0
  335. data/samples/po/test.rb +11 -0
  336. data/samples/po/ua/hello.po +22 -0
  337. data/samples/po/ua/hello2.po +30 -0
  338. data/samples/po/ua/hello_glade2.po +34 -0
  339. data/samples/po/ua/hello_gtk.po +22 -0
  340. data/samples/po/ua/hello_noop.po +26 -0
  341. data/samples/po/ua/hello_plural.po +29 -0
  342. data/samples/po/ua/hello_tk.po +26 -0
  343. data/samples/po/vi/hello.po +23 -0
  344. data/samples/po/vi/hello2.po +31 -0
  345. data/samples/po/vi/hello_glade2.po +38 -0
  346. data/samples/po/vi/hello_gtk.po +23 -0
  347. data/samples/po/vi/hello_noop.po +27 -0
  348. data/samples/po/vi/hello_plural.po +26 -0
  349. data/samples/po/vi/hello_tk.po +24 -0
  350. data/samples/po/zh/hello.po +23 -0
  351. data/samples/po/zh/hello2.po +31 -0
  352. data/samples/po/zh/hello_glade2.po +31 -0
  353. data/samples/po/zh/hello_gtk.po +23 -0
  354. data/samples/po/zh/hello_noop.po +27 -0
  355. data/samples/po/zh/hello_plural.po +25 -0
  356. data/samples/po/zh/hello_tk.po +23 -0
  357. data/samples/po/zh_TW/hello.po +26 -0
  358. data/samples/po/zh_TW/hello2.po +34 -0
  359. data/samples/po/zh_TW/hello_glade2.po +40 -0
  360. data/samples/po/zh_TW/hello_gtk.po +25 -0
  361. data/samples/po/zh_TW/hello_noop.po +30 -0
  362. data/samples/po/zh_TW/hello_plural.po +28 -0
  363. data/samples/po/zh_TW/hello_tk.po +26 -0
  364. data/test/README +1 -0
  365. data/test/Rakefile +17 -0
  366. data/test/po/cr/plural.po +23 -0
  367. data/test/po/da/plural.po +22 -0
  368. data/test/po/da/plural_error.po +22 -0
  369. data/test/po/fr/plural.po +28 -0
  370. data/test/po/fr/plural_error.po +20 -0
  371. data/test/po/fr/test1.po +23 -0
  372. data/test/po/fr/test2.po +19 -0
  373. data/test/po/ir/plural.po +23 -0
  374. data/test/po/ja/npgettext.po +46 -0
  375. data/test/po/ja/nsgettext.po +65 -0
  376. data/test/po/ja/pgettext.po +41 -0
  377. data/test/po/ja/plural.po +28 -0
  378. data/test/po/ja/plural_error.po +20 -0
  379. data/test/po/ja/rubyparser.po +43 -0
  380. data/test/po/ja/sgettext.po +47 -0
  381. data/test/po/ja/test1.po +23 -0
  382. data/test/po/ja/test2.po +19 -0
  383. data/test/po/ja/test3.po +19 -0
  384. data/test/po/la/plural.po +23 -0
  385. data/test/po/la/plural_error.po +21 -0
  386. data/test/po/li/plural.po +23 -0
  387. data/test/po/li/plural_error.po +27 -0
  388. data/test/po/po/plural.po +23 -0
  389. data/test/po/sl/plural.po +24 -0
  390. data/test/test_class_info.rb +83 -0
  391. data/test/test_gettext.rb +311 -0
  392. data/test/test_locale_path.rb +50 -0
  393. data/test/test_parser.rb +157 -0
  394. data/test/test_po_generation.rb +20 -0
  395. data/test/test_string.rb +65 -0
  396. data/test/test_textdomain_bind.rb +37 -0
  397. data/test/test_textdomain_multi.rb +80 -0
  398. data/test/test_textdomain_toplevel.rb +42 -0
  399. data/test/test_thread.rb +41 -0
  400. data/test/test_translation_target.rb +29 -0
  401. data/test/testlib/N_.rb +66 -0
  402. data/test/testlib/erb.rhtml +15 -0
  403. data/test/testlib/erb.rxml +16 -0
  404. data/test/testlib/gettext.rb +113 -0
  405. data/test/testlib/gladeparser.glade +183 -0
  406. data/test/testlib/helper.rb +11 -0
  407. data/test/testlib/multi_textdomain.rb +131 -0
  408. data/test/testlib/ngettext.rb +79 -0
  409. data/test/testlib/npgettext.rb +31 -0
  410. data/test/testlib/nsgettext.rb +42 -0
  411. data/test/testlib/pgettext.rb +36 -0
  412. data/test/testlib/sgettext.rb +46 -0
  413. data/test/testlib/simple.rb +14 -0
  414. data/test/tools/files/app.pot +0 -0
  415. data/test/tools/files/de/app.po +0 -0
  416. data/test/tools/files/en/app.po +0 -0
  417. data/test/tools/files/en/test.po +21 -0
  418. data/test/tools/files/simple_1.po +2 -0
  419. data/test/tools/files/simple_2.po +2 -0
  420. data/test/tools/files/simple_translation.rb +1 -0
  421. data/test/tools/files/version.po +7 -0
  422. data/test/tools/test.pot +21 -0
  423. data/test/tools/test_tools.rb +61 -0
  424. metadata +510 -0
data/NEWS-1 ADDED
@@ -0,0 +1,414 @@
1
+ (OBSOLETE: Move to ChangeLog since 2.0.0)
2
+
3
+ = Ruby-GetText-Package-1.93.0 (2008-09-14)
4
+ * Bulgarian added.
5
+ * Estonian updated.
6
+ * French updated.
7
+ * Japanese updated.
8
+ * np_, npgettext support.
9
+ * Fixed bugs.
10
+ - detect the correct charset on POSIX OS.
11
+ - updatepo task works again on Windows OS(with broken GNU msgmerge).
12
+ - Remove BOM from po-files before GNU msgmerge is executed.
13
+ (GNU msgmerge doesn't support BOM)
14
+ - Work with xx(double x) library and the library which uses xx library
15
+ such as rcov.
16
+ - Fixed expire_fragment with rails < 2.1.
17
+
18
+ (NOTE) Rails-2.2 has not been supported yet.
19
+
20
+ Thanks to:
21
+ Translators:
22
+ Vincent Isambart, Erkki Eilonen, Sava Chankov.
23
+
24
+ Bug reports, suggestions and patches:
25
+ Vladimir Dobriakov, Tatsuki Sugiura, César Duque Calle,
26
+ Rémy-Christophe Schermesser, Donald Piret.
27
+
28
+ = Ruby-GetText-Package-1.92.0 (2008-08-02)
29
+ * Fixed a memory leak(again)
30
+ * Fixed bugs.
31
+ * Improve to support mo-files.
32
+ * Support revision 1 of mo-file format.
33
+ * Freeze msgstrs.
34
+ * msgctxt - pgettext(msgctxt, msgid) support
35
+ (eg)
36
+ p_("File", "Open") #=> "Open" is shown in English.
37
+ * Update translations
38
+ * Catalan, Chinese(Simplified), Chinese(Traditional), (English), Esperanto, German,
39
+ Greek, Hungarian, Latvian, Japanese, Norwegian, Portuguese(pt_BR), Russian, Serbian,
40
+ Spanish, Ukrainian, Vietnamese,
41
+ * Rails Support
42
+ * Support rubyonrails-2.1.0 (2.0.0 or later).
43
+ * Add new validations for activerecord-2.1.0.
44
+ (:greater_than, :greater_than_or_equal_to, :equal_to,
45
+ :less_than, :less_than_or_equal_to,:odd, :even)
46
+ * validates_(format|inclusion)_of accepts %{val} as the value
47
+ (eg)
48
+ validates_inclusion_of :name, :in => %w(a, b), :message => N_("%{fn} can't be %{val}")
49
+ * Work Fragment caching on rails-2.1.0.
50
+ * Support ActiveRecord::Base.abstract_class.
51
+ * Work ActiveRecord::Errors#[]
52
+ * Work render_partial.
53
+
54
+ Thanks to:
55
+ Translators:
56
+ Slobodan Paunović, Yuri Kozlov, Patrick Lenz, Malte Milatz, Ngoc DAO Thanh, David Espada,
57
+ Antonio S. de A. Terceiro, David Espada, Runar Ingebrigtsen, Tamás Tompa, Yang Bob, damphyr,
58
+ Ramon Salvadó, Alex Rootoff, Aivars Akots
59
+
60
+ Bug reports, suggestions and patches:
61
+ Hans de Graaff, Tatsuki Sugiura, Andreas Neuhaus, Loiseleur Michel
62
+
63
+ = Ruby-GetText-Package-1.91.0 (2008-05-11)
64
+ * Works again on Win32 + JRuby-1.1.1
65
+ * Fixed memory leaks.
66
+ * Fixed bugs.
67
+ * Speed up.
68
+ * Support Serbian(sr)
69
+ * Rails Support
70
+ * rubyonrails-1.2.x isn't supported(2.0.0 or later are supported).
71
+ * Localize ActionView::Helpers::FormBuilder#label.
72
+ e.g.)
73
+ <% form_for(@article) do |f| %>
74
+ <p><%= f.label :lastupdate %></p>
75
+ <% end %>
76
+ => msgid "Article|Lastupdate" is used as the label string.
77
+
78
+ Thanks to:
79
+ Translators:
80
+ Slobodan Paunović
81
+ Bug reports, suggestions and patches:
82
+ Paul Clegg, Locomotyphus, Simone Carletti, Dao Ngoc, Karl Palmskog,
83
+ Tatsuki Sugiura, Bernd Ahlers, craccho.
84
+
85
+ = Ruby-GetText-Package-1.90.0 (2008-01-30)
86
+ Start to prepare v2.0.
87
+
88
+ * Support Ukrainian(ua), Hungarian(hu)
89
+ * JRuby supported.
90
+ * Become a pure ruby library (Remove .so extention).
91
+ * Don't need C compiler to install.
92
+ * Unified to one gem package for all environments (Don't need Win32 package).
93
+ * Directory structures are refactored.
94
+ * locale modules separate from lib/gettext/ to lib/locale/.
95
+ * Locale modules are refactored. System locales become read only.
96
+ * Ruby on Rails 2.0 supported.
97
+ * RDoc supported.
98
+ * Fix bugs.
99
+ * Enhance to support Ruby on Rails.
100
+ * error_messages_for can accept custom error dialog messages.
101
+ * Add GetText::Rails.available_locales, .normalized_locale
102
+ and fragment_cache_key/expire_fragment reimplement to use these methods
103
+ to restrict cached locale files.
104
+
105
+ Thanks to:
106
+ Translators:
107
+ Alex Rootoff, Tamás Tompa
108
+ Bug reports, suggestions and patches:
109
+ Yaohan Chen, OZAWA Sakuro, olivier ruffin, Vít Ondruch,
110
+ Andreas Neuhaus, boud indymedia, Hans de Graaff, Stephan, Reynard,
111
+ Ernesto Jiménez Caballero, Paul Clegg
112
+
113
+ = Ruby-GetText-Package-1.10.0 (2007-07-06)
114
+
115
+ * Support Vietnamese(vi), Bosnian(bs), Croatian(hr), Norwegian(nb)
116
+ * Cache messages. Both _() and n_() become 1.3-1.8 times faster
117
+ than older version.
118
+ * Add GetText.ns_()
119
+ * Fix bugs.
120
+ * Enhance to support Ruby on Rails.
121
+ * Work with script/generate scaffold_resource.
122
+ * error_messages_for accepts plural models.
123
+ * Support Action/Fragment caching.
124
+
125
+ Thanks to:
126
+ Translators:
127
+ Dirkjan Bussink, Bart ten Brinke, Ngoc Dao, Sanjin Sehic,
128
+ Runar Ingebrigtsen, Menno Jonker, Joao Pedrosa, Malte Milatz,
129
+ Patrick Lenz, David Sulc, Erkki Eilonen, Yang Bob, Ramon Salvadó
130
+ Bug reports, suggestions and patches:
131
+ Maksim Bartenev, Bart ten Brinke, Florian Hufsky,
132
+ Michel Loiseleur, Sava Chankov
133
+
134
+ = Ruby-GetText-Package-1.9.0 (2007-01-22)
135
+
136
+ * Support Catalan(ca), Esperanto(eo)
137
+ * Update translations: zh_CN, zh_TW, cs, nl, en, de, el, es, ja, ko, pt_BR, ru.
138
+ * Support Ruby on Rails-1.2.1.
139
+ * Code cleanupand improved. Fixed bugs.
140
+
141
+ Thanks to:
142
+ Translators:
143
+ Antonio S. de A. Terceiro, David Espada, David Sulc, Gyoung-Yoon Noh,
144
+ Joao Pedrosa, Malte Milatz, Menno Jonkers, Patrick Lenz, Yang Bob,
145
+ Yuri Kozlov, Vassilis Rizopoulos
146
+
147
+ Bug reports, suggestions and patches:
148
+ Fabian Kreutz, KAKUTANI Shintaro, Mihnea Capraru, NANKI Haruo, pedro palazon
149
+
150
+ = Ruby-GetText-Package-1.8.0 (2006-09-11)
151
+
152
+ * Support Chinese(Taiwan: zh_TW), Estonian(et: rails.po only)
153
+ * Add GetText.bindtextdomain_to(klass, domainname), .textdomain_to(klass, domainname)
154
+ * rgettext supports -r, -d options.
155
+ -r is to set an option parser. -d is for debugging mode.
156
+ (e.g.) $ rgettext -r fooparser test.foo
157
+ * Update translations: pt_BR, de, zh_TW,
158
+ * Code cleanup, fixed bugs.
159
+ * Enhance to support Ruby on Rails.
160
+ * init_gettext finds mo-files in /vendor/plugins/{plugin_name}/locale which has
161
+ app/controller directories such as Rails Engines.
162
+ And init_gettext accepts :locale_path option to be able to set the locale
163
+ path manually.
164
+ * init_gettext manages plural textdomains.
165
+ * Add before_init_gettext, after_init_gettext methods like as before/after_filter.
166
+ * Speed up(the sample blog is 1.5 times faster).
167
+ * gettext/active_record.rb from gettext/rails.rb.
168
+ * ActiveRecord::Validations is set the app's textdomain in init_gettext.
169
+ It means the class which includes ActiveRecord::Validtaions are localized with
170
+ the app's textdomain.
171
+ e.g.) You can use gettext methods in the subclass of ActiveForm[1]
172
+ http://www.realityforge.org/svn/code/active-form/trunk/
173
+ * Works rails edge again (http://dev.rubyonrails.org/ticket/5810)
174
+
175
+ Thanks to:
176
+ Translators: Joao Pedrosa(pt_BR), Partick Lenz(de), Erkki Eilonen(et),
177
+ LIN CHUNG-YI(zh_TW)
178
+ Bug reports and suggestions:
179
+ Kobayashi Noritada, Andreas Neuhaus, steve dp, Tsutomu Kuroda, Donald Piret
180
+
181
+ = Ruby-GetText-Package-1.7.0 (2006-07-17)
182
+
183
+ * GetText.current_textdomain_info for debuging
184
+ * Fixed bugs, code cleanup.
185
+ * Update translations
186
+ * Chinese(zh), Czech(cs), Dutch(nl), English(default), French(fr)
187
+ Spanish(es), Japanese(ja), Korean(ko), Russian(ru)
188
+ * Improve to support Ruby on Rails
189
+ * Localize ActionView::Helpers::DateHelper.distance_of_time_in_words.
190
+ * Localize #error_message_on.
191
+ * Add ActiveRecord::Base.untranslate, .untranslate_all to prevend to
192
+ translate columns.
193
+
194
+ Thanks to:
195
+ Translators:
196
+ David Espada, Karel Miarka, Laurent Sansonetti, Yuri Kozlov,
197
+ Gyoung-Yoon Noh, Menno Jonkers, Yingfeng
198
+ Bug reports and suggestions:
199
+ arton, OZAWA Sakuro, kdmsnr, Kouhei Sutou
200
+
201
+ = Ruby-GetText-Package-1.6.0 (2006-06-09)
202
+
203
+ * Support Chinese(zh_CN), Italian(it).
204
+ * Improve the way to manage textdomains.
205
+ * A class/module can have plural textdomains.
206
+ * A textdomain belong to a class/module.
207
+ * A class/module can have plural textdomains.
208
+ * A message is looked up in its class/module and ancestors.
209
+
210
+ You don't need to call bindtextdomain in each files.
211
+ # A textdomain belong to a file in previous version.
212
+ # And a message is looked up in the file which called
213
+ # GetText functions only.
214
+ * Fix bugs
215
+ * Samples are cleaned up.
216
+
217
+ = Ruby-GetText-Package-1.5.0 (2006-05-07)
218
+
219
+ * Support Russian.
220
+ * Fix bugs.
221
+ * Refresh mo option was added.
222
+ Check mo files and reload it if it's updated.
223
+ ruby -d or GetText::TextDomain.check_mo=(true).
224
+ Or development mode in Ruby on Rails.
225
+
226
+ = Ruby-GetText-Package-1.4.0 (2006-04-15)
227
+
228
+ * Support OpenBSD.
229
+ * Fix bugs
230
+ * Enhance supports of Ruby on Rails.
231
+ * Improved ActionMailer localization support.
232
+ * Support ActionWebService
233
+ * test/gettext_test_rails.rb works with Rails-1.1.2.
234
+
235
+ = Ruby-GetText-Package-1.3.0 (2006-03-11)
236
+
237
+ * Improve Local::Object
238
+ * POSIX, C convert to "en".
239
+ * Enhance supports of Ruby on Rails.
240
+ * ActionMailer localization support.
241
+ * Use GetText function(_() N_() etc) in template.
242
+ * ISO-2022-JP charset is used when language is "ja"(Japanese).
243
+ * Localization templates support.
244
+ * ActionController::Base.render_text is overrided to find
245
+ localized templates such as foo_ja.rhml, foo_ja_JP.rhtml.
246
+ * @params["lang"] is treated as cgi["lang"]
247
+ * Use N_() as localized messages of validates_* instead of _().
248
+ * Translates ActiveRecord::Column.human_name values automatically.
249
+ * Fix memory leak, other bugs.
250
+
251
+ = Ruby-GetText-Package-1.2.0 (2006-02-23)
252
+
253
+ * Re-implement Locale module and Implements Locale::Object,
254
+ Locale::System, etc.
255
+ * Fix bugs.
256
+ * Apply RDoc (not complete)
257
+ * Improve to support Ruby on Rails.
258
+ * Add GetText.Nn_.
259
+ * Add rmsgmerge (Experimental)
260
+
261
+ = Ruby-GetText-Package-1.1.1 (2006-01-14)
262
+
263
+ * Bugfixes.
264
+ * Added Greek locale by damphyr.
265
+ * Support tests for Ruby on Rails.
266
+
267
+ = Ruby-GetText-Package-1.1.0 (2005-12-29)
268
+
269
+ * Added some functions which managed po/mo files easily.
270
+ * GetText.update_pofiles creates/updates pot/po files.
271
+ The idea is from Sascha Ebach.
272
+
273
+ * String% is extended to accept named argument.
274
+ "%{file} is selected." % {:file => "foo.rb"}
275
+ Proposed by Sascha Ebach and Kazuhiro NISHIYAMA.
276
+
277
+ * Enhanced Ruby on Rails support.
278
+ * ActiveRecord support. Inspired from Simon Santoro(rgtrans).
279
+ * the error messages are localized.
280
+ Also, you can add your own messages with _("").
281
+ * You can use gettext methods in the models unless
282
+ preparing anything.
283
+
284
+ * rgettext extracts the table names/field names
285
+ of the subclass of ActiveRecord::Base as the msgid.
286
+
287
+ Even for the English developers who don't need
288
+ to localize their application, this function is
289
+ useful because the developer can rename
290
+ the table/field names using "en" locale.
291
+
292
+ * More simple to set up ApplicationController.
293
+ Now, you need to call just init_gettext only.
294
+
295
+ class ApplicationController < ActionController::Base
296
+ init_gettext "myapp" #Easy!
297
+ end
298
+
299
+ This "myapp" domain affects all of the controllers/views/models.
300
+
301
+ * Sample "blog" application with rails.
302
+ Improved the sample application on RoR. See: samples/rails/*.
303
+
304
+ * New/Updated translations:
305
+ Czech - Karel Miarka (NEW)
306
+ Dutch - Menno Jonkers (NEW)
307
+ French - Laurent Sansonetti
308
+ German - Sasa Ebach
309
+ Japanese - Masao Mutoh
310
+ Korean - Gyoung-Yoon Noh
311
+ Portuguese(Brazil) - Joao Pedrosa
312
+ Spanish - David Espada
313
+
314
+ * bugfixes.
315
+
316
+ = Ruby-GetText-Package-1.0.0 (2005-09-03)
317
+
318
+ * Ruby on Rails is supported.
319
+ Includes sample in samples/rails/
320
+ * gem is supported. ($ gem install gettext)
321
+ * rake is supported.
322
+ * Not required racc anymore on installing time.
323
+ * New/Updated translations:
324
+ French - Laurent Sansonetti
325
+ German - Sven Herzberg
326
+ Japanese - Masao Mutoh
327
+ Korean - Gyoung-Yoon Noh (NEW)
328
+ Spanish - David Espada
329
+ * bugfixes.
330
+
331
+ * Moved to http://rubyforge.org/projects/gettext/
332
+ * Mailinglists started.
333
+
334
+
335
+ = Ruby-GetText-Package-0.9.0 (2005-05-01)
336
+
337
+ * CGI support: gettext/cgi
338
+ * ERB support: gettext/erb, rgettext.
339
+ * Added samples for CGI/ERB to samples/cgi/.
340
+ * bugfixes.
341
+
342
+
343
+ = Ruby-GetText-Package-0.8.1 (2005-03-30)
344
+
345
+ * bugfixes.
346
+ * New Translations: pt_BR by Joao Pedrosa.
347
+
348
+
349
+ = Ruby-GetText-Package-0.8.0 (2004-11-06)
350
+
351
+ * rgettext: Improved to parse ruby script.
352
+ * New Translations:
353
+ French - Laurent Sansonetti
354
+ Spanish - David Espada
355
+ Swedish - Nikolai Weibull
356
+ * Fixed bugs.
357
+
358
+
359
+ = Ruby-GetText-Package-0.7.0 (2004-10-25)
360
+
361
+ * Support GetText.sgettext.
362
+ See: http://www.gnu.org/software/gettext/manual/html_mono/gettext.html#SEC151
363
+ * Added gettext/iconv.rb.
364
+ If your ruby distribution doesn't have iconv.so but Ruby-GNOME2(Ruby/GTK2),
365
+ gettext/iconv.rb provides pseudo Iconv.iconv using Ruby/GLib module.
366
+ * GETTEXT_PATH as new environment variables. Define GETTEXT_PATH as locale
367
+ diretories. You can debug/test your application unless installing catalog
368
+ files.
369
+ * Update setup.rb(by Minero Aoki).
370
+ * Fix misc bugs
371
+
372
+
373
+ = Ruby-GetText-Package-0.6.1 (2004-07-23)
374
+
375
+ * rgettext: Fixed a bug of glade XML mode.
376
+ * Fixed an installation problem.
377
+ * Changed the installer from install.rb to setup.rb.
378
+
379
+
380
+ = Ruby-GetText-Package-0.6.0 (2004-07-05)
381
+
382
+ * rgettext: Support glade-2 XML file format.
383
+ * rgettext: Improved to parse ruby sources.
384
+ * rmsgfmt: Fix a bug that it generated wrong mo format.
385
+ * Fix bugs
386
+
387
+ = Ruby-GetText-Package-0.5.5 (2004-03-26)
388
+
389
+ * Fix a bug.
390
+
391
+ = Ruby-GetText-Package-0.5.4 (2004-02-14)
392
+
393
+ * Improved to support ruby-1.9.x.
394
+
395
+ = Ruby-GetText-Package-0.5.3 (2004-02-14)
396
+
397
+ * Improve the initial speed.
398
+
399
+ = Ruby-GetText-Package-0.5.2 (2003-11-12)
400
+
401
+ * Fix bugs for Win32.
402
+
403
+ = Ruby-GetText-Package-0.5.1 (2003-07-05)
404
+
405
+ * Fix bugs. Code cleanup.
406
+
407
+ = Ruby-GetText-Package-0.5.0 (2003-01-08)
408
+
409
+ * rmsgfmt: Added.
410
+ rmsgfmt is a ruby implementation of msgfmt in GNU gettext.
411
+ It creates a mo-file from a po-file.
412
+ * Fix bugs.
413
+
414
+
data/README.rdoc ADDED
@@ -0,0 +1,251 @@
1
+ = gettext - Ruby-GetText-Package
2
+
3
+ Ruby-GetText-Package is a Localization(L10n) library and tool
4
+ which is modeled after the GNU gettext package.
5
+
6
+ This library translates original messages to localized
7
+ messages using client-side locale information(environment
8
+ variable or CGI variable).
9
+
10
+ The tools for developers support creating, useing, and modifying
11
+ localized message files(message catalogs).
12
+
13
+ ((*Rails*))
14
+ Rails support has been removed.
15
+ Rails / ActiveRecord specific code now lives in locale_rails[http://github.com/mutoh/locale_rails/tree/master], gettext_rails[http://github.com/mutoh/gettext_rails/tree/master] and gettext_activerecord[http://github.com/mutoh/gettext_activerecord/tree/master].
16
+
17
+ == Website
18
+ * homepage[http://www.yotabanana.com/hiki/ruby-gettext.html]
19
+ * on rubyforge[http://gettext/rubyforge.org/]
20
+ * on github[http://github.com/gettext/]
21
+
22
+ == Features
23
+ * Translate singular/plural messages with simple APIs(similar to GNU gettext)
24
+
25
+ * Thread safety. Message resources are shared from all threads, but
26
+ returns translated messages of the current thread's locale.
27
+
28
+ * Tools to find message IDs
29
+ * Extract message IDs to po-files using rgettext from
30
+ * ruby scripts
31
+ * glade-2 XML file(.glade)
32
+ * ERB file(.rhtml, .erb)
33
+ * Anything (with your own parsers)
34
+ * The po-files are compatible to GNU gettext.
35
+
36
+ * rmsgfmt creates a mo-file from a po-file.
37
+ The mo-file is compatible to GNU gettext(msgfmt).
38
+
39
+ * Using rgettext/rmsgfmt as Rake tasks
40
+
41
+ * textdomain's scope is adapt to ruby class/module mechanism.
42
+ * A class/module can have plural textdomains.
43
+ * a message is looked up in its class/module and ancestors.
44
+
45
+ * CGI support (gettext/cgi)
46
+ * Locale is retrieved from client informations using Ruby-Locale.
47
+ (HTTP_ACCEPT_LANGUAGE, HTTP_ACCEPT_CHARSET, QUERY_STRING(lang), Cookies(lang)).
48
+
49
+ * String%() is extended to use named argument such as <tt>%{foo}" %{:foo => 1}</tt>.
50
+ Notes that Ruby-1.9.x supports this format by itself.
51
+
52
+ == Requirements
53
+ * {Ruby 1.8.3 or later}[http://www.ruby-lang.org]
54
+ * {Rubygems}[http://www.rubygems.org/]
55
+ * {locale gem}[http://rubyforge.org/projects/locale/]
56
+ * $ gem install locale
57
+ * (for development only)
58
+ * {GNU gettext 0.10.35 or later}[http://www.gnu.org/software/gettext/gettext.html]
59
+ * {Racc-1.4.3 or later}[http://www.ruby-lang.org/raa/list.rhtml?name=racc]
60
+ * (for compiling src/rmsgfmt.ry only)
61
+
62
+ == Install
63
+ * Uninstall old gettext if exists. (You need to do this when updating 1.93.0 -> 2.0.1)
64
+ (sudo/su on POSIX system)
65
+ gem uninstall gettext
66
+
67
+ * gem
68
+ #from github (edge/unstable)
69
+ (sudo/su on POSIX system)
70
+ gem install locale
71
+ gem install mutoh-gettext -s http://gems.github.com/
72
+
73
+ #from rubyforge (stable)
74
+ (sudo/su on POSIX system)
75
+ gem install locale
76
+ gem install gettext
77
+
78
+ * download tar-ball
79
+ # De-Compress archive and enter its top directory.
80
+ (sudo/su on POSIX system)
81
+ ruby setup.rb
82
+
83
+ You can also install files in your favorite directory by
84
+ supplying setup.rb some options. Try <tt>ruby setup.rb --help</tt>.
85
+
86
+ == Usage
87
+ ===Translation
88
+ - _: Basic translation method
89
+ Translates the message.
90
+ _("Hello")
91
+
92
+ The gettext methods comes in 3 combinable flavors
93
+ - n: Pluralized
94
+ Returns singular or plural form, depending on how many you have.
95
+ n_("Apple", "%{num} Apples", 3)
96
+ n_(["Apple", "%{num} Apples"], 3)
97
+
98
+ - p: context aware
99
+ A context is a prefix to your translation, usefull when one word has different meanings, depending on its context.
100
+ p_("Printer","Open") <=> p_("File","Open")
101
+ is the same as s_("Printer|Open") <=> s_("File|Open")
102
+
103
+ - s: without context
104
+ If a translation could not be found, return the msgid without context.
105
+ s_("Printer|Open") => "Öffnen" #translation found
106
+ s_("Printer|Open") => "Open" #translation not found
107
+
108
+ - combinations
109
+ np_("Fruit", "Apple", "%{num} Apples", 3)
110
+ ns_("Fruit|Apple","%{num} Apples", 3)
111
+
112
+ np_(["Fruit","Apple","%{num} Apples"], 3)
113
+ ns_(["Fruit|Apple","%{num} Apples"], 3)
114
+
115
+ - N_, Nn_: Makes dynamic translation messages readable for the gettext parser.
116
+ <tt>_(fruit)</tt> cannot be understood by the gettext parser. To help the parser find all your translations,
117
+ you can add <tt>fruit = N_("Apple")</tt> which does not translate, but tells the parser: "Apple" needs translation.
118
+
119
+ fruit = N_("Apple") # same as fruit = "Apple"
120
+ _(fruit) # does a normal translation
121
+
122
+ fruits = Nn_("Apple", "%{num} Apples")
123
+ n_(fruits, 3)
124
+
125
+ === Bind textdomains to the classes.
126
+ A textdomain has a translation file in each language.
127
+ A module/class can have multi textdomains. This means the
128
+ libraries/applications can have their own textdomains.
129
+
130
+ class Foo
131
+ include GetText
132
+ bindtextdomain "your_app_domain_name"
133
+ end
134
+
135
+ class Book
136
+ include GetText
137
+ bindtextdomain "general"
138
+ bindtextdomain "book"
139
+ end
140
+
141
+ === Locale
142
+ If you need to set the locale by yourself, then use:
143
+ GetText.locale = "en_US" # translate into english from now on
144
+ GetText.locale # => en_US
145
+ Or
146
+ include GetText
147
+ set_locale "en_US"
148
+
149
+ For more details and options, have a look at the samples folder or
150
+ consult the tutorial[http://www.yotabanana.com/hiki/ruby-gettext-howto.html].
151
+
152
+ == License
153
+ This program is licenced under the same licence as Ruby.
154
+ (See the file 'COPYING'.)
155
+
156
+ * mofile.rb
157
+ * Copyright (C) 2001-2009 Masao Mutoh <mutoh at highwhay.ne.jp>
158
+ * Copyright (C) 2001,2002 Masahiro Sakai <s01397ms at sfc.keio.ac.jp>
159
+
160
+ * gettext.rb
161
+ * Copyright (C) 2001-2009 Masao Mutoh <mutoh at highwhay.ne.jp>
162
+ * Copyright (C) 2001,2002 Masahiro Sakai <s01397ms at sfc.keio.ac.jp>
163
+
164
+ * rgettext
165
+ * Copyright (C) 2001-2009 Masao Mutoh <mutoh at highwhay.ne.jp>
166
+ * Copyright (C) 2001,2002 Yasushi Shoji <yashi at atmark-techno.com>
167
+
168
+ * setup.rb
169
+ * Copyright (C) 2000-2005 Minero Aoki <aamine at loveruby.net>
170
+ * This file is released under LGPL. See the top of the install.rb.
171
+
172
+ * Others
173
+ * Copyright (C) 2001-2009 Masao Mutoh <mutoh at highwhay.ne.jp>
174
+
175
+
176
+ == Translators
177
+ * Bosnian(bs) - Sanjin Sehic <saserr at gmail.com>
178
+ * Bulgarian(bg) - Sava Chankov <sava.chankov at gmail.com>
179
+ * Catalan(ca) - Ramon Salvadó <rsalvado at gnuine.com>
180
+ * Chinese(Simplified)(zh_CN)
181
+ * Yang Bob <bob.yang.dev at gmail.com> (current)
182
+ * Yingfeng <blogyingfeng at gmail.com>
183
+ * Chinese(Traditional)(zh_TW)
184
+ * Yang Bob <bob.yang.dev at gmail.com> (current)
185
+ * LIN CHUNG-YI <xmarsh at gmail.com>
186
+ * Croatian(hr) - Sanjin Sehic <saserr at gmail.com>
187
+ * Czech(cs) - Karel Miarka <kajism at yahoo.com>
188
+ * Dutch(nl) - Menno Jonkers <ruby-gettext at jonkers.com>
189
+ * Esperanto(eo) - Malte Milatz <malte at gmx-topmail.de>
190
+ * Estonian(et) - Erkki Eilonen <erkki at itech.ee>
191
+ * French(fr)
192
+ * Vincent Isambart <vincent.isambart at gmail.com> (current)
193
+ * David Sulc <davidsulc at gmail.com>
194
+ * Laurent Sansonetti <laurent.sansonetti at gmail.com>
195
+ * German(de)
196
+ * Patrick Lenz <patrick at limited-overload.de> (current)
197
+ * Detlef Reichl <detlef.reichl at gmx.org>
198
+ * Sven Herzberg <herzi at abi02.de>
199
+ * Sascha Ebach <se at digitale-wertschoepfung.de>
200
+ * Greek(el) - Vassilis Rizopoulos <damphyr at gmx.net>
201
+ * Hungarian(hu) - Tamás Tompa <tompata at gmail.com>
202
+ * Italian(it)
203
+ * Marco Lazzeri <marco.lazzeri at gmail.com>
204
+ * Gabriele Renzi <surrender_it at yahoo.it>
205
+ * Japanese(ja) - Masao Mutoh <mutomasa at gmail.com>
206
+ * Korean(ko) - Gyoung-Yoon Noh <nohmad at gmail.com>
207
+ * Latvian(lv) - Aivars Akots <aivars.akots at gmail.com>
208
+ * Norwegian(nb) - Runar Ingebrigtsen <runar at mopo.no>
209
+ * Portuguese(Brazil)(pt_BR)
210
+ * Antonio S. de A. Terceiro <terceiro at softwarelivre.org> (current)
211
+ * Joao Pedrosa <joaopedrosa at gmail.com>
212
+ * Russian(ru) - Yuri Kozlov <kozlov.y at gmail.com>
213
+ * Serbian(sr) - Slobodan Paunović" <slobodan.paunovic at gmail.com>
214
+ * Spanish(es)
215
+ * David Espada <davinci at escomposlinux.org> (current)
216
+ * David Moreno Garza <damog at damog.net>
217
+ * Swedish(sv) - Nikolai Weibull <mailing-lists.ruby-talk at rawuncut.elitemail.org>
218
+ * Ukrainian(ua) - Alex Rootoff <rootoff at pisem.net>
219
+ * Vietnamese(vi) - Ngoc Dao Thanh <ngocdaothanh at gmail.com>
220
+
221
+ == Status of translations
222
+ * Bosnian(bs) - 1.90.0 (old)
223
+ * Bulgarian(bg) - 2.0.1
224
+ * Catalan(ca) - 2.0.1
225
+ * Croatian(hr) - 1.90.0 (old)
226
+ * Chinese(zh_CN) - 2.0.1
227
+ * Chinese(zh_TW) - 2.0.1
228
+ * Czech(cs) - 1.9.0 (old)
229
+ * Dutch(nl) - 1.90.0 (old)
230
+ * English(default) - 1.90.0 (old)
231
+ * Esperanto(eo) - 2.0.1
232
+ * Estonian(et) - 2.0.1
233
+ * French(fr) - 2.0.1
234
+ * German(de) - 2.0.1
235
+ * Greek(el) - 2.0.1
236
+ * Hungarian(hu) - 2.0.1
237
+ * Italian(it) - 1.6.0 (old)
238
+ * Japanese(ja) - 2.0.1
239
+ * Korean(ko) - 1.9.0 (old)
240
+ * Latvian(lv) - 2.0.1
241
+ * Norwegian(nb) - 2.0.1
242
+ * Portuguese(Brazil)(pt_BR) - 2.0.1
243
+ * Russian(ru) - 2.0.1
244
+ * Serbian(sr) - 1.91.0 (old)
245
+ * Spanish(es) - 2.0.1
246
+ * Swedish(sv) - 0.8.0 (too much old)
247
+ * Ukrainian(ua) - 2.0.1
248
+ * Vietnamese(vi) - 2.0.1
249
+
250
+ == Maintainer
251
+ Masao Mutoh <mutomasa at gmail.com>