gettext 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. data/ChangeLog +113 -0
  2. data/NEWS +17 -1
  3. data/README +56 -46
  4. data/Rakefile +6 -2
  5. data/data/locale/cs/LC_MESSAGES/rails.mo +0 -0
  6. data/data/locale/cs/LC_MESSAGES/rgettext.mo +0 -0
  7. data/data/locale/de/LC_MESSAGES/rails.mo +0 -0
  8. data/data/locale/de/LC_MESSAGES/rgettext.mo +0 -0
  9. data/data/locale/el/LC_MESSAGES/rails.mo +0 -0
  10. data/data/locale/el/LC_MESSAGES/rgettext.mo +0 -0
  11. data/data/locale/es/LC_MESSAGES/rails.mo +0 -0
  12. data/data/locale/es/LC_MESSAGES/rgettext.mo +0 -0
  13. data/data/locale/fr/LC_MESSAGES/rails.mo +0 -0
  14. data/data/locale/fr/LC_MESSAGES/rgettext.mo +0 -0
  15. data/data/locale/it/LC_MESSAGES/rails.mo +0 -0
  16. data/data/locale/it/LC_MESSAGES/rgettext.mo +0 -0
  17. data/data/locale/ja/LC_MESSAGES/rails.mo +0 -0
  18. data/data/locale/ja/LC_MESSAGES/rgettext.mo +0 -0
  19. data/data/locale/ko/LC_MESSAGES/rails.mo +0 -0
  20. data/data/locale/ko/LC_MESSAGES/rgettext.mo +0 -0
  21. data/data/locale/nl/LC_MESSAGES/rails.mo +0 -0
  22. data/data/locale/nl/LC_MESSAGES/rgettext.mo +0 -0
  23. data/data/locale/pt_BR/LC_MESSAGES/rails.mo +0 -0
  24. data/data/locale/pt_BR/LC_MESSAGES/rgettext.mo +0 -0
  25. data/data/locale/ru/LC_MESSAGES/rails.mo +0 -0
  26. data/data/locale/ru/LC_MESSAGES/rgettext.mo +0 -0
  27. data/data/locale/sv/LC_MESSAGES/rgettext.mo +0 -0
  28. data/data/locale/zh/LC_MESSAGES/rails.mo +0 -0
  29. data/data/locale/zh/LC_MESSAGES/rgettext.mo +0 -0
  30. data/ext/gettext/locale_system.c +3 -3
  31. data/lib/gettext.rb +149 -98
  32. data/lib/gettext/container.rb +3 -23
  33. data/lib/gettext/erb.rb +2 -2
  34. data/lib/gettext/locale_posix.rb +37 -5
  35. data/lib/gettext/locale_win32.rb +2 -1
  36. data/lib/gettext/mo.rb +6 -4
  37. data/lib/gettext/parser/activerecord.rb +7 -3
  38. data/lib/gettext/poparser.rb +2 -2
  39. data/lib/gettext/rails.rb +131 -112
  40. data/lib/gettext/rgettext.rb +3 -1
  41. data/lib/gettext/rmsgfmt.rb +3 -1
  42. data/lib/gettext/rmsgmerge.rb +3 -1
  43. data/lib/gettext/textdomain.rb +14 -8
  44. data/lib/gettext/textdomainmanager.rb +103 -0
  45. data/lib/gettext/version.rb +1 -1
  46. data/po/cs/rails.po +16 -16
  47. data/po/cs/rgettext.po +7 -3
  48. data/po/de/rails.po +16 -16
  49. data/po/de/rgettext.po +7 -3
  50. data/po/el/rails.po +16 -16
  51. data/po/el/rgettext.po +7 -3
  52. data/po/es/rails.po +16 -16
  53. data/po/es/rgettext.po +7 -3
  54. data/po/fr/rails.po +16 -16
  55. data/po/fr/rgettext.po +7 -3
  56. data/po/it/rails.po +79 -0
  57. data/po/it/rgettext.po +42 -32
  58. data/po/ja/rails.po +20 -18
  59. data/po/ja/rgettext.po +7 -3
  60. data/po/ko/rails.po +16 -16
  61. data/po/ko/rgettext.po +7 -3
  62. data/po/nl/rails.po +16 -16
  63. data/po/nl/rgettext.po +7 -3
  64. data/po/pt_BR/rails.po +16 -16
  65. data/po/pt_BR/rgettext.po +7 -3
  66. data/po/rails.pot +16 -16
  67. data/po/rgettext.pot +7 -3
  68. data/po/ru/rails.po +18 -18
  69. data/po/ru/rgettext.po +13 -9
  70. data/po/sv/rgettext.po +7 -3
  71. data/po/zh/rails.po +78 -0
  72. data/po/zh/rgettext.po +104 -0
  73. data/pre-setup.rb +1 -4
  74. data/samples/cgi/helloerb.rhtml +1 -0
  75. data/samples/cgi/locale/zh/LC_MESSAGES/helloerb1.mo +0 -0
  76. data/samples/cgi/locale/zh/LC_MESSAGES/helloerb2.mo +0 -0
  77. data/samples/cgi/locale/zh/LC_MESSAGES/hellolib.mo +0 -0
  78. data/samples/cgi/locale/zh/LC_MESSAGES/main.mo +0 -0
  79. data/samples/cgi/po/zh/helloerb1.po +60 -0
  80. data/samples/cgi/po/zh/helloerb2.po +52 -0
  81. data/samples/cgi/po/zh/hellolib.po +24 -0
  82. data/samples/cgi/po/zh/main.po +80 -0
  83. data/samples/hello.rb +28 -5
  84. data/samples/hello2.rb +13 -6
  85. data/samples/hello_noop.rb +20 -8
  86. data/samples/hello_plural.rb +16 -6
  87. data/samples/hello_textdomain.rb +13 -4
  88. data/samples/hellogtk.rb +5 -4
  89. data/samples/hellogtk2.rb +5 -6
  90. data/samples/locale/cs/LC_MESSAGES/hello2.mo +0 -0
  91. data/samples/locale/cs/LC_MESSAGES/hello_plural.mo +0 -0
  92. data/samples/locale/de/LC_MESSAGES/hello2.mo +0 -0
  93. data/samples/locale/de/LC_MESSAGES/hello_plural.mo +0 -0
  94. data/samples/locale/el/LC_MESSAGES/hello2.mo +0 -0
  95. data/samples/locale/el/LC_MESSAGES/hello_plural.mo +0 -0
  96. data/samples/locale/es/LC_MESSAGES/hello2.mo +0 -0
  97. data/samples/locale/es/LC_MESSAGES/hello_plural.mo +0 -0
  98. data/samples/locale/fr/LC_MESSAGES/hello2.mo +0 -0
  99. data/samples/locale/fr/LC_MESSAGES/hello_plural.mo +0 -0
  100. data/samples/locale/it/LC_MESSAGES/hello2.mo +0 -0
  101. data/samples/locale/it/LC_MESSAGES/hello_plural.mo +0 -0
  102. data/samples/locale/ja/LC_MESSAGES/hello2.mo +0 -0
  103. data/samples/locale/ja/LC_MESSAGES/hello_plural.mo +0 -0
  104. data/samples/locale/ko/LC_MESSAGES/hello2.mo +0 -0
  105. data/samples/locale/ko/LC_MESSAGES/hello_plural.mo +0 -0
  106. data/samples/locale/nl/LC_MESSAGES/hello2.mo +0 -0
  107. data/samples/locale/nl/LC_MESSAGES/hello_plural.mo +0 -0
  108. data/samples/locale/pt_BR/LC_MESSAGES/hello2.mo +0 -0
  109. data/samples/locale/pt_BR/LC_MESSAGES/hello_plural.mo +0 -0
  110. data/samples/locale/ru/LC_MESSAGES/hello2.mo +0 -0
  111. data/samples/locale/ru/LC_MESSAGES/hello_plural.mo +0 -0
  112. data/samples/locale/sv/LC_MESSAGES/hello2.mo +0 -0
  113. data/samples/locale/sv/LC_MESSAGES/hello_plural.mo +0 -0
  114. data/samples/locale/zh/LC_MESSAGES/hello.mo +0 -0
  115. data/samples/locale/zh/LC_MESSAGES/hello2.mo +0 -0
  116. data/samples/locale/zh/LC_MESSAGES/hello_noop.mo +0 -0
  117. data/samples/locale/zh/LC_MESSAGES/hello_plural.mo +0 -0
  118. data/samples/locale/zh/LC_MESSAGES/helloglade2.mo +0 -0
  119. data/samples/locale/zh/LC_MESSAGES/hellogtk.mo +0 -0
  120. data/samples/locale/zh/LC_MESSAGES/hellotk.mo +0 -0
  121. data/samples/po/cs/hello2.po +4 -4
  122. data/samples/po/cs/hello_plural.po +5 -5
  123. data/samples/po/de/hello2.po +4 -4
  124. data/samples/po/de/hello_plural.po +9 -6
  125. data/samples/po/el/hello2.po +4 -4
  126. data/samples/po/el/hello_plural.po +3 -3
  127. data/samples/po/es/hello2.po +4 -4
  128. data/samples/po/es/hello_plural.po +6 -6
  129. data/samples/po/fr/hello2.po +4 -4
  130. data/samples/po/fr/hello_plural.po +3 -3
  131. data/samples/po/hello2.pot +2 -2
  132. data/samples/po/hello_plural.pot +1 -1
  133. data/samples/po/it/hello2.po +4 -4
  134. data/samples/po/it/hello_plural.po +4 -5
  135. data/samples/po/ja/hello2.po +4 -4
  136. data/samples/po/ja/hello_plural.po +4 -5
  137. data/samples/po/ko/hello2.po +4 -4
  138. data/samples/po/ko/hello_plural.po +10 -7
  139. data/samples/po/nl/hello2.po +4 -4
  140. data/samples/po/nl/hello_plural.po +6 -7
  141. data/samples/po/pt_BR/hello2.po +4 -4
  142. data/samples/po/pt_BR/hello_plural.po +6 -6
  143. data/samples/po/ru/hello2.po +4 -4
  144. data/samples/po/ru/hello_plural.po +10 -7
  145. data/samples/po/sv/hello2.po +4 -4
  146. data/samples/po/sv/hello_plural.po +4 -4
  147. data/samples/po/zh/hello.po +23 -0
  148. data/samples/po/zh/hello2.po +31 -0
  149. data/samples/po/zh/hello_noop.po +27 -0
  150. data/samples/po/zh/hello_plural.po +25 -0
  151. data/samples/po/zh/helloglade2.po +31 -0
  152. data/samples/po/zh/hellogtk.po +23 -0
  153. data/samples/po/zh/hellotk.po +23 -0
  154. data/samples/rails/README +2 -2
  155. data/samples/rails/lib/tasks/gettext.rake +0 -3
  156. data/samples/rails/locale/cs/LC_MESSAGES/blog.mo +0 -0
  157. data/samples/rails/locale/de/LC_MESSAGES/blog.mo +0 -0
  158. data/samples/rails/locale/el/LC_MESSAGES/blog.mo +0 -0
  159. data/samples/rails/locale/en/LC_MESSAGES/blog.mo +0 -0
  160. data/samples/rails/locale/es/LC_MESSAGES/blog.mo +0 -0
  161. data/samples/rails/locale/fr/LC_MESSAGES/blog.mo +0 -0
  162. data/samples/rails/locale/it/LC_MESSAGES/blog.mo +0 -0
  163. data/samples/rails/locale/ja/LC_MESSAGES/blog.mo +0 -0
  164. data/samples/rails/locale/ko/LC_MESSAGES/blog.mo +0 -0
  165. data/samples/rails/locale/nl/LC_MESSAGES/blog.mo +0 -0
  166. data/samples/rails/locale/pt_BR/LC_MESSAGES/blog.mo +0 -0
  167. data/samples/rails/locale/ru/LC_MESSAGES/blog.mo +0 -0
  168. data/samples/rails/locale/zh/LC_MESSAGES/blog.mo +0 -0
  169. data/samples/rails/po/blog.pot +1 -1
  170. data/samples/rails/po/cs/blog.po +1 -1
  171. data/samples/rails/po/de/blog.po +1 -1
  172. data/samples/rails/po/el/blog.po +1 -1
  173. data/samples/rails/po/en/blog.po +3 -3
  174. data/samples/rails/po/es/blog.po +1 -1
  175. data/samples/rails/po/fr/blog.po +1 -1
  176. data/samples/rails/po/it/blog.po +109 -0
  177. data/samples/rails/po/ja/blog.po +1 -14
  178. data/samples/rails/po/ko/blog.po +2 -2
  179. data/samples/rails/po/nl/blog.po +1 -1
  180. data/samples/rails/po/pt_BR/blog.po +1 -1
  181. data/samples/rails/po/ru/blog.po +1 -2
  182. data/samples/rails/po/zh/blog.po +109 -0
  183. data/samples/rails/vendor/plugins/gettext/README +17 -0
  184. data/samples/rails/vendor/plugins/gettext/Rakefile +17 -0
  185. data/samples/rails/vendor/plugins/gettext/lib/gettext_plugin.rb +16 -35
  186. data/samples/rails/{locale → vendor/plugins/gettext/locale}/cs/LC_MESSAGES/gettext_plugin.mo +0 -0
  187. data/samples/rails/{locale → vendor/plugins/gettext/locale}/de/LC_MESSAGES/gettext_plugin.mo +0 -0
  188. data/samples/rails/{locale → vendor/plugins/gettext/locale}/el/LC_MESSAGES/gettext_plugin.mo +0 -0
  189. data/samples/rails/{locale → vendor/plugins/gettext/locale}/es/LC_MESSAGES/gettext_plugin.mo +0 -0
  190. data/samples/rails/{locale → vendor/plugins/gettext/locale}/fr/LC_MESSAGES/gettext_plugin.mo +0 -0
  191. data/samples/rails/vendor/plugins/gettext/locale/it/LC_MESSAGES/gettext_plugin.mo +0 -0
  192. data/samples/rails/{locale → vendor/plugins/gettext/locale}/ja/LC_MESSAGES/gettext_plugin.mo +0 -0
  193. data/samples/rails/{locale → vendor/plugins/gettext/locale}/ko/LC_MESSAGES/gettext_plugin.mo +0 -0
  194. data/samples/rails/{locale → vendor/plugins/gettext/locale}/nl/LC_MESSAGES/gettext_plugin.mo +0 -0
  195. data/samples/rails/{locale → vendor/plugins/gettext/locale}/pt_BR/LC_MESSAGES/gettext_plugin.mo +0 -0
  196. data/samples/rails/{locale → vendor/plugins/gettext/locale}/ru/LC_MESSAGES/gettext_plugin.mo +0 -0
  197. data/samples/rails/vendor/plugins/gettext/locale/zh/LC_MESSAGES/gettext_plugin.mo +0 -0
  198. data/samples/rails/{po → vendor/plugins/gettext/po}/cs/gettext_plugin.po +4 -4
  199. data/samples/rails/{po → vendor/plugins/gettext/po}/de/gettext_plugin.po +4 -4
  200. data/samples/rails/{po → vendor/plugins/gettext/po}/el/gettext_plugin.po +4 -4
  201. data/samples/rails/{po → vendor/plugins/gettext/po}/es/gettext_plugin.po +4 -4
  202. data/samples/rails/{po → vendor/plugins/gettext/po}/fr/gettext_plugin.po +4 -4
  203. data/samples/rails/{po → vendor/plugins/gettext/po}/gettext_plugin.pot +4 -4
  204. data/samples/rails/vendor/plugins/gettext/po/it/gettext_plugin.po +27 -0
  205. data/samples/rails/{po → vendor/plugins/gettext/po}/ja/gettext_plugin.po +4 -4
  206. data/samples/rails/{po → vendor/plugins/gettext/po}/ko/gettext_plugin.po +4 -4
  207. data/samples/rails/{po → vendor/plugins/gettext/po}/nl/gettext_plugin.po +4 -4
  208. data/samples/rails/{po → vendor/plugins/gettext/po}/pt_BR/gettext_plugin.po +4 -4
  209. data/samples/rails/{po → vendor/plugins/gettext/po}/ru/gettext_plugin.po +4 -5
  210. data/samples/rails/vendor/plugins/gettext/po/zh/gettext_plugin.po +27 -0
  211. data/test/gettext_test.rb +18 -14
  212. data/test/gettext_test_multi_textdomain.rb +49 -0
  213. data/test/locale/fr/LC_MESSAGES/test6.mo +0 -0
  214. data/test/locale/ja/LC_MESSAGES/test6.mo +0 -0
  215. data/test/po/fr/test6.po +23 -0
  216. data/test/po/ja/test6.po +23 -0
  217. data/test/test.sh +3 -1
  218. data/test/testlib1.rb +0 -5
  219. data/test/testlib5.rb +70 -0
  220. data/test/testlib6.rb +19 -0
  221. metadata +128 -26
  222. data/COPYING.ja +0 -51
  223. data/po/it/messages.mo +0 -0
  224. data/samples/cgi/po/it/messages.mo +0 -0
@@ -0,0 +1,104 @@
1
+ # translation of rgettext.po to Simplified Chinese
2
+ #
3
+ # a po-file for Ruby-GetText-Package
4
+ #
5
+ # Copyright (C) 2006 Masao Mutoh
6
+ # This file is distributed under the same license as the Ruby-GetText-Package.
7
+ # Yingfeng <blogyingfeng at gmail.com>, 2006.
8
+ #
9
+ msgid ""
10
+ msgstr ""
11
+ "Project-Id-Version: ruby-gettext 1.5.0\n"
12
+ "POT-Creation-Date: 2006-06-04 18:48+0900\n"
13
+ "PO-Revision-Date: 2006-04-15 13:11+0300\n"
14
+ "Last-Translator: Yingfeng <blogyingfeng at gmail.com>\n"
15
+ "Language-Team: Simplified Chinese\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=1; plural=0;\n"
20
+ "X-Generator: KBabel 1.9.1\n"
21
+
22
+ #: lib/gettext/rmsgmerge.rb:402
23
+ msgid "Usage: %s def.po ref.pot [-o output.pot]"
24
+ msgstr "使用方法:%s def.po ref.pot [-o output.pot]"
25
+
26
+ #: lib/gettext/rmsgmerge.rb:405
27
+ msgid ""
28
+ "Merges two Uniforum style .po files together. The def.po file is an existing "
29
+ "PO file with translations. The ref.pot file is the last created PO file with "
30
+ "up-to-date source references. ref.pot is generally created by rgettext."
31
+ msgstr ""
32
+ "将两个统一风格的.po文件合并到一起。def.po文件是已经存在的有翻译信息的PO文件,"
33
+ "ref.pot文件是最后创建的拥有最新源参考信息的PO文件,ref.pot由rgettext创建。"
34
+
35
+ #: lib/gettext/rmsgmerge.rb:407 lib/gettext/rgettext.rb:132
36
+ #: lib/gettext/rmsgfmt.rb:50
37
+ msgid "Specific options:"
38
+ msgstr "具体选项:"
39
+
40
+ #: lib/gettext/rmsgmerge.rb:409 lib/gettext/rgettext.rb:134
41
+ #: lib/gettext/rmsgfmt.rb:52
42
+ msgid "write output to specified file"
43
+ msgstr "输出到指定文件"
44
+
45
+ #: lib/gettext/rmsgmerge.rb:420 lib/gettext/rgettext.rb:143
46
+ #: lib/gettext/rmsgfmt.rb:56
47
+ msgid "display version information and exit"
48
+ msgstr "显示版本信息并退出"
49
+
50
+ #: lib/gettext/rmsgmerge.rb:445
51
+ msgid "definition po is not given."
52
+ msgstr "po的定义未给出。"
53
+
54
+ #: lib/gettext/rmsgmerge.rb:447
55
+ msgid "reference pot is not given."
56
+ msgstr "参考pot未指定。"
57
+
58
+ #: lib/gettext/rgettext.rb:42
59
+ msgid "'%{klass}' is ignored."
60
+ msgstr "'%{klass}'被忽略。"
61
+
62
+ #: lib/gettext/rgettext.rb:128
63
+ msgid "Usage: %s input.rb [-o output.pot]"
64
+ msgstr "使用方法:%s input.rb [-o output.pot]"
65
+
66
+ #: lib/gettext/rgettext.rb:130
67
+ msgid "Extract translatable strings from given input files."
68
+ msgstr "从给定输入文件中提取翻译字符串。"
69
+
70
+ #: lib/gettext/rgettext.rb:138
71
+ msgid "File '%s' has already existed."
72
+ msgstr "文件'%s'已经存在。"
73
+
74
+ #: lib/gettext/rgettext.rb:166 lib/gettext/rmsgfmt.rb:30
75
+ msgid "no input files"
76
+ msgstr "没有输入文件"
77
+
78
+ #: lib/gettext/rmsgfmt.rb:46
79
+ msgid "Usage: %s input.po [-o output.mo]"
80
+ msgstr "使用方法: %s input.po [-o output.mo]"
81
+
82
+ #: lib/gettext/rmsgfmt.rb:48
83
+ msgid "Generate binary message catalog from textual translation description."
84
+ msgstr "从文本叙述翻译生成二进制信息目录。"
85
+
86
+ #: lib/gettext/parser/activerecord.rb:38
87
+ msgid "'%{file}' is not found."
88
+ msgstr "'%{file}'未找到。"
89
+
90
+ #: lib/gettext/parser/activerecord.rb:66
91
+ msgid "Ignored '%{file}'. Solve dependencies first."
92
+ msgstr "'%{file}'被忽略,请先解决依赖关系。"
93
+
94
+ #: lib/gettext/parser/activerecord.rb:85
95
+ msgid "No database is available."
96
+ msgstr "没有可用的数据库。"
97
+
98
+ #: lib/gettext/parser/activerecord.rb:116
99
+ msgid "rubygems are not found."
100
+ msgstr ""
101
+
102
+ #: lib/gettext/parser/glade.rb:75
103
+ msgid "%s is not glade-2.0 format."
104
+ msgstr "%s不是glade-2.0格式。"
@@ -4,7 +4,7 @@
4
4
  Copyright(c) 2005,2006 Masao Mutoh
5
5
  This program is licenced under the same licence as Ruby.
6
6
 
7
- $Id: pre-setup.rb,v 1.5 2006/02/07 00:24:44 mutoh Exp $
7
+ $Id: pre-setup.rb,v 1.6 2006/05/13 17:20:52 mutoh Exp $
8
8
  =end
9
9
 
10
10
  require 'fileutils'
@@ -20,6 +20,3 @@ FileUtils.rm_rf gettext_dir if FileTest.exist?(gettext_dir)
20
20
  FileUtils.rm_rf gettext_dir2 if FileTest.exist?(gettext_dir2)
21
21
  FileUtils.rm_f locale if FileTest.exist?(locale)
22
22
 
23
- rake = "#{ruby} #{File.join(config("bindir"), "rake")} setup"
24
-
25
- system(rake)
@@ -7,6 +7,7 @@
7
7
  <body>
8
8
  <%
9
9
  require 'hellolib'
10
+ require 'cgi'
10
11
  lib = HelloLib.new
11
12
  %>
12
13
  <h1><%= _("Hello World") %> - <%= @domainname %></h1>
@@ -0,0 +1,60 @@
1
+ # CGI/ERB sample for Ruby-GetText-Package.
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
+ # Yingfeng <blogyingfeng at gmail.com>, 2006.
8
+ #
9
+ msgid ""
10
+ msgstr ""
11
+ "Project-Id-Version: cgi-sample 1.1.1\n"
12
+ "POT-Creation-Date: 2006-03-04 22:50+0900\n"
13
+ "PO-Revision-Date: 2006-04-15 13:11+0300\n"
14
+ "Last-Translator: Yingfeng <blogyingfeng at gmail.com>\n"
15
+ "Language-Team: Simplified Chinese\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=1; plural=0;\n"
20
+ "X-Generator: KBabel 1.9.1\n"
21
+
22
+ #: helloerb1.cgi:32
23
+ msgid "Sample script for CGI/ERB (UTF-8)."
24
+ msgstr "用于CGI/ERB的示例脚本(UTF-8)"
25
+
26
+ #: helloerb.rhtml:5 other.rhtml:5
27
+ msgid "Sample script for CGI/ERB and Ruby-GetText-Package"
28
+ msgstr "用于CGI/ERB和Ruby-GetText-Package的示例脚本"
29
+
30
+ #: helloerb.rhtml:12
31
+ msgid "Hello World"
32
+ msgstr "你好世界"
33
+
34
+ #: helloerb.rhtml:15 other.rhtml:11
35
+ msgid "locale"
36
+ msgstr "本地"
37
+
38
+ #: helloerb.rhtml:16 other.rhtml:12
39
+ msgid "output_charset"
40
+ msgstr "输出字符集"
41
+
42
+ #: helloerb.rhtml:17 other.rhtml:13
43
+ msgid "QUERY_STRING"
44
+ msgstr "QUERY_STRING"
45
+
46
+ #: helloerb.rhtml:19
47
+ msgid "Call a library method which has another textdomain."
48
+ msgstr "调用具备其他textdomain的库方法"
49
+
50
+ #: helloerb.rhtml:21 other.rhtml:15
51
+ msgid "Back"
52
+ msgstr "返回"
53
+
54
+ #: other.rhtml:8
55
+ msgid "Another sample"
56
+ msgstr "另一个示例"
57
+
58
+ #: other.rhtml:9
59
+ msgid "This sample(other.rhtml) is the another ERB file of helloerb1.cgi."
60
+ msgstr "示例(other.rhtml)是helloerb1.cgi的另一个ERB文件"
@@ -0,0 +1,52 @@
1
+ # CGI/ERB sample for Ruby-GetText-Package.
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
+ # Yingfeng <blogyingfeng at gmail.com>, 2006.
8
+ #
9
+ msgid ""
10
+ msgstr ""
11
+ "Project-Id-Version: cgi-sample 1.1.1\n"
12
+ "POT-Creation-Date: 2006-03-04 22:50+0900\n"
13
+ "PO-Revision-Date: 2006-04-15 13:11+0300\n"
14
+ "Last-Translator: Yingfeng <blogyingfeng at gmail.com>\n"
15
+ "Language-Team: Simplified Chinese\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=1; plural=0;\n"
20
+ "X-Generator: KBabel 1.9.1\n"
21
+
22
+ #: helloerb2.cgi:34
23
+ msgid "Sample script for CGI/ERB (Auto-Detect charset)."
24
+ msgstr "用于CGI/ERB的示例脚本(自动检测字符集)"
25
+
26
+ #: helloerb.rhtml:5
27
+ msgid "Sample script for CGI/ERB and Ruby-GetText-Package"
28
+ msgstr "用于CGI/ERB和Ruby-GetText-Package的示例脚本"
29
+
30
+ #: helloerb.rhtml:12
31
+ msgid "Hello World"
32
+ msgstr "你好世界"
33
+
34
+ #: helloerb.rhtml:15
35
+ msgid "locale"
36
+ msgstr "本地"
37
+
38
+ #: helloerb.rhtml:16
39
+ msgid "output_charset"
40
+ msgstr "输出字符集"
41
+
42
+ #: helloerb.rhtml:17
43
+ msgid "QUERY_STRING"
44
+ msgstr "QUERY_STRING"
45
+
46
+ #: helloerb.rhtml:19
47
+ msgid "Call a library method which has another textdomain."
48
+ msgstr "调用具备其他textdomain的库方法"
49
+
50
+ #: helloerb.rhtml:21
51
+ msgid "Back"
52
+ msgstr "返回"
@@ -0,0 +1,24 @@
1
+ # CGI/ERB sample for Ruby-GetText-Package.
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
+ # Yingfeng <blogyingfeng at gmail.com>, 2006.
8
+ #
9
+ msgid ""
10
+ msgstr ""
11
+ "Project-Id-Version: cgi-sample 1.1.1\n"
12
+ "POT-Creation-Date: 2006-03-04 22:50+0900\n"
13
+ "PO-Revision-Date: 2006-04-15 13:11+0300\n"
14
+ "Last-Translator: Yingfeng <blogyingfeng at gmail.com>\n"
15
+ "Language-Team: Simplified Chinese\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=1; plural=0;\n"
20
+ "X-Generator: KBabel 1.9.1\n"
21
+
22
+ #: hellolib.rb:19
23
+ msgid "This message is from hellolib."
24
+ msgstr "本条信息来自hellolib。"
@@ -0,0 +1,80 @@
1
+ # CGI/ERB sample for Ruby-GetText-Package.
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
+ # Yingfeng <blogyingfeng at gmail.com>, 2006.
8
+ #
9
+ msgid ""
10
+ msgstr ""
11
+ "Project-Id-Version: cgi-sample 1.1.1\n"
12
+ "POT-Creation-Date: 2006-03-04 22:50+0900\n"
13
+ "PO-Revision-Date: 2006-04-15 13:11+0300\n"
14
+ "Last-Translator: Yingfeng <blogyingfeng at gmail.com>\n"
15
+ "Language-Team: Simplified Chinese\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=1; plural=0;\n"
20
+ "X-Generator: KBabel 1.9.1\n"
21
+
22
+ #: index.cgi:36
23
+ msgid "an ERB/CGI sample (UTF-8)."
24
+ msgstr "一个ERB/CGI例子(UTF-8)。"
25
+
26
+ #: index.cgi:37
27
+ msgid ""
28
+ "an ERB/CGI sample (UTF-8). This sample uses the same container as sample 1 "
29
+ "but has a different rhtml file."
30
+ msgstr "一个ERB/CGI示例(UTF-8)。本示例采用跟示例1相同的容器,但却拥有一个不同的rhtml文件。"
31
+
32
+ #: index.cgi:38
33
+ msgid "an ERB/CGI sample (Auto-Detect charset)."
34
+ msgstr "一个ERB/CGI示例(自动检测字符集)。"
35
+
36
+ #: index.cgi:50 cookie.cgi:44
37
+ msgid "Sample script for CGI/ERB and Ruby-GetText-Package"
38
+ msgstr "用于CGI/ERB和Ruby-GetText-Package的示例脚本"
39
+
40
+ #: index.cgi:55
41
+ msgid "Ruby-GetText CGI sample scripts"
42
+ msgstr "Ruby-GetText CGI示例脚本"
43
+
44
+ #: index.cgi:57
45
+ msgid "Supported Locales:"
46
+ msgstr "目前支持的国家:"
47
+
48
+ #: index.cgi:58
49
+ msgid "Auto-Detect a locale from the WWW browser"
50
+ msgstr "从WWW浏览器自动检测国家"
51
+
52
+ #: index.cgi:66
53
+ msgid "Set locale as a \"lang\" parameter"
54
+ msgstr "用\"lang\"参数设置国家"
55
+
56
+ #: index.cgi:82
57
+ msgid "Set \"lang\" to cookie."
58
+ msgstr "为cookie设置\"lang\""
59
+
60
+ #: index.cgi:83
61
+ msgid ""
62
+ "Click one of the link below, and then click \"Auto-Detect a locale from the "
63
+ "WWW browser\" samples."
64
+ msgstr "点击下面的链接,然后点击\"从WWW浏览器自动检测国家\"例程"
65
+
66
+ #: index.cgi:92
67
+ msgid "Source codes"
68
+ msgstr "源代码"
69
+
70
+ #: index.cgi:103
71
+ msgid "index.cgi is also a Ruby-GetText sample script using CGI(not ERB)."
72
+ msgstr "index.cgi也是Ruby-GetText用于CGI(不是ERB)的示例脚本。"
73
+
74
+ #: cookie.cgi:50
75
+ msgid "Set [%s] as the cookie of your WWW Browser."
76
+ msgstr "将[%s]设置为您的WWW浏览器的cookie。"
77
+
78
+ #: cookie.cgi:54
79
+ msgid "Back"
80
+ msgstr "返回"
@@ -1,12 +1,35 @@
1
1
  #!/usr/bin/ruby
2
- # hello.rb - sample for GetText._()
2
+ # hello.rb - sample for _() and class.
3
3
  #
4
- # Copyright (C) 2001-2004 Masao Mutoh
4
+ # Copyright (C) 2001-2006 Masao Mutoh
5
5
  # This file is distributed under the same license as Ruby-GetText-Package.
6
6
 
7
7
  require 'gettext'
8
8
 
9
- include GetText
9
+ class HelloWorld
10
+ include GetText
10
11
 
11
- bindtextdomain("hello", "locale")
12
- print _("Hello World\n")
12
+ bindtextdomain("hello", "locale")
13
+
14
+ def hello
15
+ print _("Hello World\n")
16
+ end
17
+ end
18
+
19
+ if __FILE__ == $0
20
+ a = HelloWorld.new
21
+
22
+ a.hello # Show in your locale
23
+
24
+ old = GetText.locale
25
+ p old.to_s # Show current locale
26
+
27
+ # Change the locale to "en".
28
+ GetText.set_locale_all("en")
29
+ p GetText.locale.to_s
30
+ a.hello # Show in English
31
+
32
+ # Retrive original locale
33
+ GetText.set_locale_all(old)
34
+ a.hello # Show in your locale
35
+ end
@@ -1,15 +1,22 @@
1
1
  #!/usr/bin/ruby
2
- # hello2.po - sample for GetText._()
2
+ # hello2.po - sample for _() and module
3
3
  #
4
4
  # Copyright (C) 2002-2004 Masao Mutoh
5
5
  # This file is distributed under the same license as Ruby-GetText-Package.
6
6
 
7
7
  require 'gettext'
8
8
 
9
- include GetText
9
+ module Hello
10
+ include GetText
10
11
 
11
- bindtextdomain("hello2", "locale")
12
+ bindtextdomain("hello2", "locale")
12
13
 
13
- num = 1
14
- printf(_("One is %d\n"), num)
15
- printf(_("Hello %s\n"), _("World"))
14
+ module_function
15
+ def hello
16
+ num = 1
17
+ puts _("One is %{num}\n") % {:num => num}
18
+ puts _("Hello %{world}\n") % {:world => _("World")}
19
+ end
20
+ end
21
+
22
+ Hello.hello
@@ -1,18 +1,30 @@
1
1
  #!/usr/bin/ruby
2
- # hello_noop.rb - sample for GetText.N_().
2
+ # hello_noop.rb - sample for N_() and class.
3
3
  #
4
- # Copyright (C) 2002-2004 Masao Mutoh
4
+ # Copyright (C) 2002-2006 Masao Mutoh
5
5
  # This file is distributed under the same license as Ruby-GetText-Package.
6
6
 
7
7
  require 'gettext'
8
8
 
9
- include GetText
9
+ class HelloNoop
10
+ include GetText
10
11
 
11
- bindtextdomain("hello_noop", "locale")
12
+ MSGS = [N_("Hello World"), N_("Hello World2")]
12
13
 
13
- msgs = [N_("Hello World"), N_("Hello World2")]
14
+ def initialize
15
+ # You can call bindtextdomain as instance methods.
16
+ # In this case, it initializes(decided the locale lazily)
17
+ # in a instance.
18
+ bindtextdomain("hello_noop", "locale")
19
+ end
14
20
 
15
- p msgs
16
- msgs.each do |msg|
17
- print _(msg), "\n"
21
+ def hello
22
+ MSGS.each do |msg|
23
+ print _(msg), "\n"
24
+ end
25
+ end
18
26
  end
27
+
28
+ hello = HelloNoop.new
29
+
30
+ hello.hello