gettext 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +10 -6
- data/Rakefile +15 -66
- data/data/locale/bg/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/bs/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ca/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/cs/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/de/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/el/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/eo/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/es/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/et/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/fr/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/hr/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/hu/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/it/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ja/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ko/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/lv/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/nb/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/nl/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/pt_BR/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ru/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/sr/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/sv/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/uk/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/vi/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/zh/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/zh_TW/LC_MESSAGES/rgettext.mo +0 -0
- data/doc/text/news.md +30 -0
- data/gettext.gemspec +26 -34
- data/lib/gettext.rb +26 -24
- data/lib/gettext/cgi.rb +2 -0
- data/lib/gettext/core_ext/iconv.rb +7 -7
- data/lib/gettext/core_ext/string.rb +8 -6
- data/lib/gettext/parser/erb.rb +2 -0
- data/lib/gettext/parser/glade.rb +2 -0
- data/lib/gettext/parser/ruby.rb +12 -12
- data/lib/gettext/runtime/class_info.rb +5 -3
- data/lib/gettext/runtime/locale_path.rb +20 -22
- data/lib/gettext/runtime/mofile.rb +45 -18
- data/lib/gettext/runtime/textdomain.rb +6 -4
- data/lib/gettext/runtime/textdomain_group.rb +3 -1
- data/lib/gettext/runtime/textdomain_manager.rb +29 -26
- data/lib/gettext/tools.rb +15 -13
- data/lib/gettext/tools/parser/erb.rb +5 -3
- data/lib/gettext/tools/parser/glade.rb +16 -14
- data/lib/gettext/tools/parser/ruby.rb +16 -16
- data/lib/gettext/tools/pomessage.rb +9 -7
- data/lib/gettext/tools/poparser.rb +38 -36
- data/lib/gettext/tools/rgettext.rb +38 -13
- data/lib/gettext/tools/rmsgfmt.rb +7 -5
- data/lib/gettext/tools/rmsgmerge.rb +116 -114
- data/lib/gettext/utils.rb +2 -0
- data/lib/gettext/version.rb +3 -3
- data/po/bg/rgettext.po +17 -12
- data/po/bs/rgettext.po +16 -12
- data/po/ca/rgettext.po +17 -12
- data/po/cs/rgettext.po +16 -12
- data/po/de/rgettext.po +17 -12
- data/po/el/rgettext.po +17 -12
- data/po/eo/rgettext.po +17 -12
- data/po/es/rgettext.po +17 -12
- data/po/et/rgettext.po +17 -12
- data/po/fr/rgettext.po +17 -12
- data/po/hr/rgettext.po +19 -15
- data/po/hu/rgettext.po +17 -12
- data/po/it/rgettext.po +16 -12
- data/po/ja/rgettext.po +21 -15
- data/po/ko/rgettext.po +16 -12
- data/po/lv/rgettext.po +17 -12
- data/po/nb/rgettext.po +17 -12
- data/po/nl/rgettext.po +16 -12
- data/po/pt_BR/rgettext.po +17 -12
- data/po/rgettext.pot +16 -12
- data/po/ru/rgettext.po +17 -12
- data/po/sr/rgettext.po +17 -12
- data/po/sv/rgettext.po +16 -12
- data/po/{ua → uk}/rgettext.po +17 -12
- data/po/vi/rgettext.po +17 -12
- data/po/zh/rgettext.po +17 -12
- data/po/zh_TW/rgettext.po +17 -12
- data/samples/cgi/hellolib.rb +1 -1
- data/samples/cgi/http.rb +5 -5
- data/samples/cgi/locale/{ua → uk}/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/{ua → uk}/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/{ua → uk}/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/{ua → uk}/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/po/{ua → uk}/helloerb1.po +0 -0
- data/samples/cgi/po/{ua → uk}/helloerb2.po +0 -0
- data/samples/cgi/po/{ua → uk}/hellolib.po +0 -0
- data/samples/cgi/po/{ua → uk}/main.po +0 -0
- data/samples/hello.rb +1 -1
- data/samples/hello_gtk2.rb +1 -1
- data/samples/hello_noop.rb +1 -1
- data/samples/locale/{ua → uk}/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/{ua → uk}/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/{ua → uk}/LC_MESSAGES/hello_glade2.mo +0 -0
- data/samples/locale/{ua → uk}/LC_MESSAGES/hello_gtk.mo +0 -0
- data/samples/locale/{ua → uk}/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/{ua → uk}/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/{ua → uk}/LC_MESSAGES/hello_tk.mo +0 -0
- data/samples/makemo.rb +2 -0
- data/samples/po/test.rb +2 -0
- data/samples/po/{ua → uk}/hello.po +0 -0
- data/samples/po/{ua → uk}/hello2.po +0 -0
- data/samples/po/{ua → uk}/hello_glade2.po +0 -0
- data/samples/po/{ua → uk}/hello_gtk.po +0 -0
- data/samples/po/{ua → uk}/hello_noop.po +0 -0
- data/samples/po/{ua → uk}/hello_plural.po +0 -0
- data/samples/po/{ua → uk}/hello_tk.po +0 -0
- data/test/Rakefile +1 -1
- data/test/test_class_info.rb +5 -0
- data/test/test_gettext.rb +12 -1
- data/test/test_locale_path.rb +29 -3
- data/test/test_parser.rb +61 -59
- data/test/test_po_generation.rb +3 -1
- data/test/test_pomessage.rb +4 -2
- data/test/test_string.rb +2 -0
- data/test/test_textdomain_bind.rb +2 -0
- data/test/test_textdomain_multi.rb +2 -0
- data/test/test_textdomain_toplevel.rb +2 -0
- data/test/test_thread.rb +4 -2
- data/test/testlib/N_.rb +5 -3
- data/test/testlib/gettext.rb +4 -2
- data/test/testlib/helper.rb +2 -0
- data/test/testlib/multi_textdomain.rb +2 -0
- data/test/testlib/ngettext.rb +10 -8
- data/test/testlib/npgettext.rb +9 -7
- data/test/testlib/nsgettext.rb +4 -2
- data/test/testlib/pgettext.rb +4 -2
- data/test/testlib/sgettext.rb +4 -2
- data/test/testlib/simple.rb +2 -0
- data/test/tools/files/simple_translation.rb +3 -1
- data/test/tools/test_tools.rb +3 -1
- metadata +772 -737
- data/ChangeLog +0 -78
- data/ChangeLog-1 +0 -2016
- data/NEWS-1 +0 -414
- data/benchmark/1.93.0.txt +0 -8
- data/benchmark/2.0.0.txt +0 -8
- data/benchmark/2.0.4.txt +0 -11
- data/benchmark/2.1.0.txt +0 -11
- data/benchmark/benchmark.rb +0 -68
- data/benchmark/test.rb +0 -28
- data/data/locale/ua/LC_MESSAGES/rgettext.mo +0 -0
- data/replace.rb +0 -8
- data/samples/cgi/po/bg/#main.po# +0 -84
- data/test.rb +0 -33
data/benchmark/benchmark.rb
DELETED
@@ -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
data/samples/cgi/po/bg/#main.po#
DELETED
@@ -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
|
-
|