fair-gettext 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (366) hide show
  1. data/COPYING +56 -0
  2. data/ChangeLog-1 +2016 -0
  3. data/NEWS-1 +414 -0
  4. data/benchmark/1.93.0.txt +8 -0
  5. data/benchmark/2.0.0.txt +8 -0
  6. data/benchmark/2.0.4.txt +11 -0
  7. data/benchmark/2.1.0.txt +11 -0
  8. data/benchmark/benchmark.rb +68 -0
  9. data/benchmark/test.rb +28 -0
  10. data/data/locale/bg/LC_MESSAGES/rgettext.mo +0 -0
  11. data/data/locale/bs/LC_MESSAGES/rgettext.mo +0 -0
  12. data/data/locale/ca/LC_MESSAGES/rgettext.mo +0 -0
  13. data/data/locale/cs/LC_MESSAGES/rgettext.mo +0 -0
  14. data/data/locale/de/LC_MESSAGES/rgettext.mo +0 -0
  15. data/data/locale/el/LC_MESSAGES/rgettext.mo +0 -0
  16. data/data/locale/eo/LC_MESSAGES/rgettext.mo +0 -0
  17. data/data/locale/es/LC_MESSAGES/rgettext.mo +0 -0
  18. data/data/locale/et/LC_MESSAGES/rgettext.mo +0 -0
  19. data/data/locale/fr/LC_MESSAGES/rgettext.mo +0 -0
  20. data/data/locale/hr/LC_MESSAGES/rgettext.mo +0 -0
  21. data/data/locale/hu/LC_MESSAGES/rgettext.mo +0 -0
  22. data/data/locale/it/LC_MESSAGES/rgettext.mo +0 -0
  23. data/data/locale/ja/LC_MESSAGES/rgettext.mo +0 -0
  24. data/data/locale/ko/LC_MESSAGES/rgettext.mo +0 -0
  25. data/data/locale/lv/LC_MESSAGES/rgettext.mo +0 -0
  26. data/data/locale/nb/LC_MESSAGES/rgettext.mo +0 -0
  27. data/data/locale/nl/LC_MESSAGES/rgettext.mo +0 -0
  28. data/data/locale/pt_BR/LC_MESSAGES/rgettext.mo +0 -0
  29. data/data/locale/ru/LC_MESSAGES/rgettext.mo +0 -0
  30. data/data/locale/sr/LC_MESSAGES/rgettext.mo +0 -0
  31. data/data/locale/sv/LC_MESSAGES/rgettext.mo +0 -0
  32. data/data/locale/ua/LC_MESSAGES/rgettext.mo +0 -0
  33. data/data/locale/vi/LC_MESSAGES/rgettext.mo +0 -0
  34. data/data/locale/zh/LC_MESSAGES/rgettext.mo +0 -0
  35. data/data/locale/zh_TW/LC_MESSAGES/rgettext.mo +0 -0
  36. data/gettext-2.0.0.gem +0 -0
  37. data/gettext.gemspec +2 -3
  38. data/lib/gettext/runtime/class_info.rb +67 -0
  39. data/lib/gettext/runtime/locale_path.rb +122 -0
  40. data/lib/gettext/runtime/mofile.rb +330 -0
  41. data/lib/gettext/runtime/textdomain.rb +177 -0
  42. data/lib/gettext/runtime/textdomain_group.rb +24 -0
  43. data/lib/gettext/runtime/textdomain_manager.rb +211 -0
  44. data/lib/gettext/tools.rb +38 -31
  45. data/lib/gettext/tools/parser/erb.rb +52 -0
  46. data/lib/gettext/tools/parser/glade.rb +98 -0
  47. data/lib/gettext/tools/parser/ruby.rb +226 -0
  48. data/lib/gettext/tools/pomessage.rb +197 -0
  49. data/lib/gettext/tools/poparser.rb +356 -0
  50. data/lib/gettext/tools/rgettext.rb +55 -33
  51. data/replace.rb +8 -0
  52. data/samples/cgi/locale/bg/LC_MESSAGES/helloerb1.mo +0 -0
  53. data/samples/cgi/locale/bg/LC_MESSAGES/helloerb2.mo +0 -0
  54. data/samples/cgi/locale/bg/LC_MESSAGES/hellolib.mo +0 -0
  55. data/samples/cgi/locale/bg/LC_MESSAGES/main.mo +0 -0
  56. data/samples/cgi/locale/bs/LC_MESSAGES/helloerb1.mo +0 -0
  57. data/samples/cgi/locale/bs/LC_MESSAGES/helloerb2.mo +0 -0
  58. data/samples/cgi/locale/bs/LC_MESSAGES/hellolib.mo +0 -0
  59. data/samples/cgi/locale/bs/LC_MESSAGES/main.mo +0 -0
  60. data/samples/cgi/locale/ca/LC_MESSAGES/helloerb1.mo +0 -0
  61. data/samples/cgi/locale/ca/LC_MESSAGES/helloerb2.mo +0 -0
  62. data/samples/cgi/locale/ca/LC_MESSAGES/hellolib.mo +0 -0
  63. data/samples/cgi/locale/ca/LC_MESSAGES/main.mo +0 -0
  64. data/samples/cgi/locale/cs/LC_MESSAGES/helloerb1.mo +0 -0
  65. data/samples/cgi/locale/cs/LC_MESSAGES/helloerb2.mo +0 -0
  66. data/samples/cgi/locale/cs/LC_MESSAGES/hellolib.mo +0 -0
  67. data/samples/cgi/locale/cs/LC_MESSAGES/main.mo +0 -0
  68. data/samples/cgi/locale/de/LC_MESSAGES/helloerb1.mo +0 -0
  69. data/samples/cgi/locale/de/LC_MESSAGES/helloerb2.mo +0 -0
  70. data/samples/cgi/locale/de/LC_MESSAGES/hellolib.mo +0 -0
  71. data/samples/cgi/locale/de/LC_MESSAGES/main.mo +0 -0
  72. data/samples/cgi/locale/el/LC_MESSAGES/helloerb1.mo +0 -0
  73. data/samples/cgi/locale/el/LC_MESSAGES/helloerb2.mo +0 -0
  74. data/samples/cgi/locale/el/LC_MESSAGES/hellolib.mo +0 -0
  75. data/samples/cgi/locale/el/LC_MESSAGES/main.mo +0 -0
  76. data/samples/cgi/locale/eo/LC_MESSAGES/helloerb1.mo +0 -0
  77. data/samples/cgi/locale/eo/LC_MESSAGES/helloerb2.mo +0 -0
  78. data/samples/cgi/locale/eo/LC_MESSAGES/hellolib.mo +0 -0
  79. data/samples/cgi/locale/eo/LC_MESSAGES/main.mo +0 -0
  80. data/samples/cgi/locale/es/LC_MESSAGES/helloerb1.mo +0 -0
  81. data/samples/cgi/locale/es/LC_MESSAGES/helloerb2.mo +0 -0
  82. data/samples/cgi/locale/es/LC_MESSAGES/hellolib.mo +0 -0
  83. data/samples/cgi/locale/es/LC_MESSAGES/main.mo +0 -0
  84. data/samples/cgi/locale/fr/LC_MESSAGES/helloerb1.mo +0 -0
  85. data/samples/cgi/locale/fr/LC_MESSAGES/helloerb2.mo +0 -0
  86. data/samples/cgi/locale/fr/LC_MESSAGES/hellolib.mo +0 -0
  87. data/samples/cgi/locale/fr/LC_MESSAGES/main.mo +0 -0
  88. data/samples/cgi/locale/hr/LC_MESSAGES/helloerb1.mo +0 -0
  89. data/samples/cgi/locale/hr/LC_MESSAGES/helloerb2.mo +0 -0
  90. data/samples/cgi/locale/hr/LC_MESSAGES/hellolib.mo +0 -0
  91. data/samples/cgi/locale/hr/LC_MESSAGES/main.mo +0 -0
  92. data/samples/cgi/locale/hu/LC_MESSAGES/helloerb1.mo +0 -0
  93. data/samples/cgi/locale/hu/LC_MESSAGES/helloerb2.mo +0 -0
  94. data/samples/cgi/locale/hu/LC_MESSAGES/hellolib.mo +0 -0
  95. data/samples/cgi/locale/hu/LC_MESSAGES/main.mo +0 -0
  96. data/samples/cgi/locale/it/LC_MESSAGES/helloerb1.mo +0 -0
  97. data/samples/cgi/locale/it/LC_MESSAGES/helloerb2.mo +0 -0
  98. data/samples/cgi/locale/it/LC_MESSAGES/hellolib.mo +0 -0
  99. data/samples/cgi/locale/it/LC_MESSAGES/main.mo +0 -0
  100. data/samples/cgi/locale/ja/LC_MESSAGES/helloerb1.mo +0 -0
  101. data/samples/cgi/locale/ja/LC_MESSAGES/helloerb2.mo +0 -0
  102. data/samples/cgi/locale/ja/LC_MESSAGES/hellolib.mo +0 -0
  103. data/samples/cgi/locale/ja/LC_MESSAGES/main.mo +0 -0
  104. data/samples/cgi/locale/ko/LC_MESSAGES/helloerb1.mo +0 -0
  105. data/samples/cgi/locale/ko/LC_MESSAGES/helloerb2.mo +0 -0
  106. data/samples/cgi/locale/ko/LC_MESSAGES/hellolib.mo +0 -0
  107. data/samples/cgi/locale/ko/LC_MESSAGES/main.mo +0 -0
  108. data/samples/cgi/locale/lv/LC_MESSAGES/helloerb1.mo +0 -0
  109. data/samples/cgi/locale/lv/LC_MESSAGES/helloerb2.mo +0 -0
  110. data/samples/cgi/locale/lv/LC_MESSAGES/hellolib.mo +0 -0
  111. data/samples/cgi/locale/lv/LC_MESSAGES/main.mo +0 -0
  112. data/samples/cgi/locale/nb/LC_MESSAGES/helloerb1.mo +0 -0
  113. data/samples/cgi/locale/nb/LC_MESSAGES/helloerb2.mo +0 -0
  114. data/samples/cgi/locale/nb/LC_MESSAGES/hellolib.mo +0 -0
  115. data/samples/cgi/locale/nb/LC_MESSAGES/main.mo +0 -0
  116. data/samples/cgi/locale/nl/LC_MESSAGES/helloerb1.mo +0 -0
  117. data/samples/cgi/locale/nl/LC_MESSAGES/helloerb2.mo +0 -0
  118. data/samples/cgi/locale/nl/LC_MESSAGES/hellolib.mo +0 -0
  119. data/samples/cgi/locale/nl/LC_MESSAGES/main.mo +0 -0
  120. data/samples/cgi/locale/pt_BR/LC_MESSAGES/helloerb1.mo +0 -0
  121. data/samples/cgi/locale/pt_BR/LC_MESSAGES/helloerb2.mo +0 -0
  122. data/samples/cgi/locale/pt_BR/LC_MESSAGES/hellolib.mo +0 -0
  123. data/samples/cgi/locale/pt_BR/LC_MESSAGES/main.mo +0 -0
  124. data/samples/cgi/locale/ru/LC_MESSAGES/helloerb1.mo +0 -0
  125. data/samples/cgi/locale/ru/LC_MESSAGES/helloerb2.mo +0 -0
  126. data/samples/cgi/locale/ru/LC_MESSAGES/hellolib.mo +0 -0
  127. data/samples/cgi/locale/ru/LC_MESSAGES/main.mo +0 -0
  128. data/samples/cgi/locale/sr/LC_MESSAGES/helloerb1.mo +0 -0
  129. data/samples/cgi/locale/sr/LC_MESSAGES/helloerb2.mo +0 -0
  130. data/samples/cgi/locale/sr/LC_MESSAGES/hellolib.mo +0 -0
  131. data/samples/cgi/locale/sr/LC_MESSAGES/main.mo +0 -0
  132. data/samples/cgi/locale/ua/LC_MESSAGES/helloerb1.mo +0 -0
  133. data/samples/cgi/locale/ua/LC_MESSAGES/helloerb2.mo +0 -0
  134. data/samples/cgi/locale/ua/LC_MESSAGES/hellolib.mo +0 -0
  135. data/samples/cgi/locale/ua/LC_MESSAGES/main.mo +0 -0
  136. data/samples/cgi/locale/vi/LC_MESSAGES/helloerb1.mo +0 -0
  137. data/samples/cgi/locale/vi/LC_MESSAGES/helloerb2.mo +0 -0
  138. data/samples/cgi/locale/vi/LC_MESSAGES/hellolib.mo +0 -0
  139. data/samples/cgi/locale/vi/LC_MESSAGES/main.mo +0 -0
  140. data/samples/cgi/locale/zh/LC_MESSAGES/helloerb1.mo +0 -0
  141. data/samples/cgi/locale/zh/LC_MESSAGES/helloerb2.mo +0 -0
  142. data/samples/cgi/locale/zh/LC_MESSAGES/hellolib.mo +0 -0
  143. data/samples/cgi/locale/zh/LC_MESSAGES/main.mo +0 -0
  144. data/samples/cgi/locale/zh_TW/LC_MESSAGES/helloerb1.mo +0 -0
  145. data/samples/cgi/locale/zh_TW/LC_MESSAGES/helloerb2.mo +0 -0
  146. data/samples/cgi/locale/zh_TW/LC_MESSAGES/hellolib.mo +0 -0
  147. data/samples/cgi/locale/zh_TW/LC_MESSAGES/main.mo +0 -0
  148. data/samples/cgi/po/bg/#main.po# +84 -0
  149. data/samples/locale/bg/LC_MESSAGES/hello.mo +0 -0
  150. data/samples/locale/bg/LC_MESSAGES/hello2.mo +0 -0
  151. data/samples/locale/bg/LC_MESSAGES/hello_glade2.mo +0 -0
  152. data/samples/locale/bg/LC_MESSAGES/hello_gtk.mo +0 -0
  153. data/samples/locale/bg/LC_MESSAGES/hello_noop.mo +0 -0
  154. data/samples/locale/bg/LC_MESSAGES/hello_plural.mo +0 -0
  155. data/samples/locale/bg/LC_MESSAGES/hello_tk.mo +0 -0
  156. data/samples/locale/bs/LC_MESSAGES/hello.mo +0 -0
  157. data/samples/locale/bs/LC_MESSAGES/hello2.mo +0 -0
  158. data/samples/locale/bs/LC_MESSAGES/hello_glade2.mo +0 -0
  159. data/samples/locale/bs/LC_MESSAGES/hello_gtk.mo +0 -0
  160. data/samples/locale/bs/LC_MESSAGES/hello_noop.mo +0 -0
  161. data/samples/locale/bs/LC_MESSAGES/hello_plural.mo +0 -0
  162. data/samples/locale/bs/LC_MESSAGES/hello_tk.mo +0 -0
  163. data/samples/locale/ca/LC_MESSAGES/hello.mo +0 -0
  164. data/samples/locale/ca/LC_MESSAGES/hello2.mo +0 -0
  165. data/samples/locale/ca/LC_MESSAGES/hello_glade2.mo +0 -0
  166. data/samples/locale/ca/LC_MESSAGES/hello_gtk.mo +0 -0
  167. data/samples/locale/ca/LC_MESSAGES/hello_noop.mo +0 -0
  168. data/samples/locale/ca/LC_MESSAGES/hello_plural.mo +0 -0
  169. data/samples/locale/ca/LC_MESSAGES/hello_tk.mo +0 -0
  170. data/samples/locale/cs/LC_MESSAGES/hello.mo +0 -0
  171. data/samples/locale/cs/LC_MESSAGES/hello2.mo +0 -0
  172. data/samples/locale/cs/LC_MESSAGES/hello_glade2.mo +0 -0
  173. data/samples/locale/cs/LC_MESSAGES/hello_gtk.mo +0 -0
  174. data/samples/locale/cs/LC_MESSAGES/hello_noop.mo +0 -0
  175. data/samples/locale/cs/LC_MESSAGES/hello_plural.mo +0 -0
  176. data/samples/locale/cs/LC_MESSAGES/hello_tk.mo +0 -0
  177. data/samples/locale/de/LC_MESSAGES/hello.mo +0 -0
  178. data/samples/locale/de/LC_MESSAGES/hello2.mo +0 -0
  179. data/samples/locale/de/LC_MESSAGES/hello_glade2.mo +0 -0
  180. data/samples/locale/de/LC_MESSAGES/hello_gtk.mo +0 -0
  181. data/samples/locale/de/LC_MESSAGES/hello_noop.mo +0 -0
  182. data/samples/locale/de/LC_MESSAGES/hello_plural.mo +0 -0
  183. data/samples/locale/de/LC_MESSAGES/hello_tk.mo +0 -0
  184. data/samples/locale/el/LC_MESSAGES/hello.mo +0 -0
  185. data/samples/locale/el/LC_MESSAGES/hello2.mo +0 -0
  186. data/samples/locale/el/LC_MESSAGES/hello_glade2.mo +0 -0
  187. data/samples/locale/el/LC_MESSAGES/hello_gtk.mo +0 -0
  188. data/samples/locale/el/LC_MESSAGES/hello_noop.mo +0 -0
  189. data/samples/locale/el/LC_MESSAGES/hello_plural.mo +0 -0
  190. data/samples/locale/el/LC_MESSAGES/hello_tk.mo +0 -0
  191. data/samples/locale/eo/LC_MESSAGES/hello.mo +0 -0
  192. data/samples/locale/eo/LC_MESSAGES/hello2.mo +0 -0
  193. data/samples/locale/eo/LC_MESSAGES/hello_glade2.mo +0 -0
  194. data/samples/locale/eo/LC_MESSAGES/hello_gtk.mo +0 -0
  195. data/samples/locale/eo/LC_MESSAGES/hello_noop.mo +0 -0
  196. data/samples/locale/eo/LC_MESSAGES/hello_plural.mo +0 -0
  197. data/samples/locale/eo/LC_MESSAGES/hello_tk.mo +0 -0
  198. data/samples/locale/es/LC_MESSAGES/hello.mo +0 -0
  199. data/samples/locale/es/LC_MESSAGES/hello2.mo +0 -0
  200. data/samples/locale/es/LC_MESSAGES/hello_glade2.mo +0 -0
  201. data/samples/locale/es/LC_MESSAGES/hello_gtk.mo +0 -0
  202. data/samples/locale/es/LC_MESSAGES/hello_noop.mo +0 -0
  203. data/samples/locale/es/LC_MESSAGES/hello_plural.mo +0 -0
  204. data/samples/locale/es/LC_MESSAGES/hello_tk.mo +0 -0
  205. data/samples/locale/fr/LC_MESSAGES/hello.mo +0 -0
  206. data/samples/locale/fr/LC_MESSAGES/hello2.mo +0 -0
  207. data/samples/locale/fr/LC_MESSAGES/hello_glade2.mo +0 -0
  208. data/samples/locale/fr/LC_MESSAGES/hello_gtk.mo +0 -0
  209. data/samples/locale/fr/LC_MESSAGES/hello_noop.mo +0 -0
  210. data/samples/locale/fr/LC_MESSAGES/hello_plural.mo +0 -0
  211. data/samples/locale/fr/LC_MESSAGES/hello_tk.mo +0 -0
  212. data/samples/locale/hr/LC_MESSAGES/hello.mo +0 -0
  213. data/samples/locale/hr/LC_MESSAGES/hello2.mo +0 -0
  214. data/samples/locale/hr/LC_MESSAGES/hello_glade2.mo +0 -0
  215. data/samples/locale/hr/LC_MESSAGES/hello_gtk.mo +0 -0
  216. data/samples/locale/hr/LC_MESSAGES/hello_noop.mo +0 -0
  217. data/samples/locale/hr/LC_MESSAGES/hello_plural.mo +0 -0
  218. data/samples/locale/hr/LC_MESSAGES/hello_tk.mo +0 -0
  219. data/samples/locale/hu/LC_MESSAGES/hello.mo +0 -0
  220. data/samples/locale/hu/LC_MESSAGES/hello2.mo +0 -0
  221. data/samples/locale/hu/LC_MESSAGES/hello_glade2.mo +0 -0
  222. data/samples/locale/hu/LC_MESSAGES/hello_gtk.mo +0 -0
  223. data/samples/locale/hu/LC_MESSAGES/hello_noop.mo +0 -0
  224. data/samples/locale/hu/LC_MESSAGES/hello_plural.mo +0 -0
  225. data/samples/locale/hu/LC_MESSAGES/hello_tk.mo +0 -0
  226. data/samples/locale/it/LC_MESSAGES/hello.mo +0 -0
  227. data/samples/locale/it/LC_MESSAGES/hello2.mo +0 -0
  228. data/samples/locale/it/LC_MESSAGES/hello_glade2.mo +0 -0
  229. data/samples/locale/it/LC_MESSAGES/hello_gtk.mo +0 -0
  230. data/samples/locale/it/LC_MESSAGES/hello_noop.mo +0 -0
  231. data/samples/locale/it/LC_MESSAGES/hello_plural.mo +0 -0
  232. data/samples/locale/it/LC_MESSAGES/hello_tk.mo +0 -0
  233. data/samples/locale/ja/LC_MESSAGES/hello.mo +0 -0
  234. data/samples/locale/ja/LC_MESSAGES/hello2.mo +0 -0
  235. data/samples/locale/ja/LC_MESSAGES/hello_glade2.mo +0 -0
  236. data/samples/locale/ja/LC_MESSAGES/hello_gtk.mo +0 -0
  237. data/samples/locale/ja/LC_MESSAGES/hello_noop.mo +0 -0
  238. data/samples/locale/ja/LC_MESSAGES/hello_plural.mo +0 -0
  239. data/samples/locale/ja/LC_MESSAGES/hello_tk.mo +0 -0
  240. data/samples/locale/ko/LC_MESSAGES/hello.mo +0 -0
  241. data/samples/locale/ko/LC_MESSAGES/hello2.mo +0 -0
  242. data/samples/locale/ko/LC_MESSAGES/hello_glade2.mo +0 -0
  243. data/samples/locale/ko/LC_MESSAGES/hello_gtk.mo +0 -0
  244. data/samples/locale/ko/LC_MESSAGES/hello_noop.mo +0 -0
  245. data/samples/locale/ko/LC_MESSAGES/hello_plural.mo +0 -0
  246. data/samples/locale/ko/LC_MESSAGES/hello_tk.mo +0 -0
  247. data/samples/locale/lv/LC_MESSAGES/hello.mo +0 -0
  248. data/samples/locale/lv/LC_MESSAGES/hello2.mo +0 -0
  249. data/samples/locale/lv/LC_MESSAGES/hello_glade2.mo +0 -0
  250. data/samples/locale/lv/LC_MESSAGES/hello_gtk.mo +0 -0
  251. data/samples/locale/lv/LC_MESSAGES/hello_noop.mo +0 -0
  252. data/samples/locale/lv/LC_MESSAGES/hello_plural.mo +0 -0
  253. data/samples/locale/lv/LC_MESSAGES/hello_tk.mo +0 -0
  254. data/samples/locale/nb/LC_MESSAGES/hello.mo +0 -0
  255. data/samples/locale/nb/LC_MESSAGES/hello2.mo +0 -0
  256. data/samples/locale/nb/LC_MESSAGES/hello_glade2.mo +0 -0
  257. data/samples/locale/nb/LC_MESSAGES/hello_gtk.mo +0 -0
  258. data/samples/locale/nb/LC_MESSAGES/hello_noop.mo +0 -0
  259. data/samples/locale/nb/LC_MESSAGES/hello_plural.mo +0 -0
  260. data/samples/locale/nb/LC_MESSAGES/hello_tk.mo +0 -0
  261. data/samples/locale/nl/LC_MESSAGES/hello.mo +0 -0
  262. data/samples/locale/nl/LC_MESSAGES/hello2.mo +0 -0
  263. data/samples/locale/nl/LC_MESSAGES/hello_glade2.mo +0 -0
  264. data/samples/locale/nl/LC_MESSAGES/hello_gtk.mo +0 -0
  265. data/samples/locale/nl/LC_MESSAGES/hello_noop.mo +0 -0
  266. data/samples/locale/nl/LC_MESSAGES/hello_plural.mo +0 -0
  267. data/samples/locale/nl/LC_MESSAGES/hello_tk.mo +0 -0
  268. data/samples/locale/pt_BR/LC_MESSAGES/hello.mo +0 -0
  269. data/samples/locale/pt_BR/LC_MESSAGES/hello2.mo +0 -0
  270. data/samples/locale/pt_BR/LC_MESSAGES/hello_glade2.mo +0 -0
  271. data/samples/locale/pt_BR/LC_MESSAGES/hello_gtk.mo +0 -0
  272. data/samples/locale/pt_BR/LC_MESSAGES/hello_noop.mo +0 -0
  273. data/samples/locale/pt_BR/LC_MESSAGES/hello_plural.mo +0 -0
  274. data/samples/locale/pt_BR/LC_MESSAGES/hello_tk.mo +0 -0
  275. data/samples/locale/ru/LC_MESSAGES/hello.mo +0 -0
  276. data/samples/locale/ru/LC_MESSAGES/hello2.mo +0 -0
  277. data/samples/locale/ru/LC_MESSAGES/hello_glade2.mo +0 -0
  278. data/samples/locale/ru/LC_MESSAGES/hello_gtk.mo +0 -0
  279. data/samples/locale/ru/LC_MESSAGES/hello_noop.mo +0 -0
  280. data/samples/locale/ru/LC_MESSAGES/hello_plural.mo +0 -0
  281. data/samples/locale/ru/LC_MESSAGES/hello_tk.mo +0 -0
  282. data/samples/locale/sr/LC_MESSAGES/hello.mo +0 -0
  283. data/samples/locale/sr/LC_MESSAGES/hello2.mo +0 -0
  284. data/samples/locale/sr/LC_MESSAGES/hello_glade2.mo +0 -0
  285. data/samples/locale/sr/LC_MESSAGES/hello_gtk.mo +0 -0
  286. data/samples/locale/sr/LC_MESSAGES/hello_noop.mo +0 -0
  287. data/samples/locale/sr/LC_MESSAGES/hello_plural.mo +0 -0
  288. data/samples/locale/sr/LC_MESSAGES/hello_tk.mo +0 -0
  289. data/samples/locale/sv/LC_MESSAGES/hello.mo +0 -0
  290. data/samples/locale/sv/LC_MESSAGES/hello2.mo +0 -0
  291. data/samples/locale/sv/LC_MESSAGES/hello_glade2.mo +0 -0
  292. data/samples/locale/sv/LC_MESSAGES/hello_gtk.mo +0 -0
  293. data/samples/locale/sv/LC_MESSAGES/hello_noop.mo +0 -0
  294. data/samples/locale/sv/LC_MESSAGES/hello_plural.mo +0 -0
  295. data/samples/locale/sv/LC_MESSAGES/hello_tk.mo +0 -0
  296. data/samples/locale/ua/LC_MESSAGES/hello.mo +0 -0
  297. data/samples/locale/ua/LC_MESSAGES/hello2.mo +0 -0
  298. data/samples/locale/ua/LC_MESSAGES/hello_glade2.mo +0 -0
  299. data/samples/locale/ua/LC_MESSAGES/hello_gtk.mo +0 -0
  300. data/samples/locale/ua/LC_MESSAGES/hello_noop.mo +0 -0
  301. data/samples/locale/ua/LC_MESSAGES/hello_plural.mo +0 -0
  302. data/samples/locale/ua/LC_MESSAGES/hello_tk.mo +0 -0
  303. data/samples/locale/vi/LC_MESSAGES/hello.mo +0 -0
  304. data/samples/locale/vi/LC_MESSAGES/hello2.mo +0 -0
  305. data/samples/locale/vi/LC_MESSAGES/hello_glade2.mo +0 -0
  306. data/samples/locale/vi/LC_MESSAGES/hello_gtk.mo +0 -0
  307. data/samples/locale/vi/LC_MESSAGES/hello_noop.mo +0 -0
  308. data/samples/locale/vi/LC_MESSAGES/hello_plural.mo +0 -0
  309. data/samples/locale/vi/LC_MESSAGES/hello_tk.mo +0 -0
  310. data/samples/locale/zh/LC_MESSAGES/hello.mo +0 -0
  311. data/samples/locale/zh/LC_MESSAGES/hello2.mo +0 -0
  312. data/samples/locale/zh/LC_MESSAGES/hello_glade2.mo +0 -0
  313. data/samples/locale/zh/LC_MESSAGES/hello_gtk.mo +0 -0
  314. data/samples/locale/zh/LC_MESSAGES/hello_noop.mo +0 -0
  315. data/samples/locale/zh/LC_MESSAGES/hello_plural.mo +0 -0
  316. data/samples/locale/zh/LC_MESSAGES/hello_tk.mo +0 -0
  317. data/samples/locale/zh_TW/LC_MESSAGES/hello.mo +0 -0
  318. data/samples/locale/zh_TW/LC_MESSAGES/hello2.mo +0 -0
  319. data/samples/locale/zh_TW/LC_MESSAGES/hello_glade2.mo +0 -0
  320. data/samples/locale/zh_TW/LC_MESSAGES/hello_gtk.mo +0 -0
  321. data/samples/locale/zh_TW/LC_MESSAGES/hello_noop.mo +0 -0
  322. data/samples/locale/zh_TW/LC_MESSAGES/hello_plural.mo +0 -0
  323. data/samples/locale/zh_TW/LC_MESSAGES/hello_tk.mo +0 -0
  324. data/test.rb +33 -0
  325. data/test/locale/cr/LC_MESSAGES/plural.mo +0 -0
  326. data/test/locale/da/LC_MESSAGES/plural.mo +0 -0
  327. data/test/locale/da/LC_MESSAGES/plural_error.mo +0 -0
  328. data/test/locale/fr/LC_MESSAGES/plural.mo +0 -0
  329. data/test/locale/fr/LC_MESSAGES/plural_error.mo +0 -0
  330. data/test/locale/fr/LC_MESSAGES/test1.mo +0 -0
  331. data/test/locale/fr/LC_MESSAGES/test2.mo +0 -0
  332. data/test/locale/ir/LC_MESSAGES/plural.mo +0 -0
  333. data/test/locale/ja/LC_MESSAGES/npgettext.mo +0 -0
  334. data/test/locale/ja/LC_MESSAGES/nsgettext.mo +0 -0
  335. data/test/locale/ja/LC_MESSAGES/pgettext.mo +0 -0
  336. data/test/locale/ja/LC_MESSAGES/plural.mo +0 -0
  337. data/test/locale/ja/LC_MESSAGES/plural_error.mo +0 -0
  338. data/test/locale/ja/LC_MESSAGES/rubyparser.mo +0 -0
  339. data/test/locale/ja/LC_MESSAGES/sgettext.mo +0 -0
  340. data/test/locale/ja/LC_MESSAGES/test1.mo +0 -0
  341. data/test/locale/ja/LC_MESSAGES/test2.mo +0 -0
  342. data/test/locale/ja/LC_MESSAGES/test3.mo +0 -0
  343. data/test/locale/la/LC_MESSAGES/plural.mo +0 -0
  344. data/test/locale/la/LC_MESSAGES/plural_error.mo +0 -0
  345. data/test/locale/li/LC_MESSAGES/plural.mo +0 -0
  346. data/test/locale/li/LC_MESSAGES/plural_error.mo +0 -0
  347. data/test/locale/po/LC_MESSAGES/plural.mo +0 -0
  348. data/test/locale/sl/LC_MESSAGES/plural.mo +0 -0
  349. data/test/po/ja/test3.po +19 -0
  350. data/test/po/li/plural_error.po +27 -0
  351. data/test/test_locale_path.rb +50 -0
  352. data/test/test_po_generation.rb +20 -0
  353. data/test/test_pomessage.rb +99 -0
  354. data/test/test_textdomain_bind.rb +37 -0
  355. data/test/test_thread.rb +41 -0
  356. data/test/tools/files/app.pot +0 -0
  357. data/test/tools/files/de/app.po +0 -0
  358. data/test/tools/files/en/app.po +0 -0
  359. data/test/tools/files/en/test.po +21 -0
  360. data/test/tools/files/simple_1.po +2 -0
  361. data/test/tools/files/simple_2.po +2 -0
  362. data/test/tools/files/simple_translation.rb +1 -0
  363. data/test/tools/files/version.po +7 -0
  364. data/test/tools/test.pot +21 -0
  365. data/test/tools/test_tools.rb +61 -0
  366. metadata +710 -348
@@ -0,0 +1,356 @@
1
+ =begin
2
+ poparser.rb - Generate a .mo
3
+
4
+ Copyright (C) 2003-2009 Masao Mutoh <mutomasa at gmail.com>
5
+
6
+ You may redistribute it and/or modify it under the same
7
+ license terms as Ruby.
8
+ =end
9
+
10
+ #
11
+ # DO NOT MODIFY!!!!
12
+ # This file is automatically generated by Racc 1.4.6
13
+ # from Racc grammer file "".
14
+ #
15
+
16
+ require 'racc/parser.rb'
17
+ module GetText
18
+ class PoParser < Racc::Parser
19
+
20
+ module_eval(<<'...end poparser.ry/module_eval...', 'poparser.ry', 108)
21
+ include GetText
22
+ GetText.bindtextdomain("rgettext")
23
+
24
+ def unescape(orig)
25
+ ret = orig.gsub(/\\n/, "\n")
26
+ ret.gsub!(/\\t/, "\t")
27
+ ret.gsub!(/\\r/, "\r")
28
+ ret.gsub!(/\\"/, "\"")
29
+ ret
30
+ end
31
+
32
+ def parse(str, data, ignore_fuzzy = true)
33
+ @comments = []
34
+ @data = data
35
+ @fuzzy = false
36
+ @msgctxt = ""
37
+ $ignore_fuzzy = ignore_fuzzy
38
+
39
+ str.strip!
40
+ @q = []
41
+ until str.empty? do
42
+ case str
43
+ when /\A\s+/
44
+ str = $'
45
+ when /\Amsgctxt/
46
+ @q.push [:MSGCTXT, $&]
47
+ str = $'
48
+ when /\Amsgid_plural/
49
+ @q.push [:MSGID_PLURAL, $&]
50
+ str = $'
51
+ when /\Amsgid/
52
+ @q.push [:MSGID, $&]
53
+ str = $'
54
+ when /\Amsgstr/
55
+ @q.push [:MSGSTR, $&]
56
+ str = $'
57
+ when /\A\[(\d+)\]/
58
+ @q.push [:PLURAL_NUM, $1]
59
+ str = $'
60
+ when /\A\#~(.*)/
61
+ $stderr.print _("Warning: obsolete msgid exists.\n")
62
+ $stderr.print " #{$&}\n"
63
+ @q.push [:COMMENT, $&]
64
+ str = $'
65
+ when /\A\#(.*)/
66
+ @q.push [:COMMENT, $&]
67
+ str = $'
68
+ when /\A\"(.*)\"/
69
+ @q.push [:STRING, $1]
70
+ str = $'
71
+ else
72
+ #c = str[0,1]
73
+ #@q.push [:STRING, c]
74
+ str = str[1..-1]
75
+ end
76
+ end
77
+ @q.push [false, '$end']
78
+ if $DEBUG
79
+ @q.each do |a,b|
80
+ puts "[#{a}, #{b}]"
81
+ end
82
+ end
83
+ @yydebug = true if $DEBUG
84
+ do_parse
85
+
86
+ if @comments.size > 0
87
+ @data.set_comment(:last, @comments.join("\n"))
88
+ end
89
+ @data
90
+ end
91
+
92
+ def next_token
93
+ @q.shift
94
+ end
95
+
96
+ def on_message(msgid, msgstr)
97
+ if msgstr.size > 0
98
+ @data[msgid] = msgstr
99
+ @data.set_comment(msgid, @comments.join("\n"))
100
+ end
101
+ @comments.clear
102
+ @msgctxt = ""
103
+ end
104
+
105
+ def on_comment(comment)
106
+ @fuzzy = true if (/fuzzy/ =~ comment)
107
+ @comments << comment
108
+ end
109
+
110
+ def parse_file(po_file, data, ignore_fuzzy = true)
111
+ args = [ po_file ]
112
+ # In Ruby 1.9, we must detect proper encoding of a PO file.
113
+ if String.instance_methods.include?(:encode)
114
+ encoding = detect_file_encoding(po_file)
115
+ args << "r:#{encoding}"
116
+ end
117
+ @po_file = po_file
118
+ parse(File.open(*args) {|io| io.read }, data, ignore_fuzzy)
119
+ end
120
+
121
+ def detect_file_encoding(po_file)
122
+ open(po_file, :encoding => 'ASCII-8BIT') do |input|
123
+ input.lines.each do |line|
124
+ return Encoding.find($1) if %r["Content-Type:.*\scharset=(.*)\\n"] =~ line
125
+ end
126
+ end
127
+ Encoding.default_external
128
+ end
129
+ private :detect_file_encoding
130
+ ...end poparser.ry/module_eval...
131
+ ##### State transition tables begin ###
132
+
133
+ racc_action_table = [
134
+ 3, 13, 5, 7, 9, 15, 16, 17, 20, 17,
135
+ 13, 17, 13, 13, 11, 17, 23, 20, 13, 17 ]
136
+
137
+ racc_action_check = [
138
+ 1, 16, 1, 1, 1, 12, 12, 12, 18, 18,
139
+ 7, 14, 15, 9, 3, 19, 20, 21, 23, 25 ]
140
+
141
+ racc_action_pointer = [
142
+ nil, 0, nil, 14, nil, nil, nil, 3, nil, 6,
143
+ nil, nil, 0, nil, 4, 5, -6, nil, 2, 8,
144
+ 8, 11, nil, 11, nil, 12 ]
145
+
146
+ racc_action_default = [
147
+ -1, -16, -2, -16, -3, -13, -4, -16, -6, -16,
148
+ -7, 26, -16, -15, -5, -16, -16, -14, -16, -8,
149
+ -16, -9, -11, -16, -10, -12 ]
150
+
151
+ racc_goto_table = [
152
+ 12, 22, 14, 4, 24, 6, 2, 8, 18, 19,
153
+ 10, 21, 1, nil, nil, nil, 25 ]
154
+
155
+ racc_goto_check = [
156
+ 5, 9, 5, 3, 9, 4, 2, 6, 5, 5,
157
+ 7, 8, 1, nil, nil, nil, 5 ]
158
+
159
+ racc_goto_pointer = [
160
+ nil, 12, 5, 2, 4, -7, 6, 9, -7, -17 ]
161
+
162
+ racc_goto_default = [
163
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ]
164
+
165
+ racc_reduce_table = [
166
+ 0, 0, :racc_error,
167
+ 0, 10, :_reduce_none,
168
+ 2, 10, :_reduce_none,
169
+ 2, 10, :_reduce_none,
170
+ 2, 10, :_reduce_none,
171
+ 2, 12, :_reduce_5,
172
+ 1, 13, :_reduce_none,
173
+ 1, 13, :_reduce_none,
174
+ 4, 15, :_reduce_8,
175
+ 5, 16, :_reduce_9,
176
+ 2, 17, :_reduce_10,
177
+ 1, 17, :_reduce_none,
178
+ 3, 18, :_reduce_12,
179
+ 1, 11, :_reduce_13,
180
+ 2, 14, :_reduce_14,
181
+ 1, 14, :_reduce_15 ]
182
+
183
+ racc_reduce_n = 16
184
+
185
+ racc_shift_n = 26
186
+
187
+ racc_token_table = {
188
+ false => 0,
189
+ :error => 1,
190
+ :COMMENT => 2,
191
+ :MSGID => 3,
192
+ :MSGCTXT => 4,
193
+ :MSGID_PLURAL => 5,
194
+ :MSGSTR => 6,
195
+ :STRING => 7,
196
+ :PLURAL_NUM => 8 }
197
+
198
+ racc_nt_base = 9
199
+
200
+ racc_use_result_var = true
201
+
202
+ Racc_arg = [
203
+ racc_action_table,
204
+ racc_action_check,
205
+ racc_action_default,
206
+ racc_action_pointer,
207
+ racc_goto_table,
208
+ racc_goto_check,
209
+ racc_goto_default,
210
+ racc_goto_pointer,
211
+ racc_nt_base,
212
+ racc_reduce_table,
213
+ racc_token_table,
214
+ racc_shift_n,
215
+ racc_reduce_n,
216
+ racc_use_result_var ]
217
+
218
+ Racc_token_to_s_table = [
219
+ "$end",
220
+ "error",
221
+ "COMMENT",
222
+ "MSGID",
223
+ "MSGCTXT",
224
+ "MSGID_PLURAL",
225
+ "MSGSTR",
226
+ "STRING",
227
+ "PLURAL_NUM",
228
+ "$start",
229
+ "msgfmt",
230
+ "comment",
231
+ "msgctxt",
232
+ "message",
233
+ "string_list",
234
+ "single_message",
235
+ "plural_message",
236
+ "msgstr_plural",
237
+ "msgstr_plural_line" ]
238
+
239
+ Racc_debug_parser = true
240
+
241
+ ##### State transition tables end #####
242
+
243
+ # reduce 0 omitted
244
+
245
+ # reduce 1 omitted
246
+
247
+ # reduce 2 omitted
248
+
249
+ # reduce 3 omitted
250
+
251
+ # reduce 4 omitted
252
+
253
+ module_eval(<<'.,.,', 'poparser.ry', 23)
254
+ def _reduce_5(val, _values, result)
255
+ @msgctxt = unescape(val[1]) + "\004"
256
+
257
+ result
258
+ end
259
+ .,.,
260
+
261
+ # reduce 6 omitted
262
+
263
+ # reduce 7 omitted
264
+
265
+ module_eval(<<'.,.,', 'poparser.ry', 35)
266
+ def _reduce_8(val, _values, result)
267
+ if @fuzzy and $ignore_fuzzy
268
+ if val[1] != ""
269
+ $stderr.print _("Warning: fuzzy message was ignored.\n")
270
+ $stderr.print " #{@po_file}: msgid '#{val[1]}'\n"
271
+ else
272
+ on_message('', unescape(val[3]))
273
+ end
274
+ @fuzzy = false
275
+ else
276
+ on_message(@msgctxt + unescape(val[1]), unescape(val[3]))
277
+ end
278
+ result = ""
279
+
280
+ result
281
+ end
282
+ .,.,
283
+
284
+ module_eval(<<'.,.,', 'poparser.ry', 52)
285
+ def _reduce_9(val, _values, result)
286
+ if @fuzzy and $ignore_fuzzy
287
+ if val[1] != ""
288
+ $stderr.print _("Warning: fuzzy message was ignored.\n")
289
+ $stderr.print "msgid = '#{val[1]}\n"
290
+ else
291
+ on_message('', unescape(val[3]))
292
+ end
293
+ @fuzzy = false
294
+ else
295
+ on_message(@msgctxt + unescape(val[1]) + "\000" + unescape(val[3]), unescape(val[4]))
296
+ end
297
+ result = ""
298
+
299
+ result
300
+ end
301
+ .,.,
302
+
303
+ module_eval(<<'.,.,', 'poparser.ry', 70)
304
+ def _reduce_10(val, _values, result)
305
+ if val[0].size > 0
306
+ result = val[0] + "\000" + val[1]
307
+ else
308
+ result = ""
309
+ end
310
+
311
+ result
312
+ end
313
+ .,.,
314
+
315
+ # reduce 11 omitted
316
+
317
+ module_eval(<<'.,.,', 'poparser.ry', 82)
318
+ def _reduce_12(val, _values, result)
319
+ result = val[2]
320
+
321
+ result
322
+ end
323
+ .,.,
324
+
325
+ module_eval(<<'.,.,', 'poparser.ry', 89)
326
+ def _reduce_13(val, _values, result)
327
+ on_comment(val[0])
328
+
329
+ result
330
+ end
331
+ .,.,
332
+
333
+ module_eval(<<'.,.,', 'poparser.ry', 97)
334
+ def _reduce_14(val, _values, result)
335
+ result = val.delete_if{|item| item == ""}.join
336
+
337
+ result
338
+ end
339
+ .,.,
340
+
341
+ module_eval(<<'.,.,', 'poparser.ry', 101)
342
+ def _reduce_15(val, _values, result)
343
+ result = val[0]
344
+
345
+ result
346
+ end
347
+ .,.,
348
+
349
+ def _reduce_none(val, _values, result)
350
+ val[0]
351
+ end
352
+
353
+ end # class PoParser
354
+ end # module GetText
355
+
356
+
@@ -1,7 +1,7 @@
1
1
  #! /usr/bin/env ruby
2
2
  =begin
3
3
  rgettext.rb - Generate a .pot file.
4
-
4
+
5
5
  Copyright (C) 2003-2009 Masao Mutoh
6
6
  Copyright (C) 2001,2002 Yasushi Shoji, Masao Mutoh
7
7
 
@@ -11,18 +11,18 @@
11
11
  You may redistribute it and/or modify it under the same
12
12
  license terms as Ruby or LGPL.
13
13
  =end
14
-
14
+
15
15
  require 'optparse'
16
16
  require 'gettext'
17
17
  require 'rbconfig'
18
-
18
+
19
19
  module GetText
20
-
20
+
21
21
  module RGetText #:nodoc:
22
22
  extend GetText
23
-
23
+
24
24
  bindtextdomain("rgettext")
25
-
25
+
26
26
  # constant values
27
27
  VERSION = GetText::VERSION
28
28
 
@@ -41,9 +41,9 @@ module GetText
41
41
  $stderr.puts $! if $DEBUG
42
42
  end
43
43
  end
44
-
44
+
45
45
  module_function
46
-
46
+
47
47
  # Add an option parser
48
48
  # the option parser module requires to have target?(file) and parser(file, ary) method.
49
49
  #
@@ -63,13 +63,13 @@ module GetText
63
63
  def add_parser(klass)
64
64
  @ex_parsers.insert(0, klass)
65
65
  end
66
-
66
+
67
67
  def generate_pot_header # :nodoc:
68
68
  time = Time.now.strftime("%Y-%m-%d %H:%M")
69
69
  off = Time.now.utc_offset
70
70
  sign = off <= 0 ? '-' : '+'
71
71
  time += sprintf('%s%02d%02d', sign, *(off.abs / 60).divmod(60))
72
-
72
+
73
73
  <<TITLE
74
74
  # SOME DESCRIPTIVE TITLE.
75
75
  # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
@@ -90,16 +90,32 @@ msgstr ""
90
90
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\n"
91
91
  TITLE
92
92
  end
93
-
93
+
94
+ #PARSE HERE
94
95
  def generate_pot(paths) # :nodoc:
95
96
  pomessages = parse(paths)
96
97
  str = ""
98
+
97
99
  pomessages.each do |target|
98
- str << target.to_po_str
100
+ unless target.to_po_str.include? "[private]"
101
+ str << target.to_po_str
102
+ end
99
103
  end
100
104
  str
101
105
  end
102
-
106
+
107
+ def generate_private_pot(paths)
108
+ pomessages = parse(paths)
109
+ private_str = ""
110
+
111
+ pomessages.each do |target|
112
+ if target.to_po_str.include? "[private]"
113
+ private_str << target.to_po_str
114
+ end
115
+ end
116
+ private_str
117
+ end
118
+
103
119
  def parse(paths) # :nodoc:
104
120
  pomessages = []
105
121
  paths.each do |path|
@@ -112,12 +128,12 @@ TITLE
112
128
  # For backward compatibility.
113
129
  targets = klass.parse(path, [])
114
130
  end
115
-
131
+
116
132
  targets.each{|pomessage|
117
133
  if pomessage.kind_of? Array
118
134
  pomessage = PoMessage.new_from_ary(pomessage)
119
135
  end
120
-
136
+
121
137
  # Save the previous target.
122
138
  existing = pomessages.find_index {|t| t == pomessage}
123
139
  if existing
@@ -137,17 +153,17 @@ TITLE
137
153
  end
138
154
  pomessages
139
155
  end
140
-
156
+
141
157
  def check_options # :nodoc:
142
158
  output = STDOUT
143
-
159
+
144
160
  opts = OptionParser.new
145
161
  opts.banner = _("Usage: %s input.rb [-r parser.rb] [-o output.pot]") % $0
146
162
  opts.separator("")
147
163
  opts.separator(_("Extract translatable strings from given input files."))
148
164
  opts.separator("")
149
165
  opts.separator(_("Specific options:"))
150
-
166
+
151
167
  opts.on("-o", "--output=FILE", _("write output to specified file")) do |out|
152
168
  unless FileTest.exist? out
153
169
  output = File.new(File.expand_path(out), "w+")
@@ -156,50 +172,56 @@ TITLE
156
172
  exit 1
157
173
  end
158
174
  end
159
-
175
+
160
176
  opts.on("-r", "--require=library", _("require the library before executing rgettext")) do |out|
161
177
  require out
162
178
  end
163
-
179
+
164
180
  opts.on("-d", "--debug", _("run in debugging mode")) do
165
181
  $DEBUG = true
166
182
  end
167
-
183
+
168
184
  opts.on_tail("--version", _("display version information and exit")) do
169
185
  puts "#{$0} #{VERSION}"
170
186
  puts "#{File.join(Config::CONFIG["bindir"], Config::CONFIG["RUBY_INSTALL_NAME"])} #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
171
187
  exit
172
188
  end
173
-
189
+
174
190
  opts.parse!(ARGV)
175
-
191
+
176
192
  if ARGV.size == 0
177
193
  puts opts.help
178
194
  exit 1
179
195
  end
180
-
196
+
181
197
  [ARGV, output]
182
198
  end
183
-
184
- def run(paths = nil, out = STDOUT) # :nodoc:
199
+
200
+ def run(paths = nil, out = STDOUT, private_out)
185
201
  if paths.is_a? String
186
202
  paths = [paths]
187
203
  elsif ! paths
188
204
  paths, out = check_options
189
205
  end
190
-
206
+
191
207
  if paths.size == 0
192
208
  raise ArgumentError, _("no input files")
193
209
  end
194
-
195
- if out.is_a? String
210
+
211
+ if ((out.is_a? String) and (private_out.is_a? String))
196
212
  File.open(File.expand_path(out), "w+") do |file|
197
213
  file.puts generate_pot_header
198
214
  file.puts generate_pot(paths)
199
215
  end
216
+ File.open(File.expand_path(private_out), "w+") do |file|
217
+ file.puts generate_pot_header
218
+ file.puts generate_private_pot(paths)
219
+ end
200
220
  else
201
221
  out.puts generate_pot_header
202
222
  out.puts generate_pot(paths)
223
+ private_out.puts generate_pot_header
224
+ private_out.puts generate_private_pot(paths)
203
225
  end
204
226
  self
205
227
  end
@@ -214,13 +236,13 @@ TITLE
214
236
  # * paths: An Array of po-file paths or nil.
215
237
  # * out: output IO or output path.
216
238
  # * Returns: self
217
- def rgettext(paths = nil, out = STDOUT)
218
- RGetText.run(paths, out)
239
+ def rgettext(paths = nil, out = STDOUT, private_out)
240
+ RGetText.run(paths, out, private_out)
219
241
  self
220
242
  end
221
243
  end
222
-
244
+
223
245
  if $0 == __FILE__
224
246
  GetText.rgettext
225
247
  # GetText.rgettext($0, "tmp.txt")
226
- end
248
+ end