experteer-gettext 2.0.4.1 → 2.0.4.2
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/Rakefile +80 -79
- data/VERSION +1 -1
- data/lib/gettext/core_ext/string.rb +2 -2
- data/lib/gettext/parser/ruby.rb +37 -60
- data/lib/gettext/poparser.rb +121 -126
- data/lib/gettext/textdomain_manager.rb +1 -1
- data/lib/gettext/tools/rgettext.rb +53 -18
- data/lib/gettext/version.rb +1 -1
- data/po/bg/rgettext.po +56 -56
- data/po/bs/rgettext.po +56 -56
- data/po/ca/rgettext.po +57 -56
- data/po/cs/rgettext.po +61 -60
- data/po/de/rgettext.po +56 -56
- data/po/el/rgettext.po +55 -54
- data/po/eo/rgettext.po +56 -56
- data/po/es/rgettext.po +55 -55
- data/po/et/rgettext.po +55 -54
- data/po/fr/rgettext.po +58 -57
- data/po/hr/rgettext.po +56 -56
- data/po/hu/rgettext.po +57 -56
- data/po/it/rgettext.po +58 -58
- data/po/ja/rgettext.po +57 -56
- data/po/ko/rgettext.po +62 -61
- data/po/lv/rgettext.po +57 -56
- data/po/nb/rgettext.po +57 -56
- data/po/nl/rgettext.po +61 -61
- data/po/pt_BR/rgettext.po +57 -56
- data/po/rgettext.pot +45 -45
- data/po/ru/rgettext.po +57 -56
- data/po/sr/rgettext.po +56 -56
- data/po/sv/rgettext.po +53 -53
- data/po/ua/rgettext.po +57 -56
- data/po/vi/rgettext.po +55 -55
- data/po/zh/rgettext.po +55 -54
- data/po/zh_TW/rgettext.po +55 -54
- data/samples/cgi/po/bg/main.po +1 -1
- data/test/test_gettext.rb +0 -1
- data/test/test_parser.rb +72 -116
- data/test/test_string.rb +0 -8
- data/test/testlib/gettext.rb +0 -17
- data/test/testlib/ngettext.rb +1 -6
- data/test/testlib/pgettext.rb +0 -5
- metadata +2 -66
- data/gettext.gemspec +0 -493
- data/lib/gettext/translation_target.rb +0 -93
- data/test/README +0 -1
- data/test/Rakefile +0 -17
- data/test/po/cr/plural.po +0 -23
- data/test/po/da/plural.po +0 -22
- data/test/po/da/plural_error.po +0 -22
- data/test/po/fr/plural.po +0 -28
- data/test/po/fr/plural_error.po +0 -20
- data/test/po/fr/test1.po +0 -23
- data/test/po/fr/test2.po +0 -19
- data/test/po/ir/plural.po +0 -23
- data/test/po/ja/npgettext.po +0 -46
- data/test/po/ja/nsgettext.po +0 -65
- data/test/po/ja/pgettext.po +0 -41
- data/test/po/ja/plural.po +0 -28
- data/test/po/ja/plural_error.po +0 -20
- data/test/po/ja/rubyparser.po +0 -43
- data/test/po/ja/sgettext.po +0 -47
- data/test/po/ja/test1.po +0 -23
- data/test/po/ja/test2.po +0 -19
- data/test/po/ja/test3.po +0 -19
- data/test/po/la/plural.po +0 -23
- data/test/po/la/plural_error.po +0 -21
- data/test/po/li/plural.po +0 -23
- data/test/po/li/plural_error.po +0 -27
- data/test/po/po/plural.po +0 -23
- data/test/po/sl/plural.po +0 -24
- data/test/test_po_generation.rb +0 -20
- data/test/test_translation_target.rb +0 -29
- data/test/testlib/erb.rhtml +0 -15
- data/test/testlib/erb.rxml +0 -16
- data/test/testlib/gladeparser.glade +0 -183
- data/test/tools/files/app.pot +0 -0
- data/test/tools/files/de/app.po +0 -0
- data/test/tools/files/en/app.po +0 -0
- data/test/tools/files/en/test.po +0 -21
- data/test/tools/files/simple_1.po +0 -2
- data/test/tools/files/simple_2.po +0 -2
- data/test/tools/files/version.po +0 -7
- data/test/tools/test.pot +0 -21
data/Rakefile
CHANGED
@@ -28,13 +28,12 @@ PKG_VERSION = GetText::VERSION
|
|
28
28
|
desc "Create lib/gettext/poparser.rb"
|
29
29
|
task :poparser do
|
30
30
|
poparser_path = "lib/gettext/poparser.rb"
|
31
|
-
racc="racc"
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
#
|
37
|
-
system(racc,"-g","src/poparser.ry","-o","src/poparser.tmp.rb")
|
31
|
+
racc = File.join(Config::CONFIG['bindir'], "racc")
|
32
|
+
if ! FileTest.exist?(racc)
|
33
|
+
puts "racc was not found: #{racc}"
|
34
|
+
exit 1
|
35
|
+
else FileTest.exist?(racc)
|
36
|
+
ruby "#{racc} -g src/poparser.ry -o src/poparser.tmp.rb"
|
38
37
|
$stderr.puts %Q[ruby #{racc} -g src/poparser.ry -o src/poparser.tmp.rb]
|
39
38
|
|
40
39
|
file = open(poparser_path, "w")
|
@@ -47,7 +46,7 @@ task :poparser do
|
|
47
46
|
|
48
47
|
You may redistribute it and/or modify it under the same
|
49
48
|
license terms as Ruby.
|
50
|
-
EOS
|
49
|
+
EOS
|
51
50
|
file.print "=end\n\n"
|
52
51
|
|
53
52
|
tmpfile = open("src/poparser.tmp.rb")
|
@@ -56,7 +55,7 @@ EOS
|
|
56
55
|
tmpfile.close
|
57
56
|
File.delete("src/poparser.tmp.rb")
|
58
57
|
$stderr.puts "Create #{poparser_path}."
|
59
|
-
|
58
|
+
end
|
60
59
|
end
|
61
60
|
|
62
61
|
|
@@ -67,15 +66,15 @@ task :makemo do
|
|
67
66
|
|
68
67
|
$stderr.puts "Create samples mo files."
|
69
68
|
GetText.create_mofiles(
|
70
|
-
|
69
|
+
:po_root => "samples/po", :mo_root => "samples/locale")
|
71
70
|
|
72
71
|
$stderr.puts "Create samples/cgi mo files."
|
73
72
|
GetText.create_mofiles(
|
74
|
-
|
73
|
+
:po_root => "samples/cgi/po", :mo_root => "samples/cgi/locale")
|
75
74
|
|
76
75
|
$stderr.puts "Create test mo files."
|
77
76
|
GetText.create_mofiles(
|
78
|
-
|
77
|
+
:po_root => "test/po", :mo_root => "test/locale")
|
79
78
|
end
|
80
79
|
|
81
80
|
desc "Update pot/po files to match new version."
|
@@ -90,8 +89,8 @@ task :updatepo do
|
|
90
89
|
|
91
90
|
#lib/gettext/*.rb -> rgettext.po
|
92
91
|
GetText.update_pofiles("rgettext",
|
93
|
-
|
94
|
-
|
92
|
+
Dir.glob("lib/**/*.rb") + ["src/poparser.ry"],
|
93
|
+
"ruby-gettext #{GetText::VERSION}")
|
95
94
|
end
|
96
95
|
|
97
96
|
desc "Gather the newest po files. (for me)"
|
@@ -116,39 +115,39 @@ task :gatherpo => [:updatepo] do
|
|
116
115
|
end
|
117
116
|
|
118
117
|
def mv_pofiles(src_dir, target_dir, lang)
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
118
|
+
target = File.join(target_dir, lang)
|
119
|
+
unless File.exist?(target)
|
120
|
+
mkdir_p target
|
121
|
+
sh "cvs add #{target}"
|
122
|
+
end
|
123
|
+
cvs_add_targets = ""
|
124
|
+
Dir.glob(File.join(target_dir, "ja/*.po")).sort.each do |f|
|
125
|
+
srcfile = File.join(src_dir, File.basename(f))
|
126
|
+
if File.exist?(srcfile)
|
127
|
+
unless File.exist?(File.join(target, File.basename(f)))
|
128
|
+
cvs_add_targets << File.join(target, File.basename(f)) + " "
|
129
|
+
end
|
130
|
+
mv srcfile, target, :verbose => true
|
131
|
+
else
|
132
|
+
puts "mv #{srcfile} #{target}/ -- skipped"
|
133
|
+
end
|
134
|
+
end
|
135
|
+
sh "cvs add #{cvs_add_targets}" if cvs_add_targets.size > 0
|
137
136
|
end
|
138
137
|
|
139
138
|
desc "Deploy localized pofiles to current source tree. (for me)"
|
140
139
|
task :deploypo do
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
140
|
+
srcdir = ENV["SRCDIR"] ||= File.join(ENV["HOME"], "pofiles")
|
141
|
+
lang = ENV["LOCALE"]
|
142
|
+
unless lang
|
143
|
+
puts "USAGE: rake deploypo [SRCDIR=#{ENV["HOME"]}/pofiles] LOCALE=ja"
|
144
|
+
exit
|
145
|
+
end
|
146
|
+
puts "SRCDIR = #{srcdir}, LOCALE = #{lang}"
|
148
147
|
|
149
|
-
|
150
|
-
|
151
|
-
|
148
|
+
mv_pofiles(srcdir, "po", lang)
|
149
|
+
mv_pofiles(srcdir, "samples/cgi/po", lang)
|
150
|
+
mv_pofiles(srcdir, "samples/po", lang)
|
152
151
|
end
|
153
152
|
|
154
153
|
############################################################
|
@@ -188,45 +187,18 @@ Rake::GemPackageTask.new(spec) do |p|
|
|
188
187
|
p.need_zip = false
|
189
188
|
end
|
190
189
|
|
191
|
-
task :package => [:makemo]
|
192
|
-
|
193
|
-
begin
|
194
|
-
require 'jeweler'
|
195
|
-
Jeweler::Tasks.new do |s|
|
196
|
-
s.name = 'gettext'
|
197
|
-
s.version = PKG_VERSION
|
198
|
-
s.summary = 'Ruby-GetText-Package is a library and tools to localize messages.'
|
199
|
-
s.author = 'Masao Mutoh'
|
200
|
-
s.email = 'mutomasa at gmail.com'
|
201
|
-
s.homepage = 'http://gettext.rubyforge.org/'
|
202
|
-
s.rubyforge_project = "gettext"
|
203
|
-
s.files = FileList['**/*'].to_a.select{|v| v !~ /pkg|CVS|^doc|^data|^src|^tmp.pot$|^test\/locale|^samples\/cgi\/locale|^samples\/locale|.gem$/}
|
204
|
-
s.require_path = 'lib'
|
205
|
-
s.executables = Dir.entries('bin').delete_if {|item| /^\.|CVS|~$/ =~ item }
|
206
|
-
s.bindir = 'bin'
|
207
|
-
s.add_dependency('locale', '>= 2.0.4')
|
208
|
-
s.has_rdoc = true
|
209
|
-
s.description = <<-EOF
|
210
|
-
Ruby-GetText-Package is a GNU GetText-like program for Ruby.
|
211
|
-
The catalog file(po-file) is same format with GNU GetText.
|
212
|
-
So you can use GNU GetText tools for maintaining.
|
213
|
-
EOF
|
214
|
-
end
|
215
|
-
rescue LoadError
|
216
|
-
puts "Jeweler not available."
|
217
|
-
end
|
218
190
|
############################################################
|
219
191
|
# Misc tasks
|
220
192
|
############################################################
|
221
193
|
desc 'Run all tests'
|
222
194
|
task :test do
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
195
|
+
Dir.chdir("test") do
|
196
|
+
if RUBY_PLATFORM =~ /win32/
|
197
|
+
sh "rake.bat", "test"
|
198
|
+
else
|
199
|
+
sh "rake", "test"
|
200
|
+
end
|
201
|
+
end
|
230
202
|
end
|
231
203
|
|
232
204
|
Rake::RDocTask.new { |rdoc|
|
@@ -251,10 +223,39 @@ task :release => [ :package ] do
|
|
251
223
|
rubyforge.configure
|
252
224
|
rubyforge.login
|
253
225
|
rubyforge.add_release("gettext", "gettext",
|
254
|
-
|
255
|
-
|
256
|
-
|
226
|
+
"Ruby-GetText-Package #{PKG_VERSION}",
|
227
|
+
"pkg/gettext-#{PKG_VERSION}.gem",
|
228
|
+
"pkg/ruby-gettext-package-#{PKG_VERSION}.tar.gz")
|
257
229
|
end
|
258
230
|
|
259
231
|
desc "Setup Ruby-GetText-Package. (for setup.rb)"
|
260
232
|
task :setup => [:makemo]
|
233
|
+
|
234
|
+
|
235
|
+
begin
|
236
|
+
require 'jeweler'
|
237
|
+
ignore=/pkg|CVS|^doc|^data|^src|^tmp.pot$|^test|^samples\/cgi\/locale|^samples\/locale|.gem|^nbproject$/
|
238
|
+
Jeweler::Tasks.new do |s|
|
239
|
+
s.name = 'gettext'
|
240
|
+
s.version = PKG_VERSION
|
241
|
+
s.summary = 'Ruby-GetText-Package is a library and tools to localize messages.'
|
242
|
+
s.author = 'Masao Mutoh'
|
243
|
+
s.email = 'mutomasa at gmail.com'
|
244
|
+
s.homepage = 'http://gettext.rubyforge.org/'
|
245
|
+
s.rubyforge_project = "gettext"
|
246
|
+
s.files = FileList['**/*'].to_a.select{|v| v !~ ignore }
|
247
|
+
s.require_path = 'lib'
|
248
|
+
s.executables = Dir.entries('bin').delete_if {|item| /^\.|CVS|~$/ =~ item }
|
249
|
+
s.bindir = 'bin'
|
250
|
+
s.add_dependency('locale', '>= 2.0.4')
|
251
|
+
s.has_rdoc = true
|
252
|
+
s.description = <<-EOF
|
253
|
+
Ruby-GetText-Package is a GNU GetText-like program for Ruby.
|
254
|
+
The catalog file(po-file) is same format with GNU GetText.
|
255
|
+
So you can use GNU GetText tools for maintaining.
|
256
|
+
EOF
|
257
|
+
end
|
258
|
+
rescue LoadError
|
259
|
+
puts "Jeweler not available."
|
260
|
+
end
|
261
|
+
|
data/VERSION
CHANGED
data/lib/gettext/parser/ruby.rb
CHANGED
@@ -14,7 +14,6 @@
|
|
14
14
|
|
15
15
|
require 'irb/ruby-lex.rb'
|
16
16
|
require 'stringio'
|
17
|
-
require 'gettext/translation_target.rb'
|
18
17
|
|
19
18
|
class RubyLexX < RubyLex # :nodoc: all
|
20
19
|
# Parser#parse resemlbes RubyLex#lex
|
@@ -58,25 +57,6 @@ class RubyLexX < RubyLex # :nodoc: all
|
|
58
57
|
return nil
|
59
58
|
end
|
60
59
|
|
61
|
-
# Original parser does not keep the content of the comments,
|
62
|
-
# so monkey patching this with new token type and extended
|
63
|
-
# identify_comment implementation
|
64
|
-
RubyToken.def_token :TkCOMMENT_WITH_CONTENT, TkVal
|
65
|
-
|
66
|
-
def identify_comment
|
67
|
-
@ltype = "#"
|
68
|
-
get_readed # skip the hash sign itself
|
69
|
-
|
70
|
-
while ch = getc
|
71
|
-
if ch == "\n"
|
72
|
-
@ltype = nil
|
73
|
-
ungetc
|
74
|
-
break
|
75
|
-
end
|
76
|
-
end
|
77
|
-
return Token(TkCOMMENT_WITH_CONTENT, get_readed)
|
78
|
-
end
|
79
|
-
|
80
60
|
end
|
81
61
|
|
82
62
|
module GetText
|
@@ -101,73 +81,70 @@ module GetText
|
|
101
81
|
#rl.readed_auto_clean_up = true
|
102
82
|
|
103
83
|
target = nil
|
84
|
+
msgid = nil
|
104
85
|
line_no = nil
|
105
|
-
last_extracted_comment = ''
|
106
|
-
reset_extracted_comment = false
|
107
86
|
rl.parse do |tk|
|
108
87
|
begin
|
109
88
|
case tk
|
110
89
|
when RubyToken::TkIDENTIFIER, RubyToken::TkCONSTANT
|
111
90
|
if ID.include?(tk.name)
|
112
|
-
target =
|
91
|
+
target = :normal
|
113
92
|
elsif PLURAL_ID.include?(tk.name)
|
114
|
-
target =
|
93
|
+
target = :plural
|
115
94
|
elsif MSGCTXT_ID.include?(tk.name)
|
116
|
-
target =
|
95
|
+
target = :msgctxt
|
117
96
|
elsif MSGCTXT_PLURAL_ID.include?(tk.name)
|
118
|
-
target =
|
97
|
+
target = :msgctxt_plural
|
119
98
|
else
|
120
99
|
target = nil
|
121
100
|
end
|
122
101
|
line_no = tk.line_no.to_s
|
123
102
|
when RubyToken::TkSTRING
|
124
|
-
|
103
|
+
if target
|
104
|
+
if msgid
|
105
|
+
msgid += tk.value
|
106
|
+
else
|
107
|
+
msgid = tk.value
|
108
|
+
end
|
109
|
+
end
|
125
110
|
when RubyToken::TkPLUS, RubyToken::TkNL
|
126
111
|
#do nothing
|
127
112
|
when RubyToken::TkCOMMA
|
128
|
-
|
113
|
+
if msgid
|
114
|
+
case target
|
115
|
+
when :plural
|
116
|
+
msgid += "\000"
|
117
|
+
target = :normal
|
118
|
+
when :msgctxt
|
119
|
+
msgid += "\004"
|
120
|
+
target = :normal
|
121
|
+
when :msgctxt_plural
|
122
|
+
msgid += "\004"
|
123
|
+
target = :plural
|
124
|
+
else
|
125
|
+
target = :normal
|
126
|
+
end
|
127
|
+
end
|
129
128
|
else
|
130
|
-
if
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
targets[existing] = target
|
129
|
+
if msgid
|
130
|
+
key_existed = targets.assoc(msgid.gsub(/\n/, '\n'))
|
131
|
+
if key_existed
|
132
|
+
targets[targets.index(key_existed)] = key_existed <<
|
133
|
+
file_name + ":" + line_no
|
136
134
|
else
|
137
|
-
targets <<
|
135
|
+
targets << [msgid.gsub(/\n/, '\n'), file_name + ":" + line_no]
|
138
136
|
end
|
139
|
-
|
140
|
-
target.add_extracted_comment last_extracted_comment unless last_extracted_comment.empty?
|
137
|
+
msgid = nil
|
141
138
|
target = nil
|
142
139
|
end
|
143
140
|
end
|
141
|
+
targets
|
144
142
|
rescue
|
145
|
-
$stderr.print "\n\nError"
|
146
|
-
$stderr.print "
|
147
|
-
$stderr.print "\n #{$!.inspect} in\n"
|
148
|
-
$stderr.print $!.backtrace.join("\n")
|
143
|
+
$stderr.print "\n\nError: #{$!.inspect} "
|
144
|
+
$stderr.print " in #{file_name}:#{tk.line_no}\n\t #{lines[tk.line_no - 1]}" if tk
|
149
145
|
$stderr.print "\n"
|
150
146
|
exit 1
|
151
147
|
end
|
152
|
-
|
153
|
-
case tk
|
154
|
-
when RubyToken::TkCOMMENT_WITH_CONTENT
|
155
|
-
last_extracted_comment = "" if reset_extracted_comment
|
156
|
-
if last_extracted_comment.empty?
|
157
|
-
# new comment from programmer to translator?
|
158
|
-
comment1 = tk.value.lstrip
|
159
|
-
if comment1 =~ /^TRANSLATORS\:/
|
160
|
-
last_extracted_comment += $'
|
161
|
-
end
|
162
|
-
else
|
163
|
-
last_extracted_comment += "\n"
|
164
|
-
last_extracted_comment += tk.value
|
165
|
-
end
|
166
|
-
reset_extracted_comment = false
|
167
|
-
when RubyToken::TkNL
|
168
|
-
else
|
169
|
-
reset_extracted_comment = true
|
170
|
-
end
|
171
148
|
end
|
172
149
|
targets
|
173
150
|
end
|
data/lib/gettext/poparser.rb
CHANGED
@@ -9,15 +9,18 @@
|
|
9
9
|
|
10
10
|
#
|
11
11
|
# DO NOT MODIFY!!!!
|
12
|
-
# This file is automatically generated by
|
13
|
-
# from
|
12
|
+
# This file is automatically generated by racc 1.4.5
|
13
|
+
# from racc grammer file "src/poparser.ry".
|
14
14
|
#
|
15
15
|
|
16
|
-
require 'racc/parser
|
16
|
+
require 'racc/parser'
|
17
|
+
|
18
|
+
|
17
19
|
module GetText
|
20
|
+
|
18
21
|
class PoParser < Racc::Parser
|
19
22
|
|
20
|
-
module_eval
|
23
|
+
module_eval <<'..end src/poparser.ry modeval..ida5d3d657e2', 'src/poparser.ry', 108
|
21
24
|
include GetText
|
22
25
|
GetText.bindtextdomain("rgettext")
|
23
26
|
|
@@ -126,8 +129,31 @@ module_eval(<<'...end poparser.ry/module_eval...', 'poparser.ry', 108)
|
|
126
129
|
Encoding.default_external
|
127
130
|
end
|
128
131
|
private :detect_file_encoding
|
129
|
-
|
130
|
-
|
132
|
+
..end src/poparser.ry modeval..ida5d3d657e2
|
133
|
+
|
134
|
+
##### racc 1.4.5 generates ###
|
135
|
+
|
136
|
+
racc_reduce_table = [
|
137
|
+
0, 0, :racc_error,
|
138
|
+
0, 10, :_reduce_none,
|
139
|
+
2, 10, :_reduce_none,
|
140
|
+
2, 10, :_reduce_none,
|
141
|
+
2, 10, :_reduce_none,
|
142
|
+
2, 12, :_reduce_5,
|
143
|
+
1, 13, :_reduce_none,
|
144
|
+
1, 13, :_reduce_none,
|
145
|
+
4, 15, :_reduce_8,
|
146
|
+
5, 16, :_reduce_9,
|
147
|
+
2, 17, :_reduce_10,
|
148
|
+
1, 17, :_reduce_none,
|
149
|
+
3, 18, :_reduce_12,
|
150
|
+
1, 11, :_reduce_13,
|
151
|
+
2, 14, :_reduce_14,
|
152
|
+
1, 14, :_reduce_15 ]
|
153
|
+
|
154
|
+
racc_reduce_n = 16
|
155
|
+
|
156
|
+
racc_shift_n = 26
|
131
157
|
|
132
158
|
racc_action_table = [
|
133
159
|
3, 13, 5, 7, 9, 15, 16, 17, 20, 17,
|
@@ -161,109 +187,86 @@ racc_goto_pointer = [
|
|
161
187
|
racc_goto_default = [
|
162
188
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ]
|
163
189
|
|
164
|
-
racc_reduce_table = [
|
165
|
-
0, 0, :racc_error,
|
166
|
-
0, 10, :_reduce_none,
|
167
|
-
2, 10, :_reduce_none,
|
168
|
-
2, 10, :_reduce_none,
|
169
|
-
2, 10, :_reduce_none,
|
170
|
-
2, 12, :_reduce_5,
|
171
|
-
1, 13, :_reduce_none,
|
172
|
-
1, 13, :_reduce_none,
|
173
|
-
4, 15, :_reduce_8,
|
174
|
-
5, 16, :_reduce_9,
|
175
|
-
2, 17, :_reduce_10,
|
176
|
-
1, 17, :_reduce_none,
|
177
|
-
3, 18, :_reduce_12,
|
178
|
-
1, 11, :_reduce_13,
|
179
|
-
2, 14, :_reduce_14,
|
180
|
-
1, 14, :_reduce_15 ]
|
181
|
-
|
182
|
-
racc_reduce_n = 16
|
183
|
-
|
184
|
-
racc_shift_n = 26
|
185
|
-
|
186
190
|
racc_token_table = {
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
racc_nt_base = 9
|
191
|
+
false => 0,
|
192
|
+
Object.new => 1,
|
193
|
+
:COMMENT => 2,
|
194
|
+
:MSGID => 3,
|
195
|
+
:MSGCTXT => 4,
|
196
|
+
:MSGID_PLURAL => 5,
|
197
|
+
:MSGSTR => 6,
|
198
|
+
:STRING => 7,
|
199
|
+
:PLURAL_NUM => 8 }
|
198
200
|
|
199
201
|
racc_use_result_var = true
|
200
202
|
|
203
|
+
racc_nt_base = 9
|
204
|
+
|
201
205
|
Racc_arg = [
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
206
|
+
racc_action_table,
|
207
|
+
racc_action_check,
|
208
|
+
racc_action_default,
|
209
|
+
racc_action_pointer,
|
210
|
+
racc_goto_table,
|
211
|
+
racc_goto_check,
|
212
|
+
racc_goto_default,
|
213
|
+
racc_goto_pointer,
|
214
|
+
racc_nt_base,
|
215
|
+
racc_reduce_table,
|
216
|
+
racc_token_table,
|
217
|
+
racc_shift_n,
|
218
|
+
racc_reduce_n,
|
219
|
+
racc_use_result_var ]
|
216
220
|
|
217
221
|
Racc_token_to_s_table = [
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
222
|
+
'$end',
|
223
|
+
'error',
|
224
|
+
'COMMENT',
|
225
|
+
'MSGID',
|
226
|
+
'MSGCTXT',
|
227
|
+
'MSGID_PLURAL',
|
228
|
+
'MSGSTR',
|
229
|
+
'STRING',
|
230
|
+
'PLURAL_NUM',
|
231
|
+
'$start',
|
232
|
+
'msgfmt',
|
233
|
+
'comment',
|
234
|
+
'msgctxt',
|
235
|
+
'message',
|
236
|
+
'string_list',
|
237
|
+
'single_message',
|
238
|
+
'plural_message',
|
239
|
+
'msgstr_plural',
|
240
|
+
'msgstr_plural_line']
|
237
241
|
|
238
242
|
Racc_debug_parser = true
|
239
243
|
|
240
|
-
#####
|
244
|
+
##### racc system variables end #####
|
241
245
|
|
242
|
-
# reduce 0 omitted
|
246
|
+
# reduce 0 omitted
|
243
247
|
|
244
|
-
# reduce 1 omitted
|
248
|
+
# reduce 1 omitted
|
245
249
|
|
246
|
-
# reduce 2 omitted
|
250
|
+
# reduce 2 omitted
|
247
251
|
|
248
|
-
# reduce 3 omitted
|
252
|
+
# reduce 3 omitted
|
249
253
|
|
250
|
-
# reduce 4 omitted
|
254
|
+
# reduce 4 omitted
|
251
255
|
|
252
|
-
module_eval
|
253
|
-
def _reduce_5(val, _values, result)
|
254
|
-
|
255
|
-
|
256
|
-
result
|
256
|
+
module_eval <<'.,.,', 'src/poparser.ry', 25
|
257
|
+
def _reduce_5( val, _values, result )
|
258
|
+
@msgctxt = unescape(val[1]) + "\004"
|
259
|
+
result
|
257
260
|
end
|
258
261
|
.,.,
|
259
262
|
|
260
|
-
# reduce 6 omitted
|
263
|
+
# reduce 6 omitted
|
261
264
|
|
262
|
-
# reduce 7 omitted
|
265
|
+
# reduce 7 omitted
|
263
266
|
|
264
|
-
module_eval
|
265
|
-
def _reduce_8(val, _values, result)
|
266
|
-
|
267
|
+
module_eval <<'.,.,', 'src/poparser.ry', 48
|
268
|
+
def _reduce_8( val, _values, result )
|
269
|
+
if @fuzzy and $ignore_fuzzy
|
267
270
|
if val[1] != ""
|
268
271
|
$stderr.print _("Warning: fuzzy message was ignored.\n")
|
269
272
|
$stderr.print " msgid '#{val[1]}'\n"
|
@@ -275,14 +278,13 @@ module_eval(<<'.,.,', 'poparser.ry', 35)
|
|
275
278
|
on_message(@msgctxt + unescape(val[1]), unescape(val[3]))
|
276
279
|
end
|
277
280
|
result = ""
|
278
|
-
|
279
|
-
result
|
281
|
+
result
|
280
282
|
end
|
281
283
|
.,.,
|
282
284
|
|
283
|
-
module_eval
|
284
|
-
def _reduce_9(val, _values, result)
|
285
|
-
|
285
|
+
module_eval <<'.,.,', 'src/poparser.ry', 65
|
286
|
+
def _reduce_9( val, _values, result )
|
287
|
+
if @fuzzy and $ignore_fuzzy
|
286
288
|
if val[1] != ""
|
287
289
|
$stderr.print _("Warning: fuzzy message was ignored.\n")
|
288
290
|
$stderr.print "msgid = '#{val[1]}\n"
|
@@ -294,62 +296,55 @@ module_eval(<<'.,.,', 'poparser.ry', 52)
|
|
294
296
|
on_message(@msgctxt + unescape(val[1]) + "\000" + unescape(val[3]), unescape(val[4]))
|
295
297
|
end
|
296
298
|
result = ""
|
297
|
-
|
298
|
-
result
|
299
|
+
result
|
299
300
|
end
|
300
301
|
.,.,
|
301
302
|
|
302
|
-
module_eval
|
303
|
-
def _reduce_10(val, _values, result)
|
304
|
-
|
303
|
+
module_eval <<'.,.,', 'src/poparser.ry', 76
|
304
|
+
def _reduce_10( val, _values, result )
|
305
|
+
if val[0].size > 0
|
305
306
|
result = val[0] + "\000" + val[1]
|
306
307
|
else
|
307
308
|
result = ""
|
308
309
|
end
|
309
|
-
|
310
|
-
result
|
310
|
+
result
|
311
311
|
end
|
312
312
|
.,.,
|
313
313
|
|
314
|
-
# reduce 11 omitted
|
314
|
+
# reduce 11 omitted
|
315
315
|
|
316
|
-
module_eval
|
317
|
-
def _reduce_12(val, _values, result)
|
318
|
-
|
319
|
-
|
320
|
-
result
|
316
|
+
module_eval <<'.,.,', 'src/poparser.ry', 84
|
317
|
+
def _reduce_12( val, _values, result )
|
318
|
+
result = val[2]
|
319
|
+
result
|
321
320
|
end
|
322
321
|
.,.,
|
323
322
|
|
324
|
-
module_eval
|
325
|
-
def _reduce_13(val, _values, result)
|
326
|
-
|
327
|
-
|
328
|
-
result
|
323
|
+
module_eval <<'.,.,', 'src/poparser.ry', 91
|
324
|
+
def _reduce_13( val, _values, result )
|
325
|
+
on_comment(val[0])
|
326
|
+
result
|
329
327
|
end
|
330
328
|
.,.,
|
331
329
|
|
332
|
-
module_eval
|
333
|
-
def _reduce_14(val, _values, result)
|
334
|
-
|
335
|
-
|
336
|
-
result
|
330
|
+
module_eval <<'.,.,', 'src/poparser.ry', 99
|
331
|
+
def _reduce_14( val, _values, result )
|
332
|
+
result = val.delete_if{|item| item == ""}.join
|
333
|
+
result
|
337
334
|
end
|
338
335
|
.,.,
|
339
336
|
|
340
|
-
module_eval
|
341
|
-
def _reduce_15(val, _values, result)
|
342
|
-
|
343
|
-
|
344
|
-
result
|
337
|
+
module_eval <<'.,.,', 'src/poparser.ry', 103
|
338
|
+
def _reduce_15( val, _values, result )
|
339
|
+
result = val[0]
|
340
|
+
result
|
345
341
|
end
|
346
342
|
.,.,
|
347
343
|
|
348
|
-
def _reduce_none(val, _values, result)
|
349
|
-
|
350
|
-
end
|
344
|
+
def _reduce_none( val, _values, result )
|
345
|
+
result
|
346
|
+
end
|
351
347
|
|
352
348
|
end # class PoParser
|
353
|
-
end # module GetText
|
354
|
-
|
355
349
|
|
350
|
+
end # module GetText
|