gettext 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. data/README.rdoc +10 -6
  2. data/Rakefile +15 -66
  3. data/data/locale/bg/LC_MESSAGES/rgettext.mo +0 -0
  4. data/data/locale/bs/LC_MESSAGES/rgettext.mo +0 -0
  5. data/data/locale/ca/LC_MESSAGES/rgettext.mo +0 -0
  6. data/data/locale/cs/LC_MESSAGES/rgettext.mo +0 -0
  7. data/data/locale/de/LC_MESSAGES/rgettext.mo +0 -0
  8. data/data/locale/el/LC_MESSAGES/rgettext.mo +0 -0
  9. data/data/locale/eo/LC_MESSAGES/rgettext.mo +0 -0
  10. data/data/locale/es/LC_MESSAGES/rgettext.mo +0 -0
  11. data/data/locale/et/LC_MESSAGES/rgettext.mo +0 -0
  12. data/data/locale/fr/LC_MESSAGES/rgettext.mo +0 -0
  13. data/data/locale/hr/LC_MESSAGES/rgettext.mo +0 -0
  14. data/data/locale/hu/LC_MESSAGES/rgettext.mo +0 -0
  15. data/data/locale/it/LC_MESSAGES/rgettext.mo +0 -0
  16. data/data/locale/ja/LC_MESSAGES/rgettext.mo +0 -0
  17. data/data/locale/ko/LC_MESSAGES/rgettext.mo +0 -0
  18. data/data/locale/lv/LC_MESSAGES/rgettext.mo +0 -0
  19. data/data/locale/nb/LC_MESSAGES/rgettext.mo +0 -0
  20. data/data/locale/nl/LC_MESSAGES/rgettext.mo +0 -0
  21. data/data/locale/pt_BR/LC_MESSAGES/rgettext.mo +0 -0
  22. data/data/locale/ru/LC_MESSAGES/rgettext.mo +0 -0
  23. data/data/locale/sr/LC_MESSAGES/rgettext.mo +0 -0
  24. data/data/locale/sv/LC_MESSAGES/rgettext.mo +0 -0
  25. data/data/locale/uk/LC_MESSAGES/rgettext.mo +0 -0
  26. data/data/locale/vi/LC_MESSAGES/rgettext.mo +0 -0
  27. data/data/locale/zh/LC_MESSAGES/rgettext.mo +0 -0
  28. data/data/locale/zh_TW/LC_MESSAGES/rgettext.mo +0 -0
  29. data/doc/text/news.md +30 -0
  30. data/gettext.gemspec +26 -34
  31. data/lib/gettext.rb +26 -24
  32. data/lib/gettext/cgi.rb +2 -0
  33. data/lib/gettext/core_ext/iconv.rb +7 -7
  34. data/lib/gettext/core_ext/string.rb +8 -6
  35. data/lib/gettext/parser/erb.rb +2 -0
  36. data/lib/gettext/parser/glade.rb +2 -0
  37. data/lib/gettext/parser/ruby.rb +12 -12
  38. data/lib/gettext/runtime/class_info.rb +5 -3
  39. data/lib/gettext/runtime/locale_path.rb +20 -22
  40. data/lib/gettext/runtime/mofile.rb +45 -18
  41. data/lib/gettext/runtime/textdomain.rb +6 -4
  42. data/lib/gettext/runtime/textdomain_group.rb +3 -1
  43. data/lib/gettext/runtime/textdomain_manager.rb +29 -26
  44. data/lib/gettext/tools.rb +15 -13
  45. data/lib/gettext/tools/parser/erb.rb +5 -3
  46. data/lib/gettext/tools/parser/glade.rb +16 -14
  47. data/lib/gettext/tools/parser/ruby.rb +16 -16
  48. data/lib/gettext/tools/pomessage.rb +9 -7
  49. data/lib/gettext/tools/poparser.rb +38 -36
  50. data/lib/gettext/tools/rgettext.rb +38 -13
  51. data/lib/gettext/tools/rmsgfmt.rb +7 -5
  52. data/lib/gettext/tools/rmsgmerge.rb +116 -114
  53. data/lib/gettext/utils.rb +2 -0
  54. data/lib/gettext/version.rb +3 -3
  55. data/po/bg/rgettext.po +17 -12
  56. data/po/bs/rgettext.po +16 -12
  57. data/po/ca/rgettext.po +17 -12
  58. data/po/cs/rgettext.po +16 -12
  59. data/po/de/rgettext.po +17 -12
  60. data/po/el/rgettext.po +17 -12
  61. data/po/eo/rgettext.po +17 -12
  62. data/po/es/rgettext.po +17 -12
  63. data/po/et/rgettext.po +17 -12
  64. data/po/fr/rgettext.po +17 -12
  65. data/po/hr/rgettext.po +19 -15
  66. data/po/hu/rgettext.po +17 -12
  67. data/po/it/rgettext.po +16 -12
  68. data/po/ja/rgettext.po +21 -15
  69. data/po/ko/rgettext.po +16 -12
  70. data/po/lv/rgettext.po +17 -12
  71. data/po/nb/rgettext.po +17 -12
  72. data/po/nl/rgettext.po +16 -12
  73. data/po/pt_BR/rgettext.po +17 -12
  74. data/po/rgettext.pot +16 -12
  75. data/po/ru/rgettext.po +17 -12
  76. data/po/sr/rgettext.po +17 -12
  77. data/po/sv/rgettext.po +16 -12
  78. data/po/{ua → uk}/rgettext.po +17 -12
  79. data/po/vi/rgettext.po +17 -12
  80. data/po/zh/rgettext.po +17 -12
  81. data/po/zh_TW/rgettext.po +17 -12
  82. data/samples/cgi/hellolib.rb +1 -1
  83. data/samples/cgi/http.rb +5 -5
  84. data/samples/cgi/locale/{ua → uk}/LC_MESSAGES/helloerb1.mo +0 -0
  85. data/samples/cgi/locale/{ua → uk}/LC_MESSAGES/helloerb2.mo +0 -0
  86. data/samples/cgi/locale/{ua → uk}/LC_MESSAGES/hellolib.mo +0 -0
  87. data/samples/cgi/locale/{ua → uk}/LC_MESSAGES/main.mo +0 -0
  88. data/samples/cgi/po/{ua → uk}/helloerb1.po +0 -0
  89. data/samples/cgi/po/{ua → uk}/helloerb2.po +0 -0
  90. data/samples/cgi/po/{ua → uk}/hellolib.po +0 -0
  91. data/samples/cgi/po/{ua → uk}/main.po +0 -0
  92. data/samples/hello.rb +1 -1
  93. data/samples/hello_gtk2.rb +1 -1
  94. data/samples/hello_noop.rb +1 -1
  95. data/samples/locale/{ua → uk}/LC_MESSAGES/hello.mo +0 -0
  96. data/samples/locale/{ua → uk}/LC_MESSAGES/hello2.mo +0 -0
  97. data/samples/locale/{ua → uk}/LC_MESSAGES/hello_glade2.mo +0 -0
  98. data/samples/locale/{ua → uk}/LC_MESSAGES/hello_gtk.mo +0 -0
  99. data/samples/locale/{ua → uk}/LC_MESSAGES/hello_noop.mo +0 -0
  100. data/samples/locale/{ua → uk}/LC_MESSAGES/hello_plural.mo +0 -0
  101. data/samples/locale/{ua → uk}/LC_MESSAGES/hello_tk.mo +0 -0
  102. data/samples/makemo.rb +2 -0
  103. data/samples/po/test.rb +2 -0
  104. data/samples/po/{ua → uk}/hello.po +0 -0
  105. data/samples/po/{ua → uk}/hello2.po +0 -0
  106. data/samples/po/{ua → uk}/hello_glade2.po +0 -0
  107. data/samples/po/{ua → uk}/hello_gtk.po +0 -0
  108. data/samples/po/{ua → uk}/hello_noop.po +0 -0
  109. data/samples/po/{ua → uk}/hello_plural.po +0 -0
  110. data/samples/po/{ua → uk}/hello_tk.po +0 -0
  111. data/test/Rakefile +1 -1
  112. data/test/test_class_info.rb +5 -0
  113. data/test/test_gettext.rb +12 -1
  114. data/test/test_locale_path.rb +29 -3
  115. data/test/test_parser.rb +61 -59
  116. data/test/test_po_generation.rb +3 -1
  117. data/test/test_pomessage.rb +4 -2
  118. data/test/test_string.rb +2 -0
  119. data/test/test_textdomain_bind.rb +2 -0
  120. data/test/test_textdomain_multi.rb +2 -0
  121. data/test/test_textdomain_toplevel.rb +2 -0
  122. data/test/test_thread.rb +4 -2
  123. data/test/testlib/N_.rb +5 -3
  124. data/test/testlib/gettext.rb +4 -2
  125. data/test/testlib/helper.rb +2 -0
  126. data/test/testlib/multi_textdomain.rb +2 -0
  127. data/test/testlib/ngettext.rb +10 -8
  128. data/test/testlib/npgettext.rb +9 -7
  129. data/test/testlib/nsgettext.rb +4 -2
  130. data/test/testlib/pgettext.rb +4 -2
  131. data/test/testlib/sgettext.rb +4 -2
  132. data/test/testlib/simple.rb +2 -0
  133. data/test/tools/files/simple_translation.rb +3 -1
  134. data/test/tools/test_tools.rb +3 -1
  135. metadata +772 -737
  136. data/ChangeLog +0 -78
  137. data/ChangeLog-1 +0 -2016
  138. data/NEWS-1 +0 -414
  139. data/benchmark/1.93.0.txt +0 -8
  140. data/benchmark/2.0.0.txt +0 -8
  141. data/benchmark/2.0.4.txt +0 -11
  142. data/benchmark/2.1.0.txt +0 -11
  143. data/benchmark/benchmark.rb +0 -68
  144. data/benchmark/test.rb +0 -28
  145. data/data/locale/ua/LC_MESSAGES/rgettext.mo +0 -0
  146. data/replace.rb +0 -8
  147. data/samples/cgi/po/bg/#main.po# +0 -84
  148. data/test.rb +0 -33
@@ -1,68 +0,0 @@
1
- $:.unshift "../../locale/lib"
2
- $:.unshift "../../gettext/lib"
3
-
4
- #require 'rubygems'
5
- require 'benchmark'
6
- require 'gettext'
7
-
8
- num = 100000
9
-
10
- def memory
11
- pid = Process.pid
12
- map = `pmap -d #{pid}`
13
- map.split("\n").last.strip.squeeze(' ').split(' ')[3].to_i
14
- end
15
-
16
- curr_mem = memory
17
-
18
- class Test
19
- include GetText
20
- bindtextdomain("test1", :path => "../test/locale")
21
- def test
22
- _("language")
23
- end
24
- end
25
-
26
- p GetText::VERSION
27
- Benchmark.bm(25){|x|
28
- x.report("bindtextdomain"){ num.times{|i|
29
- GetText.bindtextdomain("test1", :path => "../test/locale")
30
- #GetText.bindtextdomain("test1", "../test/locale")
31
- } }
32
- x.report("set_locale"){ num.times{|i|
33
- GetText.locale = "ja"
34
- } }
35
- GetText.locale = "ja"
36
- x.report("gettext ja"){ num.times{|i|
37
- GetText._("language")
38
- } }
39
- GetText.locale = "en"
40
- x.report("gettext en (not found)"){ num.times{|i|
41
- GetText._("language")
42
- } }
43
-
44
- GetText.bindtextdomain("plural", :path => "../test/locale")
45
- #GetText.bindtextdomain("plural", "../test/locale")
46
- GetText.locale = "ja"
47
- x.report("ngettext ja"){ (num / 2).times{|i|
48
- GetText.n_("single", "plural", 1)
49
- GetText.n_("single", "plural", 2)
50
- } }
51
- GetText.locale = "en"
52
- x.report("ngettext en (not found)"){ (num / 2).times{|i|
53
- GetText.n_("single", "plural", 1)
54
- GetText.n_("single", "plural", 2)
55
- } }
56
-
57
- GetText.locale = "ja"
58
- x.report("create object ja"){ num.times{|i|
59
- Test.new.test
60
- } }
61
- GetText.locale = "en"
62
- x.report("create object en"){ num.times{|i|
63
- Test.new.test
64
- } }
65
- }
66
-
67
- GC.start
68
- puts "#{memory - curr_mem}K "
data/benchmark/test.rb DELETED
@@ -1,28 +0,0 @@
1
- require 'benchmark'
2
-
3
- def test(s)
4
- ret = ""
5
- if s =~ /^\#<|^$/ or s == "GetText"
6
- #if s.size == 0 or s[0..1] = "#<" or s == "GetText"
7
- ret = Object
8
- end
9
- ret
10
- end
11
-
12
- num = 100000
13
-
14
- Benchmark.bm(25){|x|
15
- x.report("test matched"){ num.times{|i|
16
- test("#<foo>")
17
- } }
18
- x.report("test matched nodata"){ num.times{|i|
19
- test("")
20
- } }
21
- x.report("test matched GetText"){ num.times{|i|
22
- test("GetText")
23
- } }
24
- x.report("test not matched"){ num.times{|i|
25
- test("FooBar")
26
- } }
27
-
28
- }
Binary file
data/replace.rb DELETED
@@ -1,8 +0,0 @@
1
- ARGV.each do |path|
2
- data = IO.read(path)
3
- data.gsub!(/license terms as Ruby\./, "license terms as Ruby or LGPL.")
4
- open(path, "w") do |out|
5
- out.write data
6
- end
7
- end
8
-
@@ -1,84 +0,0 @@
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
- # Georgi Stoimenov <georgistoimenov@abv.bg>, 2008
8
- #
9
- msgid ""
10
- msgstr ""
11
- "Project-Id-Version: cgi-sample 1.1.1\n"
12
- "POT-Creation-Date: 2006-01-07 14:55+0900\n"
13
- "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
- "Last-Translator: Sava Chankov <sava.chankov@gmail.com>\n"
15
- "Language-Team: Bulgarian <ruby-on-rails-bulgaria@googlegroups.com>\n"
16
- "MIME-Version: 1.0\n"
17
- "Content-Type: text/plain; charset=UTF-8\n"
18
- "Content-Transfer-Encoding: 8bit\n"
19
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20
-
21
- #: index.cgi:36
22
- msgid "an ERB/CGI sample (UTF-8)."
23
- msgstr "ERB/CGI ���ߜ������؜��ܜ��՜��� (UTF-8)."
24
-
25
- #: index.cgi:37
26
- msgid ""
27
- "an ERB/CGI sample (UTF-8). This sample uses the same container as sample 1 "
28
- "but has a different rhtml file."
29
- msgstr ""
30
- "ERB/CGI ���ߜ������؜��ܜ��՜��� (UTF-8). ���œ��ޜ��ל��� ���ߜ������؜��ܜ��՜��� ���ߜ��ޜ��ۜ��ל��Ҝ��� ������������؜��� ���ڜ��ޜ��ݜ���������ޜ��ۜ��՜��� ���ڜ��М������ ���ߜ������؜��ܜ��՜��� 1 "
31
- "���ݜ��� ���� �������М��ל��ۜ��؜�����՜��� rhtml ������М��ٜ���."
32
-
33
- #: index.cgi:38
34
- #, fuzzy
35
- msgid "an ERB/CGI sample (Auto-Detect charset)."
36
- msgstr "ERB/CGI ���ߜ������؜��ܜ��՜��� (���М��Ҝ�����ޜ��ܜ��М�����؜�����ݜ��� �������М��ל��ߜ��ޜ��ל��ݜ��М��Ҝ��М��ݜ��� ���ݜ��� ���ڜ��ޜ��Ԝ��؜������М��ݜ��՜������).""
37
-
38
- #: index.cgi:50 cookie.cgi:44
39
- msgid "Sample script for CGI/ERB and Ruby-GetText-Package"
40
- msgstr "�����������؜��ܜ��՜������՜��� ������ڜ������؜��ߜ���, ���ߜ��ޜ��ۜ��ל��Ҝ��М��� CGI/ERB ���� Ruby-GetText-Package"
41
-
42
- #: index.cgi:55
43
- msgid "Ruby-GetText CGI sample scripts"
44
- msgstr "Ruby-GetText CGI ���ߜ������؜��ܜ��՜������ݜ��� ������ڜ������؜��ߜ�����ޜ��Ҝ���"
45
-
46
- #: index.cgi:57
47
- msgid "Supported Locales:"
48
- msgstr "�������ޜ��Ԝ��Ԝ���������֜��М��ݜ��� ���ۜ��ޜ��ڜ��М��ۜ���:"
49
-
50
- #: index.cgi:58
51
- msgid "Auto-Detect a locale from the WWW browser"
52
- msgstr "�������М��Ҝ�����ޜ��ܜ��М�����؜�����ݜ��� �������М��ל��ߜ��ޜ��ל��ݜ��М��Ҝ��М��ݜ��� ���ݜ��� ���ۜ��ޜ��ڜ��М���, ���ל��М��Ԝ��М��Ԝ��՜��� ���ޜ��� ���ќ������М�����ל����������"
53
-
54
- #: index.cgi:66
55
- msgid "Set locale as a \"lang\" parameter"
56
- msgstr "�������ל��ќ��՜������՜������ ���ۜ��ޜ��ڜ��М��� ���� ���ߜ��М������М��ܜ��՜������������� \"lang\""
57
-
58
- #: index.cgi:82
59
- msgid "Set \"lang\" to cookie."
60
- msgstr "\"lang\" ���ڜ��М������ ���ќ��؜�����ڜ��Ҝ��؜�����ڜ��� (cookie)."
61
-
62
- #: index.cgi:83
63
- msgid ""
64
- "Click one of the link below, and then click \"Auto-Detect a locale from the "
65
- "WWW browser\" samples."
66
- msgstr ""
67
- "���ɜ������М��ڜ��ݜ��՜������ ���Ҝ������������� ���՜��Ԝ��ݜ��� ���ޜ��� ���Ҝ���������ל��ڜ��؜������ ���ߜ���-���ݜ��М��Ԝ��ޜ��ۜ��� ���� ���ߜ��ޜ�����ۜ��� ���ݜ��� ���ߜ������؜��ܜ��՜������؜������ ���� "
68
- "\"�������Ҝ�����ޜ��ܜ��М�����؜�����ݜ��� �������М��ל��ߜ��ޜ��ל��ݜ��М��Ҝ��М��ݜ��� ���ݜ��� ���ۜ��ޜ��ڜ��М���, ���ל��М��Ԝ��М��Ԝ��՜��� ���ޜ��� ���ќ������М�����ל����������\"."
69
-
70
- #: index.cgi:92
71
- msgid "Source codes"
72
- msgstr "�������ל�����ޜ��Ԝ��՜��� ���ڜ��ޜ���"
73
-
74
- #: index.cgi:103
75
- msgid "index.cgi is also a Ruby-GetText sample script using CGI(not ERB)."
76
- msgstr "index.cgi ���� ������������� ������М��ڜ��� ���ߜ������؜��ܜ��՜������՜��� ������ڜ������؜��ߜ���, ���ߜ��ޜ��ۜ��ל��Ҝ��М��� Ruby-GetText ���� CGI (���ќ��՜��� ERB)."
77
-
78
- #: cookie.cgi:50
79
- msgid "Set [%s] as the cookie of your WWW Browser."
80
- msgstr "[%s] ���ڜ��М������ ���ќ��؜�����ڜ��Ҝ��؜�����ڜ��� (cookie) ���Ҝ������ ���Ҝ��М�����؜��� ���ќ������М�����ל������."
81
-
82
- #: cookie.cgi:54
83
- msgid "Back"
84
- msgstr "�������М��ל��М���"
data/test.rb DELETED
@@ -1,33 +0,0 @@
1
- #!/usr/bin/ruby
2
- ## hello_gtk2.rb - sample for Ruby/GTK2
3
- ##
4
- ## Copyright (C) 2001-2006 Masao Mutoh
5
- ## This file is distributed under the same license as Ruby-GetText-Package.
6
-
7
- require 'rubygems'
8
- require 'gettext'
9
- require 'gtk2'
10
-
11
- class LocalizedWindow < Gtk::Window
12
- include GetText
13
-
14
- bindtextdomain("hello_gtk", :path => "locale", :output_charset => "utf-8")
15
-
16
- def initialize
17
- super
18
- signal_connect('delete-event') do
19
- Gtk.main_quit
20
- end
21
-
22
- add(Gtk::Label.new( "sdaf" )
23
- np_("Special", "An apple", "%{num} Apples", num)
24
- p_("File", "New")
25
- s_("File|New")
26
- n_("Special|An apple", "%{num} Apples", num)
27
- end
28
- end
29
-
30
- LocalizedWindow.new.show_all
31
- Gtk.main
32
-
33
-