gettext 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +41 -0
- data/NEWS +6 -0
- data/README +17 -11
- data/data/locale/el/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/el/LC_MESSAGES/rgettext.mo +0 -0
- data/lib/gettext/parser/activerecord.rb +10 -9
- data/lib/gettext/parser/erb.rb +15 -2
- data/lib/gettext/parser/glade.rb +5 -2
- data/lib/gettext/poparser.rb +2 -2
- data/lib/gettext/rails.rb +24 -15
- data/lib/gettext/version.rb +2 -2
- data/po/el/rails.po +79 -0
- data/po/el/rgettext.po +98 -0
- data/po/it/messages.mo +0 -0
- data/samples/cgi/Rakefile +20 -2
- data/samples/cgi/index.cgi +1 -1
- 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/de/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/de/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/de/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/de/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/el/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/el/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/el/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/el/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/es/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/es/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/es/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/es/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/fr/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/fr/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/fr/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/fr/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/it/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/it/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/it/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/it/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/ja/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/ja/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/ja/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/ja/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 +14 -19
- data/samples/cgi/po/cs/helloerb2.po +11 -11
- data/samples/cgi/po/cs/hellolib.po +4 -4
- data/samples/cgi/po/cs/main.po +30 -23
- data/samples/cgi/po/de/helloerb1.po +18 -17
- data/samples/cgi/po/de/helloerb2.po +12 -12
- data/samples/cgi/po/de/hellolib.po +7 -6
- data/samples/cgi/po/de/main.po +35 -25
- data/samples/cgi/po/el/helloerb1.po +60 -0
- data/samples/cgi/po/el/helloerb2.po +51 -0
- data/samples/cgi/po/el/hellolib.po +23 -0
- data/samples/cgi/po/el/main.po +84 -0
- data/samples/cgi/po/es/helloerb1.po +13 -13
- data/samples/cgi/po/es/helloerb2.po +11 -11
- data/samples/cgi/po/es/hellolib.po +3 -3
- data/samples/cgi/po/es/main.po +33 -24
- data/samples/cgi/po/fr/helloerb1.po +14 -14
- data/samples/cgi/po/fr/helloerb2.po +13 -13
- data/samples/cgi/po/fr/hellolib.po +3 -3
- data/samples/cgi/po/fr/main.po +38 -28
- data/samples/cgi/po/helloerb1.pot +13 -13
- data/samples/cgi/po/helloerb2.pot +10 -10
- data/samples/cgi/po/hellolib.pot +4 -3
- data/samples/cgi/po/it/helloerb1.po +13 -14
- data/samples/cgi/po/it/helloerb2.po +9 -9
- data/samples/cgi/po/it/hellolib.po +2 -2
- data/samples/cgi/po/it/main.po +30 -22
- data/samples/cgi/po/it/messages.mo +0 -0
- data/samples/cgi/po/ja/helloerb1.po +14 -13
- data/samples/cgi/po/ja/helloerb2.po +10 -10
- data/samples/cgi/po/ja/hellolib.po +5 -4
- data/samples/cgi/po/ja/main.po +31 -22
- data/samples/cgi/po/ko/helloerb1.po +15 -13
- data/samples/cgi/po/ko/helloerb2.po +11 -11
- data/samples/cgi/po/ko/hellolib.po +5 -3
- data/samples/cgi/po/ko/main.po +33 -22
- data/samples/cgi/po/main.pot +23 -19
- data/samples/cgi/po/nl/helloerb1.po +16 -15
- data/samples/cgi/po/nl/helloerb2.po +11 -11
- data/samples/cgi/po/nl/hellolib.po +4 -4
- data/samples/cgi/po/nl/main.po +33 -23
- data/samples/cgi/po/pt_BR/helloerb1.po +13 -13
- data/samples/cgi/po/pt_BR/helloerb2.po +9 -9
- data/samples/cgi/po/pt_BR/hellolib.po +3 -2
- data/samples/cgi/po/pt_BR/main.po +30 -21
- data/samples/locale/el/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/el/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/el/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/el/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/el/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/el/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/el/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/po/el/hello.po +23 -0
- data/samples/po/el/hello2.po +31 -0
- data/samples/po/el/hello_noop.po +27 -0
- data/samples/po/el/hello_plural.po +25 -0
- data/samples/po/el/helloglade2.po +31 -0
- data/samples/po/el/hellogtk.po +22 -0
- data/samples/po/el/hellotk.po +23 -0
- data/samples/po/hello.pot +4 -2
- data/samples/po/hello2.pot +4 -2
- data/samples/po/hello_noop.pot +4 -2
- data/samples/po/hello_plural.pot +3 -3
- data/samples/po/helloglade2.pot +2 -2
- data/samples/po/hellogtk.pot +5 -2
- data/samples/po/hellotk.pot +1 -1
- data/samples/rails/README +6 -0
- data/samples/rails/app/controllers/blog_controller.rb +1 -1
- data/samples/rails/config/database.yml +5 -1
- 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/el/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/el/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/gettext_plugin.mo +0 -0
- data/samples/rails/locale/ja/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/ja/LC_MESSAGES/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 +4 -4
- data/samples/rails/po/cs/blog.po +6 -6
- data/samples/rails/po/cs/gettext_plugin.po +3 -3
- data/samples/rails/po/de/blog.po +9 -6
- data/samples/rails/po/de/gettext_plugin.po +5 -3
- data/samples/rails/po/el/blog.po +109 -0
- data/samples/rails/po/el/gettext_plugin.po +27 -0
- data/samples/rails/po/en/blog.po +4 -4
- data/samples/rails/po/es/blog.po +7 -6
- data/samples/rails/po/es/gettext_plugin.po +4 -4
- data/samples/rails/po/fr/blog.po +5 -5
- data/samples/rails/po/fr/gettext_plugin.po +3 -3
- data/samples/rails/po/gettext_plugin.pot +3 -3
- data/samples/rails/po/ja/blog.po +5 -5
- data/samples/rails/po/ja/gettext_plugin.po +3 -3
- data/samples/rails/po/ko/blog.po +9 -5
- data/samples/rails/po/ko/gettext_plugin.po +6 -4
- data/samples/rails/po/nl/blog.po +12 -15
- data/samples/rails/po/nl/gettext_plugin.po +5 -5
- data/samples/rails/po/pt_BR/blog.po +5 -5
- data/samples/rails/po/pt_BR/gettext_plugin.po +3 -3
- data/samples/rails/test/functional/blog_controller_test.rb +11 -1
- data/test/gettext_test_parser.rb +16 -0
- data/test/test_erb.rxml +16 -0
- metadata +47 -2
data/ChangeLog
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
+
2006-01-14 Masao Mutoh <mutoh@highway.ne.jp>
|
|
2
|
+
|
|
3
|
+
* samples/rails/po/*/blog.po: Updated.
|
|
4
|
+
* NEWS: Updated.
|
|
5
|
+
|
|
6
|
+
2006-01-10 Masao Mutoh <mutoh@highway.ne.jp>
|
|
7
|
+
|
|
8
|
+
* lib/gettext/parser/activerecord.rb: Fixed to fail loading YAML file.
|
|
9
|
+
By Karel Miarka.
|
|
10
|
+
|
|
11
|
+
2006-01-08 Masao Mutoh <mutoh@highway.ne.jp>
|
|
12
|
+
|
|
13
|
+
* *po/el/*.po: Convert to UTF-8. By damphyr.
|
|
14
|
+
|
|
15
|
+
2006-01-07 Masao Mutoh <mutoh@highway.ne.jp>
|
|
16
|
+
|
|
17
|
+
* test/gettext_test_parser.rb: Add test_rgettext_parse.
|
|
18
|
+
* test/test_erb.rxml: Added.
|
|
19
|
+
* lib/gettext/rails.rb: Added ActionController::TestRequest for testing.
|
|
20
|
+
Reported by Nick Snels.
|
|
21
|
+
* samples/rails/README: Added test information.
|
|
22
|
+
* samples/rails/test/functional/blog_controller_test.rb: Implemented.
|
|
23
|
+
* **/*po[t]: Revised headers.
|
|
24
|
+
* samples/po/el/*.po, samples/cgi/po/el/*.po,
|
|
25
|
+
samples/rails/po/el/*.po, po/el/rgettext.po,
|
|
26
|
+
rails.po: Added Greek locale by damphyr.
|
|
27
|
+
* README: Updated.
|
|
28
|
+
* lib/gettext/version.rb: Increment micro version.
|
|
29
|
+
|
|
30
|
+
2006-01-02 Masao Mutoh <mutoh@highway.ne.jp>
|
|
31
|
+
|
|
32
|
+
* lib/gettext/parser/activerecord.rb: Fixed to read configuration
|
|
33
|
+
correctly. Reported by Donald Piret.
|
|
34
|
+
Prevent to output duplicate msgid. Reported by Nick Snels.
|
|
35
|
+
|
|
36
|
+
2005-12-31 Masao Mutoh <mutoh@highway.ne.jp>
|
|
37
|
+
|
|
38
|
+
* lib/gettext/rails.rb: Check @@gettext_domainname is set first
|
|
39
|
+
to avoid set the wrong value to the Content-Type when init_gettext
|
|
40
|
+
is not called. Pointed out by Kazuhiro NISHIYAMA.
|
|
41
|
+
|
|
1
42
|
2005-12-29 Masao Mutoh <mutoh@highway.ne.jp>
|
|
2
43
|
|
|
3
44
|
* lib/gettext/locale_win32.rb: Fixed a syntax error.
|
data/NEWS
CHANGED
data/README
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
Ruby-Gettext-Package
|
|
2
2
|
====================
|
|
3
3
|
|
|
4
|
-
Ruby-GetText-Package is
|
|
4
|
+
Ruby-GetText-Package is a Localization(L10n) library and tools
|
|
5
5
|
which modeled after GNU gettext package.
|
|
6
6
|
|
|
7
|
+
It converts the messages to localized messages properly using
|
|
8
|
+
client-side locale information(environment variable or CGI variable).
|
|
9
|
+
|
|
7
10
|
Features:
|
|
8
11
|
|
|
9
12
|
* Simple APIs(similar GNU gettext)
|
|
@@ -12,6 +15,7 @@ Ruby-Gettext-Package
|
|
|
12
15
|
* ruby scripts
|
|
13
16
|
* glade-2 XML file(.glade)
|
|
14
17
|
* ERB file(.rhtml)
|
|
18
|
+
* ActiveRecord(.rb)
|
|
15
19
|
The po-file is compatible to GNU gettext.
|
|
16
20
|
|
|
17
21
|
* rmsgfmt creates a mo-file from a po-file.
|
|
@@ -72,7 +76,7 @@ License
|
|
|
72
76
|
(See the file 'COPYING'.)
|
|
73
77
|
|
|
74
78
|
* Ruby-GetText-Package
|
|
75
|
-
Copyright (C) 2001-
|
|
79
|
+
Copyright (C) 2001-2006 Masao Mutoh <mutoh@highwhay.ne.jp>
|
|
76
80
|
|
|
77
81
|
* mo.rb
|
|
78
82
|
Copyright (C) 2001-2004 Masao Mutoh <mutoh@highwhay.ne.jp>
|
|
@@ -94,7 +98,7 @@ License
|
|
|
94
98
|
This file is released under LGPL. See the top of the install.rb.
|
|
95
99
|
|
|
96
100
|
* Others
|
|
97
|
-
Copyright (C) 2001-
|
|
101
|
+
Copyright (C) 2001-2006 Masao Mutoh <mutoh@highwhay.ne.jp>
|
|
98
102
|
|
|
99
103
|
|
|
100
104
|
Translators
|
|
@@ -105,6 +109,7 @@ French - Laurent Sansonetti <laurent.sansonetti at gmail.com>
|
|
|
105
109
|
German - Detlef Reichl <detlef.reichl at gmx.org>
|
|
106
110
|
Sven Herzberg <herzi at abi02.de>
|
|
107
111
|
Sascha Ebach <se at digitale-wertschoepfung.de>
|
|
112
|
+
Greek - Damphyr <damphyr at gmx.net>
|
|
108
113
|
Italian - Gabriele Renzi <surrender_it at yahoo.it>
|
|
109
114
|
Japanese - Masao Mutoh <mutoh at highway.ne.jp>
|
|
110
115
|
Korean - Gyoung-Yoon Noh <nohmad at gmail.com>
|
|
@@ -115,15 +120,16 @@ Swedish - Nikolai Weibull <mailing-lists.ruby-talk at rawuncut.elitem
|
|
|
115
120
|
|
|
116
121
|
Status of translations
|
|
117
122
|
----------------------
|
|
118
|
-
cs - 1.1.
|
|
119
|
-
fr - 1.1.
|
|
120
|
-
de - 1.1.
|
|
121
|
-
|
|
123
|
+
cs - 1.1.1
|
|
124
|
+
fr - 1.1.1
|
|
125
|
+
de - 1.1.1
|
|
126
|
+
el - 1.1.1
|
|
127
|
+
es - 1.1.1
|
|
122
128
|
it - 1.0.0
|
|
123
|
-
ja - 1.1.
|
|
124
|
-
ko - 1.1.
|
|
125
|
-
nl - 1.1.
|
|
126
|
-
pt_BR - 1.1.
|
|
129
|
+
ja - 1.1.1
|
|
130
|
+
ko - 1.1.1
|
|
131
|
+
nl - 1.1.1
|
|
132
|
+
pt_BR - 1.1.1
|
|
127
133
|
sv - 0.8.0
|
|
128
134
|
|
|
129
135
|
Maintainer
|
|
Binary file
|
|
Binary file
|
|
@@ -7,12 +7,14 @@
|
|
|
7
7
|
You may redistribute it and/or modify it under the same
|
|
8
8
|
license terms as Ruby.
|
|
9
9
|
|
|
10
|
-
$Id: activerecord.rb,v 1.
|
|
10
|
+
$Id: activerecord.rb,v 1.5 2006/01/14 13:48:23 mutoh Exp $
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
13
|
require 'gettext'
|
|
14
14
|
require 'gettext/parser/ruby'
|
|
15
15
|
|
|
16
|
+
include GetText
|
|
17
|
+
|
|
16
18
|
module GetText
|
|
17
19
|
module ActiveRecordParser
|
|
18
20
|
extend GetText
|
|
@@ -47,8 +49,6 @@ module GetText
|
|
|
47
49
|
end
|
|
48
50
|
|
|
49
51
|
def parse(file, targets = [])
|
|
50
|
-
ActiveRecord::Base.establish_connection(@db)
|
|
51
|
-
|
|
52
52
|
old_constants = constants
|
|
53
53
|
begin
|
|
54
54
|
eval(open(file).read)
|
|
@@ -60,8 +60,8 @@ module GetText
|
|
|
60
60
|
loaded_constants.each do |classname|
|
|
61
61
|
klass = eval(classname)
|
|
62
62
|
if klass < ActiveRecord::Base
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
targets << [::Inflector.singularize(klass.table_name.gsub(/_/, " ")), "#{file}:-"]
|
|
64
|
+
tablename = klass.class_name
|
|
65
65
|
begin
|
|
66
66
|
klass.columns.each do |column|
|
|
67
67
|
if @config[:use_classname]
|
|
@@ -77,8 +77,10 @@ module GetText
|
|
|
77
77
|
end
|
|
78
78
|
end
|
|
79
79
|
if RubyParser.target?(file)
|
|
80
|
-
RubyParser.parse(file, targets)
|
|
80
|
+
targets = RubyParser.parse(file, targets)
|
|
81
81
|
end
|
|
82
|
+
targets.uniq!
|
|
83
|
+
targets
|
|
82
84
|
end
|
|
83
85
|
|
|
84
86
|
def target?(file)
|
|
@@ -89,9 +91,8 @@ module GetText
|
|
|
89
91
|
unless @db
|
|
90
92
|
require 'rubygems'
|
|
91
93
|
require 'active_record'
|
|
92
|
-
yml = YAML.
|
|
93
|
-
|
|
94
|
-
@db = yml["production"] unless @db
|
|
94
|
+
yml = YAML.load(ERB.new(IO.read(@config[:db_yml])).result)
|
|
95
|
+
ENV["RAILS_ENV"] = @config[:db_mode]
|
|
95
96
|
require_rails 'config/boot.rb'
|
|
96
97
|
require_rails 'config/environment.rb'
|
|
97
98
|
require_rails 'app/controllers/application.rb'
|
data/lib/gettext/parser/erb.rb
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
You may redistribute it and/or modify it under the same
|
|
7
7
|
license terms as Ruby.
|
|
8
8
|
|
|
9
|
-
$Id: erb.rb,v 1.
|
|
9
|
+
$Id: erb.rb,v 1.3 2006/01/07 13:39:13 mutoh Exp $
|
|
10
10
|
=end
|
|
11
11
|
|
|
12
12
|
require 'erb'
|
|
@@ -14,14 +14,27 @@ require 'gettext/parser/ruby.rb'
|
|
|
14
14
|
|
|
15
15
|
module GetText
|
|
16
16
|
module ErbParser
|
|
17
|
+
@config = {
|
|
18
|
+
:extnames => ['.rhtml']
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
module_function
|
|
22
|
+
def init(config)
|
|
23
|
+
config.each{|k, v|
|
|
24
|
+
@config[k] = v
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
18
28
|
def parse(file, targets = [])
|
|
19
29
|
erb = ERB.new(IO.readlines(file).join).src.split(/$/)
|
|
20
30
|
RubyParser.parse_lines(file, erb, targets)
|
|
21
31
|
end
|
|
22
32
|
|
|
23
33
|
def target?(file)
|
|
24
|
-
|
|
34
|
+
@config[:extnames].each do |v|
|
|
35
|
+
return true if File.extname(file) == v
|
|
36
|
+
end
|
|
37
|
+
false
|
|
25
38
|
end
|
|
26
39
|
end
|
|
27
40
|
end
|
data/lib/gettext/parser/glade.rb
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
You may redistribute it and/or modify it under the same
|
|
7
7
|
license terms as Ruby.
|
|
8
8
|
|
|
9
|
-
$Id: glade.rb,v 1.
|
|
9
|
+
$Id: glade.rb,v 1.3 2006/01/07 13:39:13 mutoh Exp $
|
|
10
10
|
=end
|
|
11
11
|
|
|
12
12
|
require 'cgi'
|
|
@@ -71,7 +71,10 @@ module GetText
|
|
|
71
71
|
if GLADE_RE =~ data[1]
|
|
72
72
|
return true
|
|
73
73
|
else
|
|
74
|
-
|
|
74
|
+
if File.extname(file) == '.glade'
|
|
75
|
+
raise _("%s is not glade-2.0 format.") % [file]
|
|
76
|
+
end
|
|
77
|
+
return false
|
|
75
78
|
end
|
|
76
79
|
else
|
|
77
80
|
return false
|
data/lib/gettext/poparser.rb
CHANGED
|
@@ -20,7 +20,7 @@ module GetText
|
|
|
20
20
|
|
|
21
21
|
class PoParser < Racc::Parser
|
|
22
22
|
|
|
23
|
-
module_eval <<'..end src/poparser.ry modeval..
|
|
23
|
+
module_eval <<'..end src/poparser.ry modeval..id827ea1cb71', 'src/poparser.ry', 90
|
|
24
24
|
include GetText
|
|
25
25
|
GetText.bindtextdomain("rgettext")
|
|
26
26
|
|
|
@@ -102,7 +102,7 @@ module_eval <<'..end src/poparser.ry modeval..id9163dcbd5f', 'src/poparser.ry',
|
|
|
102
102
|
@comments << comment
|
|
103
103
|
end
|
|
104
104
|
|
|
105
|
-
..end src/poparser.ry modeval..
|
|
105
|
+
..end src/poparser.ry modeval..id827ea1cb71
|
|
106
106
|
|
|
107
107
|
##### racc 1.4.4 generates ###
|
|
108
108
|
|
data/lib/gettext/rails.rb
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
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.12 2006/01/14 13:48:22 mutoh Exp $
|
|
10
10
|
=end
|
|
11
11
|
|
|
12
12
|
require 'gettext'
|
|
@@ -33,19 +33,13 @@ module GetText
|
|
|
33
33
|
|
|
34
34
|
def bindtextdomain_to(klass, domainname)
|
|
35
35
|
klass.class_eval {
|
|
36
|
-
include GetText::Rails
|
|
37
|
-
extend GetText::Rails
|
|
38
36
|
textdomain(domainname)
|
|
39
37
|
|
|
40
38
|
def self.human_attribute_name(attribute_key_name)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
else
|
|
46
|
-
ret = s_("#{self}|#{attribute_key_name.humanize}")
|
|
47
|
-
end
|
|
48
|
-
ret
|
|
39
|
+
s_("#{self}|#{attribute_key_name.humanize}")
|
|
40
|
+
end
|
|
41
|
+
def self.human_attribute_table_name_for_error(table_name)
|
|
42
|
+
_(table_name.gsub(/_/, " "))
|
|
49
43
|
end
|
|
50
44
|
}
|
|
51
45
|
end
|
|
@@ -57,6 +51,7 @@ module GetText
|
|
|
57
51
|
end
|
|
58
52
|
end
|
|
59
53
|
|
|
54
|
+
|
|
60
55
|
module ActionController
|
|
61
56
|
class Base
|
|
62
57
|
helper GetText::Rails
|
|
@@ -74,7 +69,7 @@ module ActionController
|
|
|
74
69
|
end
|
|
75
70
|
|
|
76
71
|
def init_gettext
|
|
77
|
-
init_gettext_main
|
|
72
|
+
init_gettext_main if @@gettext_domainname
|
|
78
73
|
ActiveRecord::Errors.class_eval{
|
|
79
74
|
# You need to call bindtextdomain here because ActiveRecord::Errors doesn't know
|
|
80
75
|
# what locale is used in.
|
|
@@ -88,9 +83,22 @@ module ActionController
|
|
|
88
83
|
@@gettext_content_type = content_type
|
|
89
84
|
end
|
|
90
85
|
end
|
|
86
|
+
|
|
87
|
+
class TestRequest < AbstractRequest
|
|
88
|
+
@cgi = nil
|
|
89
|
+
def cgi
|
|
90
|
+
@cgi = CGI.new unless @cgi
|
|
91
|
+
@cgi
|
|
92
|
+
end
|
|
93
|
+
end
|
|
91
94
|
end
|
|
92
95
|
|
|
93
96
|
module ActiveRecord
|
|
97
|
+
class Base
|
|
98
|
+
include GetText::Rails
|
|
99
|
+
extend GetText::Rails
|
|
100
|
+
end
|
|
101
|
+
|
|
94
102
|
class Errors
|
|
95
103
|
include GetText
|
|
96
104
|
extend GetText
|
|
@@ -164,13 +172,14 @@ module ActionView
|
|
|
164
172
|
include GetText
|
|
165
173
|
extend GetText
|
|
166
174
|
module_function
|
|
167
|
-
def error_messages_for(object, klass, options = {})
|
|
175
|
+
def error_messages_for(object, object_name, klass, options = {})
|
|
168
176
|
textdomain("rails")
|
|
177
|
+
|
|
169
178
|
options = options.symbolize_keys
|
|
170
179
|
|
|
171
180
|
unless object.errors.empty?
|
|
172
181
|
count = object.errors.count
|
|
173
|
-
record = ActiveRecord::Base.
|
|
182
|
+
record = ActiveRecord::Base.human_attribute_table_name_for_error(object_name)
|
|
174
183
|
klass.content_tag("div",
|
|
175
184
|
klass.content_tag(
|
|
176
185
|
options[:header_tag] || "h2",
|
|
@@ -187,7 +196,7 @@ module ActionView
|
|
|
187
196
|
end
|
|
188
197
|
def error_messages_for(object_name, options = {})
|
|
189
198
|
object = instance_variable_get("@#{object_name}")
|
|
190
|
-
L10n.error_messages_for(object, self, options)
|
|
199
|
+
L10n.error_messages_for(object, object_name, self, options)
|
|
191
200
|
end
|
|
192
201
|
end
|
|
193
202
|
end
|
data/lib/gettext/version.rb
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
=begin
|
|
3
3
|
version - version information of Ruby-GetText-Package
|
|
4
4
|
|
|
5
|
-
Copyright (C) 2005 Masao Mutoh
|
|
5
|
+
Copyright (C) 2005,2006 Masao Mutoh
|
|
6
6
|
|
|
7
7
|
You may redistribute it and/or modify it under the same
|
|
8
8
|
license terms as Ruby.
|
|
9
9
|
=end
|
|
10
10
|
module GetText
|
|
11
|
-
VERSION = "1.1.
|
|
11
|
+
VERSION = "1.1.1"
|
|
12
12
|
end
|
data/po/el/rails.po
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# a po-file for Ruby-GetText-Package and Ruby on Rails.
|
|
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
|
+
# damphyr <damphyr@gmx.net>, 2006.
|
|
8
|
+
#
|
|
9
|
+
msgid ""
|
|
10
|
+
msgstr ""
|
|
11
|
+
"Project-Id-Version: ruby-gettext 1.1.1\n"
|
|
12
|
+
"POT-Creation-Date: 2005-12-17 14:56+0900\n"
|
|
13
|
+
"PO-Revision-Date: 2006-01-06 19:50+0100\n"
|
|
14
|
+
"Last-Translator: damphyr <damphyr@gmx.net>\n"
|
|
15
|
+
"Language-Team: Greek\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
|
+
#: lib/gettext/rails.rb:100
|
|
22
|
+
msgid "%{fn} is not included in the list"
|
|
23
|
+
msgstr "το %{fn} δεν περιλαμβάνεται στη λίστα"
|
|
24
|
+
|
|
25
|
+
#: lib/gettext/rails.rb:101
|
|
26
|
+
msgid "%{fn} is reserved"
|
|
27
|
+
msgstr "το %{fn} είναι κατειλημένο"
|
|
28
|
+
|
|
29
|
+
#: lib/gettext/rails.rb:102
|
|
30
|
+
msgid "%{fn} is invalid"
|
|
31
|
+
msgstr "το %{fn} είναι άκυρο"
|
|
32
|
+
|
|
33
|
+
#: lib/gettext/rails.rb:103
|
|
34
|
+
msgid "%{fn} doesn't match confirmation"
|
|
35
|
+
msgstr "το %{fn} δεν ταιριάζει με την επιβεβαίωση του"
|
|
36
|
+
|
|
37
|
+
#: lib/gettext/rails.rb:104
|
|
38
|
+
msgid "%{fn} must be accepted"
|
|
39
|
+
msgstr "το %{fn} πρέπει να γίνει δεκτό"
|
|
40
|
+
|
|
41
|
+
#: lib/gettext/rails.rb:105
|
|
42
|
+
msgid "%{fn} can't be empty"
|
|
43
|
+
msgstr "το %{fn} δεν γίνεται να είναι κενό"
|
|
44
|
+
|
|
45
|
+
#: lib/gettext/rails.rb:106
|
|
46
|
+
msgid "%{fn} can't be blank"
|
|
47
|
+
msgstr "το %{fn} δεν γίνεται να είναι κενό"
|
|
48
|
+
|
|
49
|
+
#: lib/gettext/rails.rb:107
|
|
50
|
+
msgid "%{fn} is too long (max is %d characters)"
|
|
51
|
+
msgstr "το %{fn} είναι πολύ μακρύ (το μέγιστο είναι %d χαρακτήρες)"
|
|
52
|
+
|
|
53
|
+
#: lib/gettext/rails.rb:108
|
|
54
|
+
msgid "%{fn} is too short (min is %d characters)"
|
|
55
|
+
msgstr "το %{fn} είναι πολύ μικρό (το ελάχιστο είναι %d χαρακτήρες)"
|
|
56
|
+
|
|
57
|
+
#: lib/gettext/rails.rb:109
|
|
58
|
+
msgid "%{fn} is the wrong length (should be %d characters)"
|
|
59
|
+
msgstr "το %{fn} έχει λάθος μήκος (πρέπει να είναι %d χαρακτήρες)"
|
|
60
|
+
|
|
61
|
+
#: lib/gettext/rails.rb:110
|
|
62
|
+
msgid "%{fn} has already been taken"
|
|
63
|
+
msgstr "το %{fn} είναι ήδη κατειλημένο"
|
|
64
|
+
|
|
65
|
+
#: lib/gettext/rails.rb:111
|
|
66
|
+
msgid "%{fn} is not a number"
|
|
67
|
+
msgstr "το %{fn} δεν είναι αριθμός"
|
|
68
|
+
|
|
69
|
+
#: lib/gettext/rails.rb:176
|
|
70
|
+
msgid "%{num} error prohibited this %{record} from being saved"
|
|
71
|
+
msgid_plural "%{num} errors prohibited this %{record} from being saved"
|
|
72
|
+
msgstr[0] "%{num} λάθος απέτρεψε την αποθήκευση της εγγραφής %{record}"
|
|
73
|
+
msgstr[1] "%{num} λάθη απέτρεψαν την αποθήκευση της εγγραφής %{record}"
|
|
74
|
+
|
|
75
|
+
#: lib/gettext/rails.rb:179
|
|
76
|
+
msgid "There were problems with the following field:"
|
|
77
|
+
msgid_plural "There were problems with the following fields:"
|
|
78
|
+
msgstr[0] "Υπάρχουν προβλήματα στο παρακάτω πεδίο:"
|
|
79
|
+
msgstr[1] "Υπάρχουν προβλήματα στα παρακάτω πεδία:"
|