gettext 1.5.0-mswin32 → 1.6.0-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +113 -0
- data/NEWS +17 -1
- data/README +56 -46
- data/Rakefile +7 -3
- data/data/locale/cs/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/cs/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/de/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/de/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/el/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/el/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/es/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/es/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/fr/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/fr/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/it/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/it/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ja/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/ja/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ko/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/ko/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/nl/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/nl/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/pt_BR/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/pt_BR/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ru/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/ru/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/sv/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/zh/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/zh/LC_MESSAGES/rgettext.mo +0 -0
- data/ext/gettext/locale_system.c +3 -3
- data/lib/gettext.rb +149 -98
- data/lib/gettext/container.rb +3 -23
- data/lib/gettext/erb.rb +2 -2
- data/lib/gettext/locale_posix.rb +37 -5
- data/lib/gettext/locale_win32.rb +2 -1
- data/lib/gettext/mo.rb +6 -4
- data/lib/gettext/parser/activerecord.rb +7 -3
- data/lib/gettext/poparser.rb +298 -298
- data/lib/gettext/rails.rb +131 -112
- data/lib/gettext/rgettext.rb +3 -1
- data/lib/gettext/rmsgfmt.rb +3 -1
- data/lib/gettext/rmsgmerge.rb +3 -1
- data/lib/gettext/textdomain.rb +14 -8
- data/lib/gettext/textdomainmanager.rb +103 -0
- data/lib/gettext/version.rb +1 -1
- data/po/cs/rails.po +16 -16
- data/po/cs/rgettext.po +7 -3
- data/po/de/rails.po +16 -16
- data/po/de/rgettext.po +7 -3
- data/po/el/rails.po +16 -16
- data/po/el/rgettext.po +7 -3
- data/po/es/rails.po +16 -16
- data/po/es/rgettext.po +7 -3
- data/po/fr/rails.po +16 -16
- data/po/fr/rgettext.po +7 -3
- data/po/it/rails.po +79 -0
- data/po/it/rgettext.po +42 -32
- data/po/ja/rails.po +20 -18
- data/po/ja/rgettext.po +7 -3
- data/po/ko/rails.po +16 -16
- data/po/ko/rgettext.po +7 -3
- data/po/nl/rails.po +16 -16
- data/po/nl/rgettext.po +7 -3
- data/po/pt_BR/rails.po +16 -16
- data/po/pt_BR/rgettext.po +7 -3
- data/po/rails.pot +16 -16
- data/po/rgettext.pot +7 -3
- data/po/ru/rails.po +18 -18
- data/po/ru/rgettext.po +13 -9
- data/po/sv/rgettext.po +7 -3
- data/po/zh/rails.po +78 -0
- data/po/zh/rgettext.po +104 -0
- data/pre-setup.rb +1 -4
- data/samples/cgi/helloerb.rhtml +1 -0
- data/samples/cgi/locale/zh/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/zh/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/zh/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/zh/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/po/zh/helloerb1.po +60 -0
- data/samples/cgi/po/zh/helloerb2.po +52 -0
- data/samples/cgi/po/zh/hellolib.po +24 -0
- data/samples/cgi/po/zh/main.po +80 -0
- data/samples/hello.rb +28 -5
- data/samples/hello2.rb +13 -6
- data/samples/hello_noop.rb +20 -8
- data/samples/hello_plural.rb +16 -6
- data/samples/hello_textdomain.rb +13 -4
- data/samples/hellogtk.rb +5 -4
- data/samples/hellogtk2.rb +5 -6
- data/samples/locale/cs/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/cs/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/de/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/de/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/el/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/el/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/es/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/es/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/fr/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/fr/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/it/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/it/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/ja/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/ja/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/ko/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/ko/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/nl/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/nl/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/pt_BR/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/pt_BR/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/ru/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/ru/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/sv/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/sv/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/zh/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/zh/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/zh/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/zh/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/zh/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/zh/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/zh/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/po/cs/hello2.po +4 -4
- data/samples/po/cs/hello_plural.po +5 -5
- data/samples/po/de/hello2.po +4 -4
- data/samples/po/de/hello_plural.po +9 -6
- data/samples/po/el/hello2.po +4 -4
- data/samples/po/el/hello_plural.po +3 -3
- data/samples/po/es/hello2.po +4 -4
- data/samples/po/es/hello_plural.po +6 -6
- data/samples/po/fr/hello2.po +4 -4
- data/samples/po/fr/hello_plural.po +3 -3
- data/samples/po/hello2.pot +2 -2
- data/samples/po/hello_plural.pot +1 -1
- data/samples/po/it/hello2.po +4 -4
- data/samples/po/it/hello_plural.po +4 -5
- data/samples/po/ja/hello2.po +4 -4
- data/samples/po/ja/hello_plural.po +4 -5
- data/samples/po/ko/hello2.po +4 -4
- data/samples/po/ko/hello_plural.po +10 -7
- data/samples/po/nl/hello2.po +4 -4
- data/samples/po/nl/hello_plural.po +6 -7
- data/samples/po/pt_BR/hello2.po +4 -4
- data/samples/po/pt_BR/hello_plural.po +6 -6
- data/samples/po/ru/hello2.po +4 -4
- data/samples/po/ru/hello_plural.po +10 -7
- data/samples/po/sv/hello2.po +4 -4
- data/samples/po/sv/hello_plural.po +4 -4
- data/samples/po/zh/hello.po +23 -0
- data/samples/po/zh/hello2.po +31 -0
- data/samples/po/zh/hello_noop.po +27 -0
- data/samples/po/zh/hello_plural.po +25 -0
- data/samples/po/zh/helloglade2.po +31 -0
- data/samples/po/zh/hellogtk.po +23 -0
- data/samples/po/zh/hellotk.po +23 -0
- data/samples/rails/README +2 -2
- data/samples/rails/lib/tasks/gettext.rake +0 -3
- data/samples/rails/locale/cs/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/de/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/el/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/en/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/es/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/fr/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/it/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/ja/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/ko/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/nl/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/pt_BR/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/ru/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/zh/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/po/blog.pot +1 -1
- data/samples/rails/po/cs/blog.po +1 -1
- data/samples/rails/po/de/blog.po +1 -1
- data/samples/rails/po/el/blog.po +1 -1
- data/samples/rails/po/en/blog.po +3 -3
- data/samples/rails/po/es/blog.po +1 -1
- data/samples/rails/po/fr/blog.po +1 -1
- data/samples/rails/po/it/blog.po +109 -0
- data/samples/rails/po/ja/blog.po +1 -14
- data/samples/rails/po/ko/blog.po +2 -2
- data/samples/rails/po/nl/blog.po +1 -1
- data/samples/rails/po/pt_BR/blog.po +1 -1
- data/samples/rails/po/ru/blog.po +1 -2
- data/samples/rails/po/zh/blog.po +109 -0
- data/samples/rails/vendor/plugins/gettext/README +17 -0
- data/samples/rails/vendor/plugins/gettext/Rakefile +17 -0
- data/samples/rails/vendor/plugins/gettext/lib/gettext_plugin.rb +16 -35
- data/samples/rails/{locale → vendor/plugins/gettext/locale}/cs/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/{locale → vendor/plugins/gettext/locale}/de/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/{locale → vendor/plugins/gettext/locale}/el/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/{locale → vendor/plugins/gettext/locale}/es/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/{locale → vendor/plugins/gettext/locale}/fr/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/vendor/plugins/gettext/locale/it/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/{locale → vendor/plugins/gettext/locale}/ja/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/{locale → vendor/plugins/gettext/locale}/ko/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/{locale → vendor/plugins/gettext/locale}/nl/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/{locale → vendor/plugins/gettext/locale}/pt_BR/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/{locale → vendor/plugins/gettext/locale}/ru/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/vendor/plugins/gettext/locale/zh/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/{po → vendor/plugins/gettext/po}/cs/gettext_plugin.po +4 -4
- data/samples/rails/{po → vendor/plugins/gettext/po}/de/gettext_plugin.po +4 -4
- data/samples/rails/{po → vendor/plugins/gettext/po}/el/gettext_plugin.po +4 -4
- data/samples/rails/{po → vendor/plugins/gettext/po}/es/gettext_plugin.po +4 -4
- data/samples/rails/{po → vendor/plugins/gettext/po}/fr/gettext_plugin.po +4 -4
- data/samples/rails/{po → vendor/plugins/gettext/po}/gettext_plugin.pot +4 -4
- data/samples/rails/vendor/plugins/gettext/po/it/gettext_plugin.po +27 -0
- data/samples/rails/{po → vendor/plugins/gettext/po}/ja/gettext_plugin.po +4 -4
- data/samples/rails/{po → vendor/plugins/gettext/po}/ko/gettext_plugin.po +4 -4
- data/samples/rails/{po → vendor/plugins/gettext/po}/nl/gettext_plugin.po +4 -4
- data/samples/rails/{po → vendor/plugins/gettext/po}/pt_BR/gettext_plugin.po +4 -4
- data/samples/rails/{po → vendor/plugins/gettext/po}/ru/gettext_plugin.po +4 -5
- data/samples/rails/vendor/plugins/gettext/po/zh/gettext_plugin.po +27 -0
- data/test/gettext_test.rb +18 -14
- data/test/gettext_test_multi_textdomain.rb +49 -0
- data/test/locale/fr/LC_MESSAGES/test6.mo +0 -0
- data/test/locale/ja/LC_MESSAGES/test6.mo +0 -0
- data/test/po/fr/test6.po +23 -0
- data/test/po/ja/test6.po +23 -0
- data/test/test.sh +3 -1
- data/test/testlib1.rb +0 -5
- data/test/testlib5.rb +70 -0
- data/test/testlib6.rb +19 -0
- metadata +128 -33
- data/COPYING.ja +0 -51
- data/ext/gettext/Makefile +0 -178
- data/ext/gettext/locale_system-i386-mswin32.def +0 -2
- data/ext/gettext/locale_system.exp +0 -0
- data/ext/gettext/locale_system.lib +0 -0
- data/ext/gettext/locale_system.obj +0 -0
- data/ext/gettext/locale_system.pdb +0 -0
- data/ext/gettext/locale_system.so +0 -0
- data/ext/gettext/mkmf.log +0 -16
- data/ext/gettext/vc70.pdb +0 -0
data/ChangeLog
CHANGED
@@ -1,3 +1,116 @@
|
|
1
|
+
2006-06-09 Masao Mutoh <mutoh@highway.ne.jp>
|
2
|
+
|
3
|
+
* samples/*.rb, samples/po/*: Code cleanup 2.
|
4
|
+
|
5
|
+
2006-06-08 Masao Mutoh <mutoh@highway.ne.jp>
|
6
|
+
|
7
|
+
* lib/gettext/version.rb: Increment minor version.
|
8
|
+
* lib/gettext/locale_posix.rb: Code cleanup.
|
9
|
+
* test/testlib5.rb: Added.
|
10
|
+
|
11
|
+
2006-06-07 Masao Mutoh <mutoh@highway.ne.jp>
|
12
|
+
|
13
|
+
* lib/gettext.rb: GetText.set_locale accept 2nd parameter.
|
14
|
+
* test/testlib6.rb, test/po/{ja|fr}/test6.po: Added previous test.
|
15
|
+
* samples/*.rb, samples/po/*: Code cleanup.
|
16
|
+
|
17
|
+
2006-06-05 Masao Mutoh <mutoh@highway.ne.jp>
|
18
|
+
|
19
|
+
* samples/hello.rb: Code cleanup.
|
20
|
+
* lib/gettext/rgettext.rb: Show ruby version with -v option.
|
21
|
+
* lib/gettext/rmsgfmt.rb: ditto.
|
22
|
+
* lib/gettext/rmsgmerge.rb: ditto.
|
23
|
+
|
24
|
+
2006-06-04 Masao Mutoh <mutoh@highway.ne.jp>
|
25
|
+
|
26
|
+
* lib/gettext.rb: Fixed a bug when options is set nil.
|
27
|
+
* lib/gettext/locale_posix.rb: Fixed the search order of environment
|
28
|
+
variables. Reported by markus koller.
|
29
|
+
* ext/gettext/locale_system.c: Returns nil if locale is not set.
|
30
|
+
* Rakefile: Added makemo task for samples/rails/vendor/plugins/gettext/po.
|
31
|
+
* test/gettext_test_multi_textdomain.rb: Added.
|
32
|
+
|
33
|
+
2006-05-31 Masao Mutoh <mutoh@highway.ne.jp>
|
34
|
+
|
35
|
+
* samples/rails/vendor/plugins/gettext/lib/gettext_plugin.rb: Rewrite
|
36
|
+
to support new bindtextdomain.
|
37
|
+
* samples/rails/vendor/plugins/gettext/{po|locale}/*: Move gettext_plugin.{po|mo}
|
38
|
+
from samples/rails/{po|locale}/*. Now Rails plugins can release their po/mo-files
|
39
|
+
under their own directory(/vendor/plugins/plugindir/{po|locale}).
|
40
|
+
* samples/rails/vendor/plugins/gettext/Rakefile, README: Added.
|
41
|
+
* samples/rails/lib/tasks/gettext.rake. Move gettext_plugin target to
|
42
|
+
/vendor/plugins/gettext/Rakefile.
|
43
|
+
* samples/rails/README: Updated.
|
44
|
+
|
45
|
+
2006-05-30 Masao Mutoh <mutoh@highway.ne.jp>
|
46
|
+
|
47
|
+
* lib/gettext.rb: The scope of a textdomain becomes a class/module base
|
48
|
+
instead of a file base.
|
49
|
+
Accept plural textdomains in a class/module.
|
50
|
+
Changed bindtextdomain arguments with backward compatibility.
|
51
|
+
* lib/gettext/textdomainmanager.rb: Added for manage plural textdomains.
|
52
|
+
* lib/gettext/textdomain.rb: Fix wrong DEFAULT_LOCALE_PATHS if ruby is
|
53
|
+
installed non-standard path.
|
54
|
+
* lib/gettext/rails.rb: Changed arguments of bindtextdomain, init_gettext
|
55
|
+
with backward compatibility.
|
56
|
+
|
57
|
+
2006-05-29 Masao Mutoh <mutoh@highway.ne.jp>
|
58
|
+
|
59
|
+
* lib/gettext/rails.rb:
|
60
|
+
Remove GetText::Rails.use_localized_templates.
|
61
|
+
|
62
|
+
2006-05-24 Masao Mutoh <mutoh@highway.ne.jp>
|
63
|
+
|
64
|
+
* lib/gettext/locale_win32.rb: Fix to work with environment
|
65
|
+
variables.
|
66
|
+
|
67
|
+
2006-05-22 Masao Mutoh <mutoh@highway.ne.jp>
|
68
|
+
|
69
|
+
* lib/gettext.rb, lib/gettext/textdomain.rb: Keep a textdomain
|
70
|
+
per a class instead of per a file.
|
71
|
+
|
72
|
+
2006-05-21 Masao Mutoh <mutoh@highway.ne.jp>
|
73
|
+
|
74
|
+
* lib/gettext/rails.rb: Problem when ActionMailer isn't defined.
|
75
|
+
Reported by Gudao Luo.
|
76
|
+
|
77
|
+
2006-05-20 Masao Mutoh <mutoh@highway.ne.jp>
|
78
|
+
|
79
|
+
* lib/gettext/mo.rb: Improved to compare the file time stamps.
|
80
|
+
by Nobu Nakada.
|
81
|
+
|
82
|
+
2006-05-18 Masao Mutoh <mutoh@highway.ne.jp>
|
83
|
+
|
84
|
+
* lib/gettext/mo.rb: Fix MOFile#update! works on MS Windows.
|
85
|
+
* po/it/rails.po, samples/rails/po/it/*.po: Added by Marco Lazzeri.
|
86
|
+
|
87
|
+
2006-05-16 Masao Mutoh <mutoh@highway.ne.jp>
|
88
|
+
|
89
|
+
* Rakefile: Remove dependency - makemo => poparser.
|
90
|
+
Reported by Marco Lazzeri.
|
91
|
+
|
92
|
+
2006-05-14 Masao Mutoh <mutoh@highway.ne.jp>
|
93
|
+
|
94
|
+
* README: Updated.
|
95
|
+
* **/po/zh/*.po: Added zh_CN locale by Yingfeng.
|
96
|
+
* pre-setup.rb: Remove to call "rails setup" now needless.
|
97
|
+
Reported by Hiroyuki Iwatsuki.
|
98
|
+
|
99
|
+
2006-05-11 Masao Mutoh <mutoh@highway.ne.jp>
|
100
|
+
|
101
|
+
* Rakefile: Make samples/rails/log if it's not exisited in
|
102
|
+
makemo task.
|
103
|
+
* lib/gettext/parser/activerecord.rb: Fixed to work
|
104
|
+
Gem-less environment.
|
105
|
+
Reported by Nobuhiro IMAI.
|
106
|
+
|
107
|
+
2006-05-10 Masao Mutoh <mutoh@highway.ne.jp>
|
108
|
+
|
109
|
+
* lib/gettext/rails.rb: Fixed custom messages was not
|
110
|
+
translated of validation_length_of.
|
111
|
+
Reported by babie, charlie.
|
112
|
+
* po/ja/rails.po: Separate plural/single messages.
|
113
|
+
|
1
114
|
2006-05-07 Masao Mutoh <mutoh@highway.ne.jp>
|
2
115
|
|
3
116
|
* lib/gettext/version.rb: Increment revision number.
|
data/NEWS
CHANGED
@@ -1,10 +1,26 @@
|
|
1
|
+
= Ruby-GetText-Package-1.6.0 (2006-06-09)
|
2
|
+
|
3
|
+
* Support Chinese(zh_CN), Italian(it).
|
4
|
+
* Improve the way to manage textdomains.
|
5
|
+
* A class/module can have plural textdomains.
|
6
|
+
* A textdomain belong to a class/module.
|
7
|
+
* A class/module can have plural textdomains.
|
8
|
+
* A message is looked up in its class/module and ancestors.
|
9
|
+
|
10
|
+
You don't need to call bindtextdomain in each files.
|
11
|
+
# A textdomain belong to a file in previous version.
|
12
|
+
# And a message is looked up in the file which called
|
13
|
+
# GetText functions only.
|
14
|
+
* Fix bugs
|
15
|
+
* Samples are cleaned up.
|
16
|
+
|
1
17
|
= Ruby-GetText-Package-1.5.0 (2006-05-07)
|
2
18
|
|
3
19
|
* Support Russian.
|
4
20
|
* Fix bugs.
|
5
21
|
* Refresh mo option was added.
|
6
22
|
Check mo files and reload it if it's updated.
|
7
|
-
ruby -d or GetText::TextDomain
|
23
|
+
ruby -d or GetText::TextDomain.check_mo=(true).
|
8
24
|
Or development mode in Ruby on Rails.
|
9
25
|
|
10
26
|
= Ruby-GetText-Package-1.4.0 (2006-04-15)
|
data/README
CHANGED
@@ -25,12 +25,16 @@ Ruby-Gettext-Package
|
|
25
25
|
* rmsgfmt creates a mo-file from a po-file.
|
26
26
|
The mo-file is compatible to GNU gettext(msgfmt).
|
27
27
|
|
28
|
-
*
|
29
|
-
* A
|
30
|
-
*
|
31
|
-
|
28
|
+
* textdomain's scope is adapt to ruby class/module mechanism.
|
29
|
+
* A class/module can have plural textdomains.
|
30
|
+
* a message is looked up in its class/module and ancestors.
|
31
|
+
|
32
|
+
* Locale is retrieved from System variables (ENV['LANG'], POSIX, Win32)
|
32
33
|
|
33
34
|
* CGI support (gettext/cgi)
|
35
|
+
* Locale is retrieved from client informations
|
36
|
+
(HTTP_ACCEPT_LANGUAGE, HTTP_ACCEPT_CHARSET, QUERY_STRING(lang),
|
37
|
+
Cookies(lang)).
|
34
38
|
|
35
39
|
* ERB support (gettext/erb)
|
36
40
|
|
@@ -49,17 +53,20 @@ Requirements
|
|
49
53
|
* Racc-1.4.3 or later
|
50
54
|
<http://www.ruby-lang.org/raa/list.rhtml?name=racc>
|
51
55
|
(for compiling src/rmsgfmt.ry only)
|
52
|
-
* Ruby on Rails 1.
|
56
|
+
* Ruby on Rails 1.1.2 or later (if you use this package with Ruby on Rails)
|
53
57
|
<http://www.rubyonrails.org/>
|
54
58
|
|
55
59
|
Install
|
56
60
|
-------
|
61
|
+
gem:
|
62
|
+
($ su)
|
63
|
+
# gem install gettext
|
57
64
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
65
|
+
tar-ball:
|
66
|
+
De-Compress archive and enter its top directory.
|
67
|
+
Then type:
|
68
|
+
($ su)
|
69
|
+
# ruby setup.rb
|
63
70
|
|
64
71
|
You can also install files in your favor directory by
|
65
72
|
supplying setup.rb some options. Try "ruby setup.rb --help".
|
@@ -80,59 +87,62 @@ License
|
|
80
87
|
(See the file 'COPYING'.)
|
81
88
|
|
82
89
|
* mo.rb
|
83
|
-
Copyright (C) 2001-
|
84
|
-
Copyright (C) 2001,2002 Masahiro Sakai <s01397ms
|
90
|
+
Copyright (C) 2001-2006 Masao Mutoh <mutoh at highwhay.ne.jp>
|
91
|
+
Copyright (C) 2001,2002 Masahiro Sakai <s01397ms at sfc.keio.ac.jp>
|
85
92
|
|
86
93
|
* gettext.rb
|
87
|
-
Copyright (C) 2001-
|
88
|
-
Copyright (C) 2001,2002 Masahiro Sakai <s01397ms
|
94
|
+
Copyright (C) 2001-2006 Masao Mutoh <mutoh at highwhay.ne.jp>
|
95
|
+
Copyright (C) 2001,2002 Masahiro Sakai <s01397ms at sfc.keio.ac.jp>
|
89
96
|
|
90
97
|
* rgettext
|
91
|
-
Copyright (C) 2001-
|
92
|
-
Copyright (C) 2001,2002 Yasushi Shoji <yashi
|
98
|
+
Copyright (C) 2001-2006 Masao Mutoh <mutoh at highwhay.ne.jp>
|
99
|
+
Copyright (C) 2001,2002 Yasushi Shoji <yashi at yashi.com>
|
93
100
|
|
94
101
|
* setup.rb
|
95
|
-
Copyright (C) 2000-2005 Minero Aoki <aamine
|
102
|
+
Copyright (C) 2000-2005 Minero Aoki <aamine at loveruby.net>
|
96
103
|
This file is released under LGPL. See the top of the install.rb.
|
97
104
|
|
98
105
|
* Others
|
99
|
-
Copyright (C) 2001-2006 Masao Mutoh <mutoh
|
106
|
+
Copyright (C) 2001-2006 Masao Mutoh <mutoh at highwhay.ne.jp>
|
100
107
|
|
101
108
|
|
102
109
|
Translators
|
103
110
|
-----------
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
111
|
+
Chinese(Simplified)(zh_CN) - Yingfeng <blogyingfeng at gmail.com>
|
112
|
+
Czech(cs) - Karel Miarka <kajism at yahoo.com>
|
113
|
+
Dutch(nl) - Menno Jonkers <ruby-gettext at jonkers.com>
|
114
|
+
French(fr) - Laurent Sansonetti <laurent.sansonetti at gmail.com>
|
115
|
+
German(de) - Detlef Reichl <detlef.reichl at gmx.org>
|
116
|
+
Sven Herzberg <herzi at abi02.de>
|
117
|
+
Sascha Ebach <se at digitale-wertschoepfung.de>
|
118
|
+
Greek(el) - Damphyr <damphyr at gmx.net>
|
119
|
+
Italian(it) - Marco Lazzeri <marco.lazzeri at gmail.com>
|
120
|
+
Gabriele Renzi <surrender_it at yahoo.it>
|
121
|
+
Japanese(ja) - Masao Mutoh <mutoh at highway.ne.jp>
|
122
|
+
Korean(ko) - Gyoung-Yoon Noh <nohmad at gmail.com>
|
123
|
+
Portuguese(Brazil)(pt_BR) - Joao Pedrosa <joaopedrosa at gmail.com>
|
124
|
+
Russian(ru) - Yuri Kozlov <kozlov.y at gmail.com>
|
125
|
+
Spanish(es) - David Espada <davinci at escomposlinux.org> (current)
|
126
|
+
David Moreno Garza <damog at damog.net>
|
127
|
+
Swedish(sv) - Nikolai Weibull <mailing-lists.ruby-talk at rawuncut.elitemail.org>
|
119
128
|
|
120
129
|
Status of translations
|
121
130
|
----------------------
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
131
|
+
Chinese(zh) - 1.6.0
|
132
|
+
Czech(cs) - 1.6.0
|
133
|
+
Dutch(nl) - 1.6.0
|
134
|
+
English(default) - 1.6.0
|
135
|
+
French(fr) - 1.6.0
|
136
|
+
German(de) - 1.6.0
|
137
|
+
Greek(el) - 1.6.0
|
138
|
+
Spanish(es) - 1.6.0
|
139
|
+
Italian(it) - 1.6.0
|
140
|
+
Japanese(ja) - 1.6.0
|
141
|
+
Korean(ko) - 1.6.0
|
142
|
+
Portuguese(Brazil)(pt_BR) - 1.6.0
|
143
|
+
Russian(ru) - 1.6.0
|
134
144
|
Swedish(sv) - 0.8.0 (old)
|
135
145
|
|
136
146
|
Maintainer
|
137
147
|
----------
|
138
|
-
Masao Mutoh <mutoh
|
148
|
+
Masao Mutoh <mutoh at highway.ne.jp>
|
data/Rakefile
CHANGED
@@ -81,8 +81,10 @@ task :makemo_test do
|
|
81
81
|
end
|
82
82
|
|
83
83
|
desc "Create *.mo from *.po"
|
84
|
-
task :makemo => [:
|
84
|
+
task :makemo => [:makemo_test] do
|
85
85
|
$stderr.puts "Create rgettext/rmsgfmt mo files."
|
86
|
+
mkdir_p "samples/rails/log" unless FileTest.exist? "samples/rails/log"
|
87
|
+
|
86
88
|
GetText.create_mofiles(false)
|
87
89
|
|
88
90
|
$stderr.puts "Create samples mo files."
|
@@ -94,6 +96,8 @@ task :makemo => [:poparser, :makemo_test] do
|
|
94
96
|
$stderr.puts "Create samples/rails mo files."
|
95
97
|
GetText.create_mofiles(false, "samples/rails/po", "samples/rails/locale")
|
96
98
|
|
99
|
+
$stderr.puts "Create samples/rails plugin mo files."
|
100
|
+
GetText.create_mofiles(false, "samples/rails/vendor/plugins/gettext/po", "samples/rails/vendor/plugins/gettext/locale")
|
97
101
|
end
|
98
102
|
|
99
103
|
desc "Update pot/po files to match new version."
|
@@ -135,7 +139,7 @@ end
|
|
135
139
|
############################################################
|
136
140
|
# Package tasks
|
137
141
|
############################################################
|
138
|
-
|
142
|
+
=begin
|
139
143
|
if /mswin32/ =~ RUBY_PLATFORM
|
140
144
|
task :gem => [:mswin32so]
|
141
145
|
task :mswin32so do
|
@@ -146,7 +150,7 @@ if /mswin32/ =~ RUBY_PLATFORM
|
|
146
150
|
end
|
147
151
|
end
|
148
152
|
end
|
149
|
-
|
153
|
+
=end
|
150
154
|
desc "Create gem and tar.gz"
|
151
155
|
spec = Gem::Specification.new do |s|
|
152
156
|
s.name = 'gettext'
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/ext/gettext/locale_system.c
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
* You may redistribute it and/or modify it under the same
|
6
6
|
* license terms as Ruby.
|
7
7
|
*
|
8
|
-
* $Id: locale_system.c,v 1.
|
8
|
+
* $Id: locale_system.c,v 1.6 2006/06/04 14:43:37 mutoh Exp $
|
9
9
|
*/
|
10
10
|
|
11
11
|
#include "ruby.h"
|
@@ -39,9 +39,9 @@ gt_setlocale(self, type, locale)
|
|
39
39
|
# if defined HAVE_SETLOCALE
|
40
40
|
char* ret = setlocale(NUM2INT(type),
|
41
41
|
NIL_P(locale) ? NULL : StringValuePtr(locale));
|
42
|
-
return ret == NULL ?
|
42
|
+
return ret == NULL ? Qnil : rb_str_new2(ret);
|
43
43
|
# else
|
44
|
-
return
|
44
|
+
return Qnil;
|
45
45
|
# endif
|
46
46
|
}
|
47
47
|
|
data/lib/gettext.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
2
|
gettext.rb - GetText module
|
3
3
|
|
4
|
-
Copyright (C) 2001-
|
4
|
+
Copyright (C) 2001-2006 Masao Mutoh
|
5
5
|
Copyright (C) 2001-2003 Masahiro Sakai
|
6
6
|
|
7
7
|
Masao Mutoh <mutoh@highway.ne.jp>
|
@@ -10,14 +10,14 @@
|
|
10
10
|
You may redistribute it and/or modify it under the same
|
11
11
|
license terms as Ruby.
|
12
12
|
|
13
|
-
$Id: gettext.rb,v 1.
|
13
|
+
$Id: gettext.rb,v 1.14 2006/06/07 15:56:04 mutoh Exp $
|
14
14
|
=end
|
15
15
|
|
16
16
|
require 'rbconfig'
|
17
17
|
require 'gettext/version'
|
18
18
|
require 'gettext/mo'
|
19
19
|
require 'gettext/locale'
|
20
|
-
require 'gettext/
|
20
|
+
require 'gettext/textdomainmanager'
|
21
21
|
require 'gettext/string'
|
22
22
|
|
23
23
|
module GetText
|
@@ -25,10 +25,11 @@ module GetText
|
|
25
25
|
class NoboundTextDomainError < RuntimeError
|
26
26
|
end
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
def self.included(mod) #:nodoc:
|
29
|
+
mod.extend self
|
30
|
+
end
|
30
31
|
|
31
|
-
@@
|
32
|
+
@@__textdomainmanagers = Hash.new
|
32
33
|
|
33
34
|
# Bind a textdomain(%{path}/%{locale}/LC_MESSAGES/%{domainname}.mo) to your program.
|
34
35
|
# Normally, the texdomain scope becomes a ruby-script-file.
|
@@ -37,47 +38,44 @@ module GetText
|
|
37
38
|
#(gettext/container, gettext/erb, gettext/rails), the textdomain scope becomes a Class/Module.
|
38
39
|
#
|
39
40
|
# * domainname: the textdomain name.
|
40
|
-
# *
|
41
|
-
#
|
42
|
-
#
|
43
|
-
# the
|
41
|
+
# * options: options as an Hash.
|
42
|
+
# * :path - the path to the mo-files. When the value is nil, it will search default paths such as
|
43
|
+
# /usr/share/locale, /usr/local/share/locale)
|
44
|
+
# * :locale - the locale string such as "ja_JP.UTF-8". Generally, you should use GetText.set_locale instead.
|
45
|
+
# The value is searched order by:
|
44
46
|
#
|
45
|
-
#
|
47
|
+
# the value of this value > System default language.
|
46
48
|
#
|
47
|
-
#
|
48
|
-
#
|
49
|
+
# * :charset - output charset. This affect the current textdomain only. Generally, you should use GetText.set_output_charset instead.
|
50
|
+
# The value is searched order by:
|
49
51
|
#
|
50
|
-
#
|
52
|
+
# the value of Locale.set_output_charset > ENV["OUTPUT_CHARSET"] > this value > System default charset.
|
51
53
|
# * Returns: the GetText::TextDomain.
|
52
54
|
#
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
Locale.set_current(locale)
|
64
|
-
|
65
|
-
src = callersrc
|
66
|
-
$stderr.print "bind the domain '#{domainname}' to '#{src}'. locale is #{locale.inspect}\n" if $DEBUG
|
67
|
-
textdomain = @@__textdomain[src]
|
68
|
-
unless textdomain
|
69
|
-
textdomain = @@__textdomain_key[domainname]
|
70
|
-
@@__textdomain[src] = textdomain
|
55
|
+
# Note: Don't use locale_, charset argument(not in options).
|
56
|
+
# They are remained for backward compatibility.
|
57
|
+
#
|
58
|
+
def bindtextdomain(domainname, options = {}, locale_ = nil, charset = nil)
|
59
|
+
opt = {}
|
60
|
+
if options.kind_of? String
|
61
|
+
# For backward compatibility
|
62
|
+
opt = {:path => options, :locale => locale_, :charset => charset}
|
63
|
+
elsif options
|
64
|
+
opt = options
|
71
65
|
end
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
66
|
+
opt[:locale] = opt[:locale] ? Locale::Object.new(opt[:locale]) : Locale.get
|
67
|
+
opt[:charset] = output_charset if output_charset
|
68
|
+
locale.charset = opt[:charset] if opt[:charset]
|
69
|
+
Locale.set_current(opt[:locale])
|
70
|
+
manager = @@__textdomainmanagers[bound_target]
|
71
|
+
if manager
|
72
|
+
manager.set_locale(opt[:locale])
|
73
|
+
else
|
74
|
+
manager = TextDomainManager.new(bound_target, opt[:locale])
|
75
|
+
@@__textdomainmanagers[bound_target] = manager
|
79
76
|
end
|
80
|
-
|
77
|
+
manager.add_textdomain(domainname, opt)
|
78
|
+
manager
|
81
79
|
end
|
82
80
|
|
83
81
|
# Binds a existed textdomain to your program.
|
@@ -87,13 +85,49 @@ module GetText
|
|
87
85
|
# * domainname: a textdomain name.
|
88
86
|
# * Returns: the GetText::TextDomain.
|
89
87
|
def textdomain(domainname)
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
88
|
+
domain = TextDomainManager.textdomain(domainname)
|
89
|
+
raise NoboundTextDomainError, "#{domainname} is not bound." unless domain
|
90
|
+
manager = @@__textdomainmanagers[bound_target]
|
91
|
+
unless manager
|
92
|
+
manager = TextDomainManager.new(bound_target, Locale.get)
|
93
|
+
@@__textdomainmanagers[bound_target] = manager
|
94
|
+
end
|
95
|
+
manager.add_textdomain(domainname)
|
96
|
+
manager.set_locale(Locale.get)
|
97
|
+
end
|
98
|
+
|
99
|
+
TARGET_REGEXP = /\:\:/ # :nodoc:
|
100
|
+
|
101
|
+
# Iterates bound textdomains.
|
102
|
+
# * klass: a class/module to find. Default is the class of self.
|
103
|
+
# * ignore_targets: Ignore tragets.
|
104
|
+
# * Returns: a bound GetText::TextDomain or nil.
|
105
|
+
def each_textdomain(klass = bound_target, ignore_targets = [])
|
106
|
+
(klass.ancestors + [GetText]).each do |target|
|
107
|
+
unless ignore_targets.include? target
|
108
|
+
ignore_targets << target
|
109
|
+
manager = @@__textdomainmanagers[target]
|
110
|
+
if manager
|
111
|
+
manager.each{ |textdomain|
|
112
|
+
yield textdomain
|
113
|
+
}
|
114
|
+
end
|
115
|
+
if target.to_s =~ TARGET_REGEXP
|
116
|
+
each_textdomain(Module.const_get($`), ignore_targets){|domain|
|
117
|
+
yield domain
|
118
|
+
}
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
self
|
123
|
+
end
|
124
|
+
|
125
|
+
def bound_target # :nodoc:
|
126
|
+
if self.kind_of? Class or self.kind_of? Module
|
127
|
+
self
|
128
|
+
else
|
129
|
+
self.class
|
130
|
+
end
|
97
131
|
end
|
98
132
|
|
99
133
|
# call-seq:
|
@@ -104,8 +138,12 @@ module GetText
|
|
104
138
|
# * msgid: the message id.
|
105
139
|
# * Returns: localized text by msgid. If there are not binded mo-file, it will return msgid.
|
106
140
|
def gettext(msgid)
|
107
|
-
|
108
|
-
|
141
|
+
ret = nil
|
142
|
+
each_textdomain {|textdomain|
|
143
|
+
ret = textdomain.gettext(msgid)
|
144
|
+
break if ret
|
145
|
+
}
|
146
|
+
ret ? ret : msgid
|
109
147
|
end
|
110
148
|
|
111
149
|
# call-seq:
|
@@ -132,8 +170,12 @@ module GetText
|
|
132
170
|
msgid_plural = arg2
|
133
171
|
n = arg3
|
134
172
|
end
|
135
|
-
|
136
|
-
textdomain
|
173
|
+
ret = nil
|
174
|
+
each_textdomain {|textdomain|
|
175
|
+
ret = textdomain.ngettext(msgid, msgid_plural, n)
|
176
|
+
break if ret
|
177
|
+
}
|
178
|
+
ret ? ret : (n == 1 ? msgid : msgid_plural)
|
137
179
|
end
|
138
180
|
|
139
181
|
# This function does nothing. But it is required in order to recognize the msgid by rgettext.
|
@@ -164,12 +206,7 @@ module GetText
|
|
164
206
|
# it returns a last part of msgid separeted "div".
|
165
207
|
# See: http://www.gnu.org/software/gettext/manual/html_mono/gettext.html#SEC151
|
166
208
|
def sgettext(msgid, div = '|')
|
167
|
-
|
168
|
-
if textdomain
|
169
|
-
msg = textdomain.gettext(msgid)
|
170
|
-
else
|
171
|
-
msg = msgid
|
172
|
-
end
|
209
|
+
msg = gettext(msgid)
|
173
210
|
if msg == msgid
|
174
211
|
if index = msg.rindex(div)
|
175
212
|
msg = msg[(index + 1)..-1]
|
@@ -178,32 +215,63 @@ module GetText
|
|
178
215
|
msg
|
179
216
|
end
|
180
217
|
|
181
|
-
|
182
|
-
|
218
|
+
# Sets locale to the current class/module
|
219
|
+
#
|
220
|
+
# Notice that you shouldn't use this for your own Libraries.
|
221
|
+
# * locale: a locale string or Locale::Object.
|
222
|
+
# * this_target_only: true if you want to change the current class/module only.
|
223
|
+
# Otherwise, this changes the locale of the current class/module and its ancestors.
|
224
|
+
# Default is false.
|
225
|
+
# * Returns: self
|
226
|
+
def set_locale(locale, this_target_only = false)
|
227
|
+
ret = nil
|
228
|
+
if locale
|
229
|
+
if locale.kind_of? Locale::Object
|
230
|
+
ret = locale
|
231
|
+
else
|
232
|
+
ret = Locale::Object.new(locale.to_s)
|
233
|
+
end
|
234
|
+
ret.charset = output_charset if output_charset
|
235
|
+
Locale.set(ret)
|
236
|
+
else
|
237
|
+
Locale.clear
|
238
|
+
ret = Locale.get
|
239
|
+
end
|
240
|
+
if this_target_only
|
241
|
+
manager = @@__textdomainmanagers[bound_target]
|
242
|
+
if manager
|
243
|
+
manager.set_locale(ret)
|
244
|
+
end
|
245
|
+
else
|
246
|
+
each_textdomain {|textdomain|
|
247
|
+
textdomain.set_locale(ret)
|
248
|
+
}
|
249
|
+
end
|
250
|
+
self
|
183
251
|
end
|
184
252
|
|
185
|
-
# Sets locale
|
253
|
+
# Sets locale to the all textdomains.
|
186
254
|
#
|
187
255
|
# Notice that you shouldn't use this for your own Libraries.
|
188
256
|
# * locale: a locale string or Locale::Object.
|
189
|
-
# * src: internal usage only. You shouldn't use this.
|
190
257
|
# * Returns: self
|
191
|
-
def
|
258
|
+
def set_locale_all(locale)
|
259
|
+
ret = nil
|
192
260
|
if locale
|
193
261
|
if locale.kind_of? Locale::Object
|
194
262
|
ret = locale
|
195
263
|
else
|
196
264
|
ret = Locale::Object.new(locale.to_s)
|
197
265
|
end
|
198
|
-
ret.charset =
|
266
|
+
ret.charset = output_charset if output_charset
|
267
|
+
Locale.set(ret)
|
199
268
|
else
|
200
|
-
|
269
|
+
Locale.set(nil)
|
270
|
+
ret = Locale.get
|
201
271
|
end
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
textdomain.set_locale(ret, true) if textdomain
|
206
|
-
|
272
|
+
TextDomainManager.each_all {|textdomain|
|
273
|
+
textdomain.set_locale(ret)
|
274
|
+
}
|
207
275
|
self
|
208
276
|
end
|
209
277
|
|
@@ -212,7 +280,7 @@ module GetText
|
|
212
280
|
# * src: internal usage only. You shouldn't use this.
|
213
281
|
# * Returns: a locale string
|
214
282
|
def locale=(locale)
|
215
|
-
set_locale(locale
|
283
|
+
set_locale(locale)
|
216
284
|
locale
|
217
285
|
end
|
218
286
|
|
@@ -221,7 +289,7 @@ module GetText
|
|
221
289
|
# * charset: an output_charset
|
222
290
|
# * Returns: charset
|
223
291
|
def set_output_charset(charset)
|
224
|
-
|
292
|
+
TextDomainManager.output_charset = charset
|
225
293
|
self
|
226
294
|
end
|
227
295
|
|
@@ -229,13 +297,13 @@ module GetText
|
|
229
297
|
# * charset: an output_charset
|
230
298
|
# * Returns: charset
|
231
299
|
def output_charset=(charset)
|
232
|
-
|
300
|
+
TextDomainManager.output_charset = charset
|
233
301
|
end
|
234
302
|
|
235
303
|
# Gets the current output_charset which is set using GetText.set_output_charset.
|
236
304
|
# * Returns: output_charset.
|
237
305
|
def output_charset
|
238
|
-
|
306
|
+
TextDomainManager.output_charset
|
239
307
|
end
|
240
308
|
|
241
309
|
# Gets the current locale.
|
@@ -244,30 +312,14 @@ module GetText
|
|
244
312
|
Locale.current
|
245
313
|
end
|
246
314
|
|
247
|
-
#
|
248
|
-
|
249
|
-
|
250
|
-
# And you shouldn't use this in your own Libraries.
|
251
|
-
# * charset: an charset
|
252
|
-
# * src: internal usage only. You shouldn't use this.
|
253
|
-
# * Returns: self
|
254
|
-
def set_charset(cs, src = callersrc)
|
255
|
-
textdomain = @@__textdomain[src]
|
256
|
-
if textdomain
|
257
|
-
locale = textdomain.current_locale
|
258
|
-
locale ||= Locale.current
|
259
|
-
locale.charset = cs if locale
|
260
|
-
textdomain.set_locale(locale, true)
|
261
|
-
Locale.set_current(locale)
|
262
|
-
end
|
315
|
+
# Deprecated. Now this function do nothing. Use GetText.output_charset= instead.
|
316
|
+
def set_charset(cs)
|
317
|
+
$stderr.puts "Deprecated. Now this function do nothing. Use GetText.output_charset= instead." if $DEBUG
|
263
318
|
self
|
264
319
|
end
|
265
320
|
|
266
|
-
|
267
|
-
|
268
|
-
# * Returns: charset
|
269
|
-
def charset=(cs)
|
270
|
-
set_charset(cs, callersrc)
|
321
|
+
def charset=(cs) #:nodoc:
|
322
|
+
set_charset(cs)
|
271
323
|
cs
|
272
324
|
end
|
273
325
|
|
@@ -284,9 +336,8 @@ module GetText
|
|
284
336
|
alias :n_ :ngettext #:nodoc:
|
285
337
|
alias :s_ :sgettext #:nodoc:
|
286
338
|
|
287
|
-
module_function :bindtextdomain, :textdomain,
|
288
|
-
:N_, :gettext, :_, :ngettext, :n_,
|
289
|
-
:
|
290
|
-
:setlocale, :set_locale, :locale=, :locale, :charset=, :set_charset,
|
339
|
+
module_function :bindtextdomain, :textdomain, :each_textdomain,
|
340
|
+
:N_, :gettext, :_, :ngettext, :n_, :sgettext, :s_, :bound_target,
|
341
|
+
:setlocale, :set_locale, :locale=, :set_locale_all, :locale, :charset=, :set_charset,
|
291
342
|
:set_output_charset, :output_charset=, :output_charset
|
292
343
|
end
|