gettext 1.0.0-mswin32 → 1.1.0-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +193 -0
- data/NEWS +51 -1
- data/README +29 -11
- data/Rakefile +70 -56
- data/bin/rgettext +2 -0
- data/bin/rmsgfmt +2 -0
- data/bin/rmsgmerge +24 -0
- 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/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/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/sv/LC_MESSAGES/rgettext.mo +0 -0
- data/ext/gettext/gettext/_locale.BAK +86 -0
- data/ext/gettext/gettext/_locale.c +1 -1
- data/ext/gettext/gettext/_locale.exp +0 -0
- data/ext/gettext/gettext/_locale.lib +0 -0
- data/ext/gettext/gettext/_locale.obj +0 -0
- data/ext/gettext/gettext/_locale.pdb +0 -0
- data/ext/gettext/gettext/_locale.so +0 -0
- data/ext/gettext/gettext/mkmf.log +4 -4
- data/ext/gettext/gettext/vc70.pdb +0 -0
- data/lib/_locale.so +0 -0
- data/lib/gettext.rb +17 -4
- data/lib/gettext/cgi.rb +34 -19
- data/lib/gettext/locale.rb +3 -13
- data/lib/gettext/locale_default.rb +2 -2
- data/lib/gettext/locale_win32.rb +27 -7
- data/lib/gettext/mo.rb +6 -1
- data/lib/gettext/parser/activerecord.rb +115 -0
- data/lib/gettext/parser/glade.rb +3 -1
- data/lib/gettext/parser/ruby.rb +56 -57
- data/lib/gettext/poparser.rb +297 -0
- data/lib/gettext/rails.rb +161 -3
- data/lib/gettext/rgettext.rb +19 -9
- data/lib/gettext/rmsgfmt.rb +95 -363
- data/lib/gettext/rmsgmerge.rb +381 -0
- data/lib/gettext/string.rb +26 -0
- data/lib/gettext/textdomain.rb +21 -18
- data/lib/gettext/utils.rb +55 -0
- data/lib/gettext/version.rb +1 -1
- data/po/cs/rails.po +83 -0
- data/po/cs/rgettext.po +104 -0
- data/po/de/rails.po +79 -0
- data/po/de/rgettext.po +72 -21
- data/po/es/rails.po +80 -0
- data/po/es/rgettext.po +75 -19
- data/po/fr/rails.po +81 -0
- data/po/fr/rgettext.po +75 -19
- data/po/it/rgettext.po +68 -17
- data/po/ja/rails.po +78 -0
- data/po/ja/rgettext.po +71 -20
- data/po/ko/rails.po +77 -0
- data/po/ko/rgettext.po +74 -22
- data/po/nl/rails.po +80 -0
- data/po/nl/rgettext.po +102 -0
- data/po/pt_BR/rails.po +79 -0
- data/po/pt_BR/rgettext.po +77 -24
- data/po/rails.pot +80 -0
- data/po/rgettext.pot +63 -13
- data/po/sv/rgettext.po +63 -15
- data/samples/cgi/cookie.cgi +5 -0
- data/samples/cgi/helloerb1.cgi +4 -0
- data/samples/cgi/helloerb2.cgi +5 -0
- data/samples/cgi/index.cgi +5 -0
- data/samples/cgi/locale/cs/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/cs/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/cs/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/cs/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/fr/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/ko/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/ko/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/ko/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/ko/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/nl/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/nl/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/nl/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/nl/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/pt_BR/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/pt_BR/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/pt_BR/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/pt_BR/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/po/cs/helloerb1.po +66 -0
- data/samples/cgi/po/cs/helloerb2.po +52 -0
- data/samples/cgi/po/cs/hellolib.po +25 -0
- data/samples/cgi/po/cs/main.po +78 -0
- data/samples/cgi/po/fr/main.po +8 -8
- data/samples/cgi/po/ko/helloerb1.po +2 -3
- data/samples/cgi/po/ko/helloerb2.po +1 -2
- data/samples/cgi/po/ko/hellolib.po +1 -2
- data/samples/cgi/po/ko/main.po +2 -3
- data/samples/cgi/po/nl/helloerb1.po +60 -0
- data/samples/cgi/po/nl/helloerb2.po +52 -0
- data/samples/cgi/po/nl/hellolib.po +24 -0
- data/samples/cgi/po/nl/main.po +76 -0
- data/samples/cgi/po/pt_BR/helloerb1.po +59 -0
- data/samples/cgi/po/pt_BR/helloerb2.po +51 -0
- data/samples/cgi/po/pt_BR/hellolib.po +22 -0
- data/samples/cgi/po/pt_BR/main.po +75 -0
- data/samples/locale/cs/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/cs/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/cs/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/cs/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/cs/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/cs/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/cs/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/locale/fr/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/ko/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/ko/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/ko/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/ko/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/ko/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/ko/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/ko/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/locale/nl/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/nl/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/nl/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/nl/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/nl/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/nl/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/nl/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/locale/pt_BR/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/pt_BR/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/pt_BR/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/pt_BR/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/pt_BR/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/pt_BR/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/pt_BR/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/po/cs/hello.po +23 -0
- data/samples/po/cs/hello2.po +31 -0
- data/samples/po/cs/hello_noop.po +27 -0
- data/samples/po/cs/hello_plural.po +26 -0
- data/samples/po/cs/helloglade2.po +37 -0
- data/samples/po/cs/hellogtk.po +23 -0
- data/samples/po/cs/hellotk.po +23 -0
- data/samples/po/fr/helloglade2.po +2 -2
- data/samples/po/hello.pot +1 -0
- data/samples/po/hello2.pot +1 -0
- data/samples/po/hello_noop.pot +2 -1
- data/samples/po/hello_plural.pot +6 -2
- data/samples/po/helloglade2.pot +8 -3
- data/samples/po/hellotk.pot +4 -0
- data/samples/po/ko/hello.po +1 -2
- data/samples/po/ko/hello2.po +1 -2
- data/samples/po/ko/hello_noop.po +1 -2
- data/samples/po/ko/hello_plural.po +1 -2
- data/samples/po/ko/helloglade2.po +2 -2
- data/samples/po/ko/hellogtk.po +1 -2
- data/samples/po/ko/hellotk.po +1 -2
- data/samples/po/nl/hello.po +24 -0
- data/samples/po/nl/hello2.po +32 -0
- data/samples/po/nl/hello_noop.po +28 -0
- data/samples/po/nl/hello_plural.po +26 -0
- data/samples/po/nl/helloglade2.po +31 -0
- data/samples/po/nl/hellogtk.po +24 -0
- data/samples/po/nl/hellotk.po +24 -0
- data/samples/po/pt_BR/hello.po +6 -5
- data/samples/po/pt_BR/hello2.po +6 -5
- data/samples/po/pt_BR/hello_noop.po +6 -5
- data/samples/po/pt_BR/hello_plural.po +6 -6
- data/samples/po/pt_BR/helloglade2.po +6 -5
- data/samples/po/pt_BR/hellogtk.po +6 -5
- data/samples/po/pt_BR/hellotk.po +6 -5
- data/samples/rails/README +21 -15
- data/samples/rails/Rakefile +10 -1
- data/samples/rails/app/controllers/application.rb +10 -18
- data/samples/rails/app/controllers/blog_controller.rb +1 -5
- data/samples/rails/app/helpers/blog_helper.rb +1 -1
- data/samples/rails/app/models/article.rb +15 -0
- data/samples/rails/app/views/blog/_form.rhtml +2 -2
- data/samples/rails/config/boot.rb +17 -0
- data/samples/rails/config/database.yml +6 -4
- data/samples/rails/config/environment.rb +40 -75
- data/samples/rails/config/environments/development.rb +12 -7
- data/samples/rails/config/environments/production.rb +17 -6
- data/samples/rails/config/environments/test.rb +8 -6
- data/samples/rails/locale/cs/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/cs/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/de/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/de/LC_MESSAGES/gettext_plugin.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/es/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/fr/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/fr/LC_MESSAGES/{lang_helper.mo → gettext_plugin.mo} +0 -0
- data/samples/rails/locale/ja/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/ja/LC_MESSAGES/{lang_helper.mo → gettext_plugin.mo} +0 -0
- data/samples/rails/locale/ko/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/ko/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/nl/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/nl/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/pt_BR/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/pt_BR/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/po/blog.pot +57 -37
- data/samples/rails/po/cs/blog.po +116 -0
- data/samples/rails/po/cs/gettext_plugin.po +29 -0
- data/samples/rails/po/de/blog.po +70 -51
- data/samples/rails/po/de/{lang_helper.po → gettext_plugin.po} +4 -5
- data/samples/rails/po/en/blog.po +111 -0
- data/samples/rails/po/es/blog.po +67 -47
- data/samples/rails/po/es/{lang_helper.po → gettext_plugin.po} +5 -5
- data/samples/rails/po/fr/blog.po +65 -45
- data/samples/rails/po/fr/{lang_helper.po → gettext_plugin.po} +4 -4
- data/samples/rails/po/{lang_helper.pot → gettext_plugin.pot} +4 -4
- data/samples/rails/po/ja/blog.po +64 -44
- data/samples/rails/po/ja/{lang_helper.po → gettext_plugin.po} +4 -4
- data/samples/rails/po/ko/blog.po +65 -46
- data/samples/rails/po/ko/{lang_helper.po → gettext_plugin.po} +5 -6
- data/samples/rails/po/nl/blog.po +115 -0
- data/samples/rails/po/nl/gettext_plugin.po +28 -0
- data/samples/rails/po/pt_BR/blog.po +109 -0
- data/samples/rails/po/pt_BR/gettext_plugin.po +27 -0
- data/samples/rails/public/images/rails.png +0 -0
- data/samples/rails/public/index.html +272 -71
- data/samples/rails/public/javascripts/controls.js +441 -166
- data/samples/rails/public/javascripts/dragdrop.js +261 -279
- data/samples/rails/public/javascripts/effects.js +657 -277
- data/samples/rails/public/javascripts/prototype.js +911 -223
- data/samples/rails/public/robots.txt +1 -0
- data/samples/rails/public/stylesheets/scaffold.css +1 -1
- data/samples/rails/script/about +3 -0
- data/samples/rails/script/breakpointer +3 -4
- data/samples/rails/script/console +3 -23
- data/samples/rails/script/destroy +3 -7
- data/samples/rails/script/generate +3 -7
- data/samples/rails/script/performance/benchmarker +3 -0
- data/samples/rails/script/performance/profiler +3 -0
- data/samples/rails/script/plugin +3 -0
- data/samples/rails/script/process/reaper +3 -0
- data/samples/rails/script/process/spawner +3 -0
- data/samples/rails/script/process/spinner +3 -0
- data/samples/rails/script/runner +3 -29
- data/samples/rails/script/server +3 -49
- data/samples/rails/vendor/plugins/gettext/init.rb +19 -0
- data/samples/rails/vendor/{lang_helper.rb → plugins/gettext/lib/gettext_plugin.rb} +15 -11
- data/src/poparser.ry +171 -0
- data/test/gettext_runner.rb +3 -1
- data/test/gettext_test.rb +56 -31
- data/test/gettext_test_cgi.rb +12 -0
- data/test/gettext_test_parser.rb +3 -0
- data/test/gettext_test_string.rb +14 -0
- data/test/locale/cr/LC_MESSAGES/plural.mo +0 -0
- data/test/locale/da/LC_MESSAGES/plural.mo +0 -0
- data/test/locale/da/LC_MESSAGES/plural_error.mo +0 -0
- data/test/locale/fr/LC_MESSAGES/plural.mo +0 -0
- data/test/locale/fr/LC_MESSAGES/plural_error.mo +0 -0
- data/test/locale/ir/LC_MESSAGES/plural.mo +0 -0
- data/test/locale/la/LC_MESSAGES/plural.mo +0 -0
- data/test/locale/li/LC_MESSAGES/plural.mo +0 -0
- data/test/locale/po/LC_MESSAGES/plural.mo +0 -0
- data/test/locale/sl/LC_MESSAGES/plural.mo +0 -0
- data/test/po/cr/plural.po +3 -3
- data/test/po/da/plural.po +2 -2
- data/test/po/da/plural_error.po +2 -1
- data/test/po/fr/plural.po +2 -2
- data/test/po/fr/plural_error.po +2 -1
- data/test/po/ir/plural.po +3 -3
- data/test/po/la/plural.po +3 -3
- data/test/po/li/plural.po +3 -3
- data/test/po/po/plural.po +3 -3
- data/test/po/sl/plural.po +4 -4
- data/test/test.sh +1 -0
- data/test/test_rubyparser.rb +20 -0
- data/test/{test_rubyparser_n.rb → test_rubyparser_N.rb} +0 -0
- metadata +163 -43
- data/README.ja +0 -115
- data/data/locale/de/LC_MESSAGES/rmsgfmt.mo +0 -0
- data/data/locale/es/LC_MESSAGES/rmsgfmt.mo +0 -0
- data/data/locale/fr/LC_MESSAGES/rmsgfmt.mo +0 -0
- data/data/locale/it/LC_MESSAGES/rmsgfmt.mo +0 -0
- data/data/locale/ja/LC_MESSAGES/rmsgfmt.mo +0 -0
- data/data/locale/ko/LC_MESSAGES/rmsgfmt.mo +0 -0
- data/data/locale/pt_BR/LC_MESSAGES/rmsgfmt.mo +0 -0
- data/data/locale/sv/LC_MESSAGES/rmsgfmt.mo +0 -0
- data/gettext-1.0.0-mswin32.gem +0 -0
- data/po/de/rmsgfmt.po +0 -45
- data/po/es/rmsgfmt.po +0 -43
- data/po/fr/rmsgfmt.po +0 -43
- data/po/it/rmsgfmt.po +0 -44
- data/po/ja/rmsgfmt.po +0 -43
- data/po/ko/rmsgfmt.po +0 -40
- data/po/pt_BR/rmsgfmt.po +0 -42
- data/po/rmsgfmt.pot +0 -40
- data/po/sv/rmsgfmt.po +0 -43
- data/samples/rails/locale/de/LC_MESSAGES/lang_helper.mo +0 -0
- data/samples/rails/locale/es/LC_MESSAGES/lang_helper.mo +0 -0
- data/samples/rails/locale/ko/LC_MESSAGES/lang_helper.mo +0 -0
- data/samples/rails/log/development.log +0 -378
- data/src/rmsgfmt.ry +0 -233
data/lib/gettext/rails.rb
CHANGED
@@ -6,29 +6,54 @@
|
|
6
6
|
You may redistribute it and/or modify it under the same
|
7
7
|
license terms as Ruby.
|
8
8
|
|
9
|
-
$Id: rails.rb,v 1.
|
9
|
+
$Id: rails.rb,v 1.8 2005/12/28 17:32:58 mutoh Exp $
|
10
10
|
=end
|
11
11
|
|
12
12
|
require 'gettext'
|
13
13
|
require 'gettext/cgi'
|
14
|
+
require 'active_record'
|
15
|
+
require 'active_support'
|
14
16
|
|
15
17
|
module GetText
|
16
18
|
module Rails
|
17
19
|
include GetText
|
18
20
|
|
21
|
+
Rails = ::Rails
|
22
|
+
|
19
23
|
alias :_bindtextdomain :bindtextdomain
|
20
24
|
|
21
|
-
def bindtextdomain(domainname, _cgi = nil, locale = nil, charset =
|
25
|
+
def bindtextdomain(domainname, _cgi = nil, locale = nil, charset = nil, with_model = true)
|
22
26
|
set_cgi(_cgi) if _cgi
|
23
27
|
@gettext_container_domainname = domainname
|
24
28
|
path = File.join(RAILS_ROOT, "locale")
|
25
29
|
_bindtextdomain(domainname, path, locale, charset)
|
30
|
+
|
31
|
+
bindtextdomain_to(ActiveRecord::Base, domainname) if with_model
|
32
|
+
end
|
33
|
+
|
34
|
+
def bindtextdomain_to(klass, domainname)
|
35
|
+
klass.class_eval {
|
36
|
+
include GetText::Rails
|
37
|
+
extend GetText::Rails
|
38
|
+
textdomain(domainname)
|
39
|
+
|
40
|
+
def self.human_attribute_name(attribute_key_name)
|
41
|
+
ret = ""
|
42
|
+
if self == ActiveRecord::Base
|
43
|
+
#Table name
|
44
|
+
ret = _(attribute_key_name.humanize)
|
45
|
+
else
|
46
|
+
ret = s_("#{self}|#{attribute_key_name.humanize}")
|
47
|
+
end
|
48
|
+
ret
|
49
|
+
end
|
50
|
+
}
|
26
51
|
end
|
27
52
|
|
28
53
|
def callersrc
|
54
|
+
@gettext_container_domainname = nil unless defined? @gettext_container_domainname
|
29
55
|
@gettext_container_domainname
|
30
56
|
end
|
31
|
-
|
32
57
|
end
|
33
58
|
end
|
34
59
|
|
@@ -36,5 +61,138 @@ module ActionController
|
|
36
61
|
class Base
|
37
62
|
helper GetText::Rails
|
38
63
|
include GetText::Rails
|
64
|
+
extend GetText::Rails
|
65
|
+
|
66
|
+
@@gettext_domainname = nil
|
67
|
+
@@gettext_content_type = nil
|
68
|
+
|
69
|
+
prepend_before_filter :init_gettext
|
70
|
+
|
71
|
+
def init_gettext_main
|
72
|
+
bindtextdomain(@@gettext_domainname, request.cgi) #You need to pass CGI object first.
|
73
|
+
@headers["Content-Type"] = "#{@@gettext_content_type}; charset=#{GetText.output_charset}"
|
74
|
+
end
|
75
|
+
|
76
|
+
def init_gettext
|
77
|
+
init_gettext_main
|
78
|
+
ActiveRecord::Errors.class_eval{
|
79
|
+
# You need to call bindtextdomain here because ActiveRecord::Errors doesn't know
|
80
|
+
# what locale is used in.
|
81
|
+
GetText.bindtextdomain("rails")
|
82
|
+
}
|
83
|
+
end
|
84
|
+
|
85
|
+
def self.init_gettext(domainname, charset = "UTF-8", content_type = "text/html")
|
86
|
+
GetText.output_charset = charset
|
87
|
+
@@gettext_domainname = domainname
|
88
|
+
@@gettext_content_type = content_type
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
module ActiveRecord
|
94
|
+
class Errors
|
95
|
+
include GetText
|
96
|
+
extend GetText
|
97
|
+
|
98
|
+
RE_FIELD_NAME = /%\{fn\}/
|
99
|
+
|
100
|
+
# You need to define this here, because this values will be updated by application.
|
101
|
+
default_error_messages.update(
|
102
|
+
:inclusion => N_("%{fn} is not included in the list"),
|
103
|
+
:exclusion => N_("%{fn} is reserved"),
|
104
|
+
:invalid => N_("%{fn} is invalid"),
|
105
|
+
:confirmation => N_("%{fn} doesn't match confirmation"),
|
106
|
+
:accepted => N_("%{fn} must be accepted"),
|
107
|
+
:empty => N_("%{fn} can't be empty"),
|
108
|
+
:blank => N_("%{fn} can't be blank"),
|
109
|
+
:too_long => N_("%{fn} is too long (max is %d characters)"),
|
110
|
+
:too_short => N_("%{fn} is too short (min is %d characters)"),
|
111
|
+
:wrong_length => N_("%{fn} is the wrong length (should be %d characters)"),
|
112
|
+
:taken => N_("%{fn} has already been taken"),
|
113
|
+
:not_a_number => N_("%{fn} is not a number")
|
114
|
+
)
|
115
|
+
|
116
|
+
@@default_error_messages_d = {
|
117
|
+
:too_long => default_error_messages[:too_long],
|
118
|
+
:too_short => default_error_messages[:too_short],
|
119
|
+
:wrong_length => default_error_messages[:wrong_length]
|
120
|
+
}
|
121
|
+
|
122
|
+
def self.convert_validates_messages_of_validates_length_of
|
123
|
+
default_error_messages[:too_long] = _(@@default_error_messages_d[:too_long])
|
124
|
+
default_error_messages[:too_short] = _(@@default_error_messages_d[:too_short])
|
125
|
+
default_error_messages[:wrong_length] = _(@@default_error_messages_d[:wrong_length])
|
126
|
+
end
|
127
|
+
|
128
|
+
def full_messages
|
129
|
+
full_messages = []
|
130
|
+
|
131
|
+
@errors.each_key do |attr|
|
132
|
+
@errors[attr].each do |msg|
|
133
|
+
next if msg.nil?
|
134
|
+
if attr == "base"
|
135
|
+
full_messages << _(msg)
|
136
|
+
elsif RE_FIELD_NAME =~ msg
|
137
|
+
full_messages << _(msg) % {:fn => @base.class.human_attribute_name(attr)}
|
138
|
+
else
|
139
|
+
full_messages << @base.class.human_attribute_name(attr) + " " + msg
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
full_messages
|
144
|
+
end
|
39
145
|
end
|
146
|
+
|
147
|
+
module Validations
|
148
|
+
module ClassMethods
|
149
|
+
alias :_validates_length_of :validates_length_of
|
150
|
+
def validates_length_of(*attrs)
|
151
|
+
ActiveRecord::Errors.convert_validates_messages_of_validates_length_of
|
152
|
+
_validates_length_of(*attrs)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
|
159
|
+
module ActionView
|
160
|
+
module Helpers
|
161
|
+
module ActiveRecordHelper
|
162
|
+
module L10n
|
163
|
+
# Separate namespace for textdomain
|
164
|
+
include GetText
|
165
|
+
extend GetText
|
166
|
+
module_function
|
167
|
+
def error_messages_for(object, klass, options = {})
|
168
|
+
textdomain("rails")
|
169
|
+
options = options.symbolize_keys
|
170
|
+
|
171
|
+
unless object.errors.empty?
|
172
|
+
count = object.errors.count
|
173
|
+
record = ActiveRecord::Base.human_attribute_name(object.class.to_s)
|
174
|
+
klass.content_tag("div",
|
175
|
+
klass.content_tag(
|
176
|
+
options[:header_tag] || "h2",
|
177
|
+
n_("%{num} error prohibited this %{record} from being saved",
|
178
|
+
"%{num} errors prohibited this %{record} from being saved", count) %
|
179
|
+
{:num => count, :record => record}) +
|
180
|
+
klass.content_tag("p", n_("There were problems with the following field:",
|
181
|
+
"There were problems with the following fields:", count)) +
|
182
|
+
klass.content_tag("ul", object.errors.full_messages.collect { |msg| klass.content_tag("li", msg) }),
|
183
|
+
"id" => options[:id] || "errorExplanation", "class" => options[:class] || "errorExplanation"
|
184
|
+
)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
def error_messages_for(object_name, options = {})
|
189
|
+
object = instance_variable_get("@#{object_name}")
|
190
|
+
L10n.error_messages_for(object, self, options)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
Rails::Info.property("GetText version") do
|
197
|
+
GetText::VERSION
|
40
198
|
end
|
data/lib/gettext/rgettext.rb
CHANGED
@@ -24,23 +24,34 @@ module GetText
|
|
24
24
|
|
25
25
|
# constant values
|
26
26
|
VERSION = GetText::VERSION
|
27
|
-
DATE = %w($Date: 2005/
|
27
|
+
DATE = %w($Date: 2005/12/25 11:43:20 $)[1]
|
28
28
|
MAX_LINE_LEN = 70
|
29
29
|
|
30
|
-
|
30
|
+
@ex_parsers = []
|
31
|
+
[
|
31
32
|
["glade.rb", "GladeParser"],
|
32
33
|
["erb.rb", "ErbParser"],
|
34
|
+
["activerecord.rb", "ActiveRecordParser"],
|
35
|
+
# ["ripper.rb", "RipperParser"],
|
33
36
|
["ruby.rb", "RubyParser"] # Default parser.
|
34
|
-
]
|
35
|
-
|
36
|
-
|
37
|
-
|
37
|
+
].each do |f, klass|
|
38
|
+
begin
|
39
|
+
require File.join("gettext/parser/#{f}")
|
40
|
+
@ex_parsers << GetText.const_get(klass)
|
41
|
+
rescue
|
42
|
+
$stderr.puts _("'%{klass}' is ignored.") % {:klass => klass}
|
43
|
+
$stderr.puts $! if $DEBUG
|
44
|
+
end
|
38
45
|
end
|
39
46
|
|
40
47
|
module_function
|
41
48
|
|
42
49
|
def generate_pot_header
|
43
|
-
time = Time.now.strftime("%Y-%m-%d %H:%M
|
50
|
+
time = Time.now.strftime("%Y-%m-%d %H:%M")
|
51
|
+
off = Time.now.utc_offset
|
52
|
+
sign = off <= 0 ? '-' : '+'
|
53
|
+
time += sprintf('%s%02d%02d', sign, *(off.abs / 60).divmod(60))
|
54
|
+
|
44
55
|
%Q[# SOME DESCRIPTIVE TITLE.
|
45
56
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
46
57
|
# This file is distributed under the same license as the PACKAGE package.
|
@@ -95,8 +106,7 @@ msgstr ""
|
|
95
106
|
ary = []
|
96
107
|
files.each do |file|
|
97
108
|
begin
|
98
|
-
|
99
|
-
klass = GetText.const_get(c)
|
109
|
+
@ex_parsers.each do |klass|
|
100
110
|
if klass.target?(file)
|
101
111
|
ary = klass.parse(file, ary)
|
102
112
|
break
|
data/lib/gettext/rmsgfmt.rb
CHANGED
@@ -1,363 +1,95 @@
|
|
1
|
-
=begin
|
2
|
-
rmsgfmt.rb - Generate a .mo
|
3
|
-
|
4
|
-
Copyright (C) 2003-2005 Masao Mutoh <mutoh@highway.ne.jp>
|
5
|
-
|
6
|
-
You may redistribute it and/or modify it under the same
|
7
|
-
license terms as Ruby.
|
8
|
-
=end
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
end
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
3, 14, :_reduce_8,
|
97
|
-
2, 10, :_reduce_9,
|
98
|
-
1, 10, :_reduce_none,
|
99
|
-
2, 12, :_reduce_11,
|
100
|
-
1, 12, :_reduce_12 ]
|
101
|
-
|
102
|
-
racc_reduce_n = 13
|
103
|
-
|
104
|
-
racc_shift_n = 22
|
105
|
-
|
106
|
-
racc_action_table = [
|
107
|
-
3, 9, 4, 5, 12, 13, 11, 18, 11, 11,
|
108
|
-
9, 9, 9, 7, 11, 18, 20, 9, 11 ]
|
109
|
-
|
110
|
-
racc_action_check = [
|
111
|
-
1, 13, 1, 1, 10, 10, 10, 14, 14, 8,
|
112
|
-
4, 12, 5, 3, 15, 16, 18, 20, 21 ]
|
113
|
-
|
114
|
-
racc_action_pointer = [
|
115
|
-
nil, 0, nil, 13, 4, 6, nil, nil, 3, nil,
|
116
|
-
0, nil, 5, -5, 2, 8, 10, nil, 9, nil,
|
117
|
-
11, 12 ]
|
118
|
-
|
119
|
-
racc_action_default = [
|
120
|
-
-1, -13, -3, -13, -10, -13, -2, 22, -9, -12,
|
121
|
-
-13, -11, -13, -13, -13, -4, -5, -7, -13, -6,
|
122
|
-
-13, -8 ]
|
123
|
-
|
124
|
-
racc_goto_table = [
|
125
|
-
8, 10, 17, 2, 19, 6, 16, 1, 14, 15,
|
126
|
-
nil, nil, nil, nil, nil, nil, 21 ]
|
127
|
-
|
128
|
-
racc_goto_check = [
|
129
|
-
4, 4, 6, 3, 6, 2, 5, 1, 4, 4,
|
130
|
-
nil, nil, nil, nil, nil, nil, 4 ]
|
131
|
-
|
132
|
-
racc_goto_pointer = [
|
133
|
-
nil, 7, 4, 2, -4, -8, -12 ]
|
134
|
-
|
135
|
-
racc_goto_default = [
|
136
|
-
nil, nil, nil, nil, nil, nil, nil ]
|
137
|
-
|
138
|
-
racc_token_table = {
|
139
|
-
false => 0,
|
140
|
-
Object.new => 1,
|
141
|
-
:COMMENT => 2,
|
142
|
-
:MSGID => 3,
|
143
|
-
:MSGID_PLURAL => 4,
|
144
|
-
:MSGSTR => 5,
|
145
|
-
:STRING => 6,
|
146
|
-
:PLURAL_NUM => 7 }
|
147
|
-
|
148
|
-
racc_use_result_var = true
|
149
|
-
|
150
|
-
racc_nt_base = 8
|
151
|
-
|
152
|
-
Racc_arg = [
|
153
|
-
racc_action_table,
|
154
|
-
racc_action_check,
|
155
|
-
racc_action_default,
|
156
|
-
racc_action_pointer,
|
157
|
-
racc_goto_table,
|
158
|
-
racc_goto_check,
|
159
|
-
racc_goto_default,
|
160
|
-
racc_goto_pointer,
|
161
|
-
racc_nt_base,
|
162
|
-
racc_reduce_table,
|
163
|
-
racc_token_table,
|
164
|
-
racc_shift_n,
|
165
|
-
racc_reduce_n,
|
166
|
-
racc_use_result_var ]
|
167
|
-
|
168
|
-
Racc_token_to_s_table = [
|
169
|
-
'$end',
|
170
|
-
'error',
|
171
|
-
'COMMENT',
|
172
|
-
'MSGID',
|
173
|
-
'MSGID_PLURAL',
|
174
|
-
'MSGSTR',
|
175
|
-
'STRING',
|
176
|
-
'PLURAL_NUM',
|
177
|
-
'$start',
|
178
|
-
'msgfmt',
|
179
|
-
'comment',
|
180
|
-
'message',
|
181
|
-
'string_list',
|
182
|
-
'msgstr_plural',
|
183
|
-
'msgstr_plural_line']
|
184
|
-
|
185
|
-
Racc_debug_parser = true
|
186
|
-
|
187
|
-
##### racc system variables end #####
|
188
|
-
|
189
|
-
# reduce 0 omitted
|
190
|
-
|
191
|
-
# reduce 1 omitted
|
192
|
-
|
193
|
-
# reduce 2 omitted
|
194
|
-
|
195
|
-
# reduce 3 omitted
|
196
|
-
|
197
|
-
module_eval <<'.,.,', 'src/rmsgfmt.ry', 36
|
198
|
-
def _reduce_4( val, _values, result )
|
199
|
-
if @fuzzy
|
200
|
-
if val[1] != ""
|
201
|
-
$stderr.print _("Warning: fuzzy message was ignored.\n")
|
202
|
-
$stderr.print " msgid '#{val[1]}'\n"
|
203
|
-
else
|
204
|
-
@data[""] = unescape(val[3])
|
205
|
-
end
|
206
|
-
@fuzzy = false
|
207
|
-
else
|
208
|
-
@data[unescape(val[1])] = unescape(val[3])
|
209
|
-
end
|
210
|
-
result = ""
|
211
|
-
result
|
212
|
-
end
|
213
|
-
.,.,
|
214
|
-
|
215
|
-
module_eval <<'.,.,', 'src/rmsgfmt.ry', 51
|
216
|
-
def _reduce_5( val, _values, result )
|
217
|
-
if @fuzzy
|
218
|
-
if val[1] != ""
|
219
|
-
$stderr.print _("Warning: fuzzy message was ignored.\n")
|
220
|
-
$stderr.print "msgid = '#{val[1]}\n"
|
221
|
-
else
|
222
|
-
@data[""] = unescape(val[3])
|
223
|
-
end
|
224
|
-
@fuzzy = false
|
225
|
-
else
|
226
|
-
@data[unescape(val[1]) + "\000" + unescape(val[3])] = unescape(val[4])
|
227
|
-
end
|
228
|
-
result = ""
|
229
|
-
result
|
230
|
-
end
|
231
|
-
.,.,
|
232
|
-
|
233
|
-
module_eval <<'.,.,', 'src/rmsgfmt.ry', 58
|
234
|
-
def _reduce_6( val, _values, result )
|
235
|
-
result = val[0] + "\000" + val[1]
|
236
|
-
result
|
237
|
-
end
|
238
|
-
.,.,
|
239
|
-
|
240
|
-
# reduce 7 omitted
|
241
|
-
|
242
|
-
module_eval <<'.,.,', 'src/rmsgfmt.ry', 66
|
243
|
-
def _reduce_8( val, _values, result )
|
244
|
-
result = val[2]
|
245
|
-
result
|
246
|
-
end
|
247
|
-
.,.,
|
248
|
-
|
249
|
-
module_eval <<'.,.,', 'src/rmsgfmt.ry', 73
|
250
|
-
def _reduce_9( val, _values, result )
|
251
|
-
@fuzzy = true if /fuzzy/ =~ val[1]
|
252
|
-
result
|
253
|
-
end
|
254
|
-
.,.,
|
255
|
-
|
256
|
-
# reduce 10 omitted
|
257
|
-
|
258
|
-
module_eval <<'.,.,', 'src/rmsgfmt.ry', 81
|
259
|
-
def _reduce_11( val, _values, result )
|
260
|
-
result = val.delete_if{|item| item == ""}.join
|
261
|
-
result
|
262
|
-
end
|
263
|
-
.,.,
|
264
|
-
|
265
|
-
module_eval <<'.,.,', 'src/rmsgfmt.ry', 85
|
266
|
-
def _reduce_12( val, _values, result )
|
267
|
-
result = val[0]
|
268
|
-
result
|
269
|
-
end
|
270
|
-
.,.,
|
271
|
-
|
272
|
-
def _reduce_none( val, _values, result )
|
273
|
-
result
|
274
|
-
end
|
275
|
-
|
276
|
-
end # class PoParser
|
277
|
-
|
278
|
-
end # module GetText
|
279
|
-
|
280
|
-
require 'optparse'
|
281
|
-
require 'gettext'
|
282
|
-
require 'fileutils'
|
283
|
-
|
284
|
-
include GetText
|
285
|
-
GetText.bindtextdomain("rmsgfmt")
|
286
|
-
|
287
|
-
module GetText
|
288
|
-
module RMsgfmt
|
289
|
-
VERSION = GetText::VERSION
|
290
|
-
DATE = %w($Date: 2005/08/30 17:56:15 $)[1]
|
291
|
-
|
292
|
-
module_function
|
293
|
-
def run(targetfile = nil, output_path = nil)
|
294
|
-
unless targetfile
|
295
|
-
targetfile, output_path = check_options
|
296
|
-
end
|
297
|
-
unless targetfile
|
298
|
-
raise ArgumentError, _("no input files")
|
299
|
-
end
|
300
|
-
unless output_path
|
301
|
-
output_path = "messages.mo"
|
302
|
-
end
|
303
|
-
|
304
|
-
parser = PoParser.new
|
305
|
-
data = MOFile.new
|
306
|
-
parser.parse(File.open(targetfile).read, data)
|
307
|
-
data.save_to_file(output_path)
|
308
|
-
end
|
309
|
-
|
310
|
-
def check_options
|
311
|
-
output = nil
|
312
|
-
|
313
|
-
opts = OptionParser.new
|
314
|
-
opts.banner = _("Usage: %s input.po [-o output.mo]" % $0)
|
315
|
-
opts.separator("")
|
316
|
-
opts.separator(_("Generate binary message catalog from textual translation description."))
|
317
|
-
opts.separator("")
|
318
|
-
opts.separator(_("Specific options:"))
|
319
|
-
|
320
|
-
opts.on("-o", "--output=FILE", _("write output to specified file")) do |out|
|
321
|
-
output = out
|
322
|
-
end
|
323
|
-
|
324
|
-
opts.on_tail("--version", _("display version information and exit")) do
|
325
|
-
puts "#{$0} #{VERSION} (#{DATE})"
|
326
|
-
exit
|
327
|
-
end
|
328
|
-
opts.parse!(ARGV)
|
329
|
-
|
330
|
-
if ARGV.size == 0
|
331
|
-
puts opts.help
|
332
|
-
exit 1
|
333
|
-
end
|
334
|
-
|
335
|
-
[ARGV[0], output]
|
336
|
-
end
|
337
|
-
end
|
338
|
-
|
339
|
-
module_function
|
340
|
-
def rmsgfmt(targetfile = nil, output_path = nil)
|
341
|
-
RMsgfmt.run(targetfile, output_path)
|
342
|
-
end
|
343
|
-
|
344
|
-
def create_mofiles(verbose = false,
|
345
|
-
podir = "./po", targetdir = "./data/locale",
|
346
|
-
targetpath_rule = "%s/LC_MESSAGES")
|
347
|
-
|
348
|
-
modir = File.join(targetdir, targetpath_rule)
|
349
|
-
Dir.glob(File.join(podir, "*/*.po")) do |file|
|
350
|
-
lang, basename = /\/([^\/]+?)\/(.*)\.po/.match(file[podir.size..-1]).to_a[1,2]
|
351
|
-
outdir = modir % lang
|
352
|
-
FileUtils.mkdir_p(outdir) unless File.directory?(outdir)
|
353
|
-
rmsgfmt(file, File.join(outdir, "#{basename}.mo"))
|
354
|
-
if verbose
|
355
|
-
$stderr.puts %Q[#{file} -> #{File.join(outdir, "#{basename}.mo")}]
|
356
|
-
end
|
357
|
-
end
|
358
|
-
end
|
359
|
-
end
|
360
|
-
|
361
|
-
if $0 == __FILE__ then
|
362
|
-
GetText.rmsgfmt
|
363
|
-
end
|
1
|
+
=begin
|
2
|
+
rmsgfmt.rb - Generate a .mo
|
3
|
+
|
4
|
+
Copyright (C) 2003-2005 Masao Mutoh <mutoh@highway.ne.jp>
|
5
|
+
|
6
|
+
You may redistribute it and/or modify it under the same
|
7
|
+
license terms as Ruby.
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'optparse'
|
11
|
+
require 'fileutils'
|
12
|
+
require 'gettext'
|
13
|
+
require 'gettext/poparser'
|
14
|
+
|
15
|
+
module GetText
|
16
|
+
GetText.bindtextdomain("rgettext")
|
17
|
+
|
18
|
+
module RMsgfmt
|
19
|
+
extend GetText
|
20
|
+
|
21
|
+
VERSION = GetText::VERSION
|
22
|
+
DATE = %w($Date: 2005/10/22 10:49:59 $)[1]
|
23
|
+
|
24
|
+
module_function
|
25
|
+
def run(targetfile = nil, output_path = nil)
|
26
|
+
unless targetfile
|
27
|
+
targetfile, output_path = check_options
|
28
|
+
end
|
29
|
+
unless targetfile
|
30
|
+
raise ArgumentError, _("no input files")
|
31
|
+
end
|
32
|
+
unless output_path
|
33
|
+
output_path = "messages.mo"
|
34
|
+
end
|
35
|
+
|
36
|
+
parser = PoParser.new
|
37
|
+
data = MOFile.new
|
38
|
+
parser.parse(File.open(targetfile).read, data)
|
39
|
+
data.save_to_file(output_path)
|
40
|
+
end
|
41
|
+
|
42
|
+
def check_options
|
43
|
+
output = nil
|
44
|
+
|
45
|
+
opts = OptionParser.new
|
46
|
+
opts.banner = _("Usage: %s input.po [-o output.mo]" % $0)
|
47
|
+
opts.separator("")
|
48
|
+
opts.separator(_("Generate binary message catalog from textual translation description."))
|
49
|
+
opts.separator("")
|
50
|
+
opts.separator(_("Specific options:"))
|
51
|
+
|
52
|
+
opts.on("-o", "--output=FILE", _("write output to specified file")) do |out|
|
53
|
+
output = out
|
54
|
+
end
|
55
|
+
|
56
|
+
opts.on_tail("--version", _("display version information and exit")) do
|
57
|
+
puts "#{$0} #{VERSION} (#{DATE})"
|
58
|
+
exit
|
59
|
+
end
|
60
|
+
opts.parse!(ARGV)
|
61
|
+
|
62
|
+
if ARGV.size == 0
|
63
|
+
puts opts.help
|
64
|
+
exit 1
|
65
|
+
end
|
66
|
+
|
67
|
+
[ARGV[0], output]
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
module_function
|
72
|
+
def rmsgfmt(targetfile = nil, output_path = nil)
|
73
|
+
RMsgfmt.run(targetfile, output_path)
|
74
|
+
end
|
75
|
+
|
76
|
+
def create_mofiles(verbose = false,
|
77
|
+
podir = "./po", targetdir = "./data/locale",
|
78
|
+
targetpath_rule = "%s/LC_MESSAGES")
|
79
|
+
|
80
|
+
modir = File.join(targetdir, targetpath_rule)
|
81
|
+
Dir.glob(File.join(podir, "*/*.po")) do |file|
|
82
|
+
lang, basename = /\/([^\/]+?)\/(.*)\.po/.match(file[podir.size..-1]).to_a[1,2]
|
83
|
+
outdir = modir % lang
|
84
|
+
FileUtils.mkdir_p(outdir) unless File.directory?(outdir)
|
85
|
+
rmsgfmt(file, File.join(outdir, "#{basename}.mo"))
|
86
|
+
if verbose
|
87
|
+
$stderr.puts %Q[#{file} -> #{File.join(outdir, "#{basename}.mo")}]
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
if $0 == __FILE__ then
|
94
|
+
GetText.rmsgfmt
|
95
|
+
end
|