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/lib/gettext/container.rb
CHANGED
@@ -6,34 +6,14 @@
|
|
6
6
|
You may redistribute it and/or modify it under the same
|
7
7
|
license terms as Ruby.
|
8
8
|
|
9
|
-
$Id: container.rb,v 1.
|
9
|
+
$Id: container.rb,v 1.5 2006/06/04 14:43:37 mutoh Exp $
|
10
10
|
=end
|
11
11
|
|
12
12
|
require 'gettext'
|
13
13
|
|
14
|
-
module GetText
|
15
|
-
#
|
16
|
-
#
|
17
|
-
# Normaly, GetText.bindtexdomain should be called once a ruby-script-file.
|
18
|
-
# But if the class includes GetText::Container, a TextDomain is bound to an instance of the class.
|
19
|
-
# So you don't need to call bindtextdomain in each files if the files define a class.
|
20
|
-
#
|
21
|
-
# This module is useful for application-side classes, but you shouldn't use this for libraries.
|
22
|
-
# Because the user of your library may override/add new features to the original library and the
|
23
|
-
# user needs to prepare another TextDomain(Otherwise, apply po/mo patch to the original library).
|
14
|
+
module GetText # :nodoc:
|
15
|
+
# Deprecated. You don't need this. Use GetText instead.
|
24
16
|
module Container
|
25
17
|
include GetText
|
26
|
-
|
27
|
-
alias :_bindtextdomain :bindtextdomain #:nodoc:
|
28
|
-
|
29
|
-
def bindtextdomain(domainname, path = nil, locale = nil, charset = nil) #:nodoc:
|
30
|
-
@gettext_container_domainname = domainname
|
31
|
-
_bindtextdomain(domainname, path, locale, charset)
|
32
|
-
end
|
33
|
-
|
34
|
-
def callersrc #:nodoc:
|
35
|
-
@gettext_container_domainname
|
36
|
-
end
|
37
|
-
|
38
18
|
end
|
39
19
|
end
|
data/lib/gettext/erb.rb
CHANGED
@@ -6,11 +6,11 @@
|
|
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/06/04 14:43:37 mutoh Exp $
|
10
10
|
=end
|
11
11
|
|
12
12
|
require 'erb'
|
13
|
-
require 'gettext
|
13
|
+
require 'gettext'
|
14
14
|
|
15
15
|
module GetText
|
16
16
|
|
data/lib/gettext/locale_posix.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: locale_posix.rb,v 1.
|
9
|
+
$Id: locale_posix.rb,v 1.3 2006/06/07 15:56:04 mutoh Exp $
|
10
10
|
=end
|
11
11
|
|
12
12
|
|
@@ -16,12 +16,20 @@ module Locale # :nodoc:
|
|
16
16
|
module SystemPosix
|
17
17
|
extend Locale::System
|
18
18
|
module_function
|
19
|
+
@@default_locale = Locale::Object.new("C", nil, "UTF-8")
|
20
|
+
|
19
21
|
# Gets the system locale using setlocale and nl_langinfo.
|
20
22
|
# * Returns the system locale (Locale::Object).
|
21
23
|
def system
|
22
|
-
|
23
|
-
|
24
|
-
|
24
|
+
locale = nil
|
25
|
+
[ENV["LC_ALL"], ENV["LC_MESSAGES"], ENV["LANG"],
|
26
|
+
@@default_locale.orig_str].each do |loc|
|
27
|
+
if loc != nil and loc.size > 0
|
28
|
+
locale = Locale::Object.new(loc)
|
29
|
+
locale.charset = get_charset(locale)
|
30
|
+
break
|
31
|
+
end
|
32
|
+
end
|
25
33
|
locale
|
26
34
|
end
|
27
35
|
|
@@ -36,7 +44,31 @@ module Locale # :nodoc:
|
|
36
44
|
ret
|
37
45
|
end
|
38
46
|
end
|
39
|
-
|
47
|
+
|
48
|
+
# Sets a default locale. en.UTF-8 is the default value if not set.
|
49
|
+
# * locale: Locale::Object object. You can't set nil.
|
50
|
+
# * Returns: self
|
51
|
+
def set_default_locale(locale)
|
52
|
+
raise "Wrong parameter: #{locale}" if locale.nil?
|
53
|
+
@@default_locale = locale
|
54
|
+
self
|
55
|
+
end
|
56
|
+
|
57
|
+
# Sets a default locale. en.UTF-8 is the default value if not set.
|
58
|
+
# * locale: Locale::Object
|
59
|
+
# * Returns: locale
|
60
|
+
def default_locale=(locale)
|
61
|
+
set_default_locale(locale)
|
62
|
+
locale
|
63
|
+
end
|
64
|
+
|
65
|
+
# Gets the default Locale::Object.
|
66
|
+
# * Returns: the default locale
|
67
|
+
def default_locale
|
68
|
+
@@default_locale
|
69
|
+
end
|
70
|
+
|
71
|
+
if defined? Locale::System::MESSAGES
|
40
72
|
CTYPE = Locale::System::CTYPE #:nodoc:
|
41
73
|
NUMERIC = Locale::System::NUMERIC #:nodoc:
|
42
74
|
TIME = Locale::System::TIME #:nodoc:
|
data/lib/gettext/locale_win32.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: locale_win32.rb,v 1.
|
9
|
+
$Id: locale_win32.rb,v 1.13 2006/06/04 14:43:37 mutoh Exp $
|
10
10
|
=end
|
11
11
|
|
12
12
|
require 'gettext/locale_table_win32'
|
@@ -32,6 +32,7 @@ module Locale #:nodoc:
|
|
32
32
|
# * Returns the system locale (Locale::Object)
|
33
33
|
def system
|
34
34
|
lang = nil
|
35
|
+
ret = nil
|
35
36
|
["LC_ALL", "LC_CTYPE", "LC_MESSAGES", "LANG"].each do |env|
|
36
37
|
lang = ENV[env]
|
37
38
|
if lang
|
data/lib/gettext/mo.rb
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
of Ruby. License of Ruby is included with Ruby distribution in
|
13
13
|
the file "README".
|
14
14
|
|
15
|
-
$Id: mo.rb,v 1.
|
15
|
+
$Id: mo.rb,v 1.6 2006/05/19 15:42:14 mutoh Exp $
|
16
16
|
=end
|
17
17
|
|
18
18
|
require 'gettext/iconv'
|
@@ -38,7 +38,7 @@ class MOFile < Hash #:nodoc:
|
|
38
38
|
|
39
39
|
def initialize(output_charset = nil)
|
40
40
|
@filename = nil
|
41
|
-
@last_modified =
|
41
|
+
@last_modified = nil
|
42
42
|
@little_endian = true
|
43
43
|
@output_charset = output_charset
|
44
44
|
super()
|
@@ -46,7 +46,8 @@ class MOFile < Hash #:nodoc:
|
|
46
46
|
|
47
47
|
def update!
|
48
48
|
if FileTest.exist?(@filename)
|
49
|
-
|
49
|
+
st = File.stat(@filename)
|
50
|
+
load(@filename) unless (@last_modified == [st.ctime, st.mtime])
|
50
51
|
else
|
51
52
|
puts "#{@filename} was lost." if $DEBUG
|
52
53
|
clear
|
@@ -58,7 +59,8 @@ class MOFile < Hash #:nodoc:
|
|
58
59
|
case arg
|
59
60
|
when String
|
60
61
|
begin
|
61
|
-
|
62
|
+
st = File.stat(arg)
|
63
|
+
@last_modified = [st.ctime, st.mtime]
|
62
64
|
rescue Exception
|
63
65
|
end
|
64
66
|
load_from_file(arg)
|
@@ -2,12 +2,12 @@
|
|
2
2
|
=begin
|
3
3
|
parser/activerecord.rb - parser for ActiveRecord
|
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
|
|
10
|
-
$Id: activerecord.rb,v 1.
|
10
|
+
$Id: activerecord.rb,v 1.9 2006/05/13 17:20:52 mutoh Exp $
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'gettext'
|
@@ -110,7 +110,11 @@ module GetText
|
|
110
110
|
data.each do |v|
|
111
111
|
if @ar_re =~ v
|
112
112
|
unless @db
|
113
|
-
|
113
|
+
begin
|
114
|
+
require 'rubygems'
|
115
|
+
rescue LoadError
|
116
|
+
$stderr.puts _("rubygems are not found.") if $DEBUG
|
117
|
+
end
|
114
118
|
require 'active_record'
|
115
119
|
begin
|
116
120
|
yml = YAML.load(ERB.new(IO.read(@config[:db_yml])).result)
|
data/lib/gettext/poparser.rb
CHANGED
@@ -1,298 +1,298 @@
|
|
1
|
-
=begin
|
2
|
-
poparser.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
|
-
# DO NOT MODIFY!!!!
|
12
|
-
# This file is automatically generated by racc 1.4.
|
13
|
-
# from racc grammer file "src/poparser.ry".
|
14
|
-
#
|
15
|
-
|
16
|
-
require 'racc/parser'
|
17
|
-
|
18
|
-
|
19
|
-
module GetText
|
20
|
-
|
21
|
-
class PoParser < Racc::Parser
|
22
|
-
|
23
|
-
module_eval <<'..end src/poparser.ry modeval..
|
24
|
-
include GetText
|
25
|
-
GetText.bindtextdomain("rgettext")
|
26
|
-
|
27
|
-
def unescape(orig)
|
28
|
-
ret = orig.gsub(/\\n/, "\n")
|
29
|
-
ret.gsub!(/\\t/, "\t")
|
30
|
-
ret.gsub!(/\\r/, "\r")
|
31
|
-
ret.gsub!(/\\"/, "\"")
|
32
|
-
ret
|
33
|
-
end
|
34
|
-
|
35
|
-
def parse(str, data, ignore_fuzzy = true)
|
36
|
-
@comments = []
|
37
|
-
@data = data
|
38
|
-
@fuzzy = false
|
39
|
-
$ignore_fuzzy = ignore_fuzzy
|
40
|
-
str.strip!
|
41
|
-
@q = []
|
42
|
-
until str.empty? do
|
43
|
-
case str
|
44
|
-
when /\A\s+/
|
45
|
-
str = $'
|
46
|
-
when /\Amsgid_plural/
|
47
|
-
@q.push [:MSGID_PLURAL, $&]
|
48
|
-
str = $'
|
49
|
-
when /\Amsgid/
|
50
|
-
@q.push [:MSGID, $&]
|
51
|
-
str = $'
|
52
|
-
when /\Amsgstr/
|
53
|
-
@q.push [:MSGSTR, $&]
|
54
|
-
str = $'
|
55
|
-
when /\A\[(\d+)\]/
|
56
|
-
@q.push [:PLURAL_NUM, $1]
|
57
|
-
str = $'
|
58
|
-
when /\A\#~(.*)/
|
59
|
-
$stderr.print _("Warning: obsolete msgid is existed.\n")
|
60
|
-
$stderr.print " #{$&}\n"
|
61
|
-
@q.push [:COMMENT, $&]
|
62
|
-
str = $'
|
63
|
-
when /\A\#(.*)/
|
64
|
-
@q.push [:COMMENT, $&]
|
65
|
-
str = $'
|
66
|
-
when /\A\"(.*)\"/
|
67
|
-
@q.push [:STRING, $1]
|
68
|
-
str = $'
|
69
|
-
else
|
70
|
-
#c = str[0,1]
|
71
|
-
#@q.push [:STRING, c]
|
72
|
-
str = str[1..-1]
|
73
|
-
end
|
74
|
-
end
|
75
|
-
@q.push [false, '$end']
|
76
|
-
if $DEBUG
|
77
|
-
@q.each do |a,b|
|
78
|
-
puts "[#{a}, #{b}]"
|
79
|
-
end
|
80
|
-
end
|
81
|
-
@yydebug = true if $DEBUG
|
82
|
-
do_parse
|
83
|
-
|
84
|
-
if @comments.size > 0
|
85
|
-
@data.set_comment(:last, @comments.join("\n"))
|
86
|
-
end
|
87
|
-
@data
|
88
|
-
end
|
89
|
-
|
90
|
-
def next_token
|
91
|
-
@q.shift
|
92
|
-
end
|
93
|
-
|
94
|
-
def on_message(msgid, msgstr)
|
95
|
-
@data[msgid] = msgstr
|
96
|
-
|
97
|
-
@data.set_comment(msgid, @comments.join("\n"))
|
98
|
-
@comments.clear
|
99
|
-
end
|
100
|
-
|
101
|
-
def on_comment(comment)
|
102
|
-
@fuzzy = true if (/fuzzy/ =~ comment)
|
103
|
-
@comments << comment
|
104
|
-
end
|
105
|
-
|
106
|
-
..end src/poparser.ry modeval..
|
107
|
-
|
108
|
-
##### racc 1.4.
|
109
|
-
|
110
|
-
racc_reduce_table = [
|
111
|
-
0, 0, :racc_error,
|
112
|
-
0, 9, :_reduce_none,
|
113
|
-
2, 9, :_reduce_none,
|
114
|
-
2, 9, :_reduce_none,
|
115
|
-
4, 11, :_reduce_4,
|
116
|
-
5, 11, :_reduce_5,
|
117
|
-
2, 13, :_reduce_6,
|
118
|
-
1, 13, :_reduce_none,
|
119
|
-
3, 14, :_reduce_8,
|
120
|
-
1, 10, :_reduce_9,
|
121
|
-
2, 12, :_reduce_10,
|
122
|
-
1, 12, :_reduce_11 ]
|
123
|
-
|
124
|
-
racc_reduce_n = 12
|
125
|
-
|
126
|
-
racc_shift_n = 21
|
127
|
-
|
128
|
-
racc_action_table = [
|
129
|
-
3, 9, 4, 5, 10, 11, 12, 17, 12, 9,
|
130
|
-
9, 7, 12, 17, 19, 9, 12 ]
|
131
|
-
|
132
|
-
racc_action_check = [
|
133
|
-
1, 5, 1, 1, 8, 8, 8, 13, 13, 10,
|
134
|
-
11, 3, 14, 15, 17, 19, 20 ]
|
135
|
-
|
136
|
-
racc_action_pointer = [
|
137
|
-
nil, 0, nil, 11, nil, -5, nil, nil, 0, nil,
|
138
|
-
3, 4, nil, 2, 6, 8, nil, 7, nil, 9,
|
139
|
-
10 ]
|
140
|
-
|
141
|
-
racc_action_default = [
|
142
|
-
-1, -12, -3, -12, -9, -12, -2, 21, -12, -11,
|
143
|
-
-12, -12, -10, -12, -4, -5, -7, -12, -6, -12,
|
144
|
-
-8 ]
|
145
|
-
|
146
|
-
racc_goto_table = [
|
147
|
-
8, 16, 2, 18, 6, 13, 14, 15, 1, nil,
|
148
|
-
nil, nil, nil, nil, 20 ]
|
149
|
-
|
150
|
-
racc_goto_check = [
|
151
|
-
4, 6, 3, 6, 2, 4, 4, 5, 1, nil,
|
152
|
-
nil, nil, nil, nil, 4 ]
|
153
|
-
|
154
|
-
racc_goto_pointer = [
|
155
|
-
nil, 8, 3, 1, -5, -6, -12 ]
|
156
|
-
|
157
|
-
racc_goto_default = [
|
158
|
-
nil, nil, nil, nil, nil, nil, nil ]
|
159
|
-
|
160
|
-
racc_token_table = {
|
161
|
-
false => 0,
|
162
|
-
Object.new => 1,
|
163
|
-
:COMMENT => 2,
|
164
|
-
:MSGID => 3,
|
165
|
-
:MSGID_PLURAL => 4,
|
166
|
-
:MSGSTR => 5,
|
167
|
-
:STRING => 6,
|
168
|
-
:PLURAL_NUM => 7 }
|
169
|
-
|
170
|
-
racc_use_result_var = true
|
171
|
-
|
172
|
-
racc_nt_base = 8
|
173
|
-
|
174
|
-
Racc_arg = [
|
175
|
-
racc_action_table,
|
176
|
-
racc_action_check,
|
177
|
-
racc_action_default,
|
178
|
-
racc_action_pointer,
|
179
|
-
racc_goto_table,
|
180
|
-
racc_goto_check,
|
181
|
-
racc_goto_default,
|
182
|
-
racc_goto_pointer,
|
183
|
-
racc_nt_base,
|
184
|
-
racc_reduce_table,
|
185
|
-
racc_token_table,
|
186
|
-
racc_shift_n,
|
187
|
-
racc_reduce_n,
|
188
|
-
racc_use_result_var ]
|
189
|
-
|
190
|
-
Racc_token_to_s_table = [
|
191
|
-
'$end',
|
192
|
-
'error',
|
193
|
-
'COMMENT',
|
194
|
-
'MSGID',
|
195
|
-
'MSGID_PLURAL',
|
196
|
-
'MSGSTR',
|
197
|
-
'STRING',
|
198
|
-
'PLURAL_NUM',
|
199
|
-
'$start',
|
200
|
-
'msgfmt',
|
201
|
-
'comment',
|
202
|
-
'message',
|
203
|
-
'string_list',
|
204
|
-
'msgstr_plural',
|
205
|
-
'msgstr_plural_line']
|
206
|
-
|
207
|
-
Racc_debug_parser = true
|
208
|
-
|
209
|
-
##### racc system variables end #####
|
210
|
-
|
211
|
-
# reduce 0 omitted
|
212
|
-
|
213
|
-
# reduce 1 omitted
|
214
|
-
|
215
|
-
# reduce 2 omitted
|
216
|
-
|
217
|
-
# reduce 3 omitted
|
218
|
-
|
219
|
-
module_eval <<'.,.,', 'src/poparser.ry', 36
|
220
|
-
def _reduce_4( val, _values, result )
|
221
|
-
if @fuzzy and $ignore_fuzzy
|
222
|
-
if val[1] != ""
|
223
|
-
$stderr.print _("Warning: fuzzy message was ignored.\n")
|
224
|
-
$stderr.print " msgid '#{val[1]}'\n"
|
225
|
-
else
|
226
|
-
on_message('', unescape(val[3]))
|
227
|
-
end
|
228
|
-
@fuzzy = false
|
229
|
-
else
|
230
|
-
on_message(unescape(val[1]), unescape(val[3]))
|
231
|
-
end
|
232
|
-
result = ""
|
233
|
-
result
|
234
|
-
end
|
235
|
-
.,.,
|
236
|
-
|
237
|
-
module_eval <<'.,.,', 'src/poparser.ry', 51
|
238
|
-
def _reduce_5( val, _values, result )
|
239
|
-
if @fuzzy and $ignore_fuzzy
|
240
|
-
if val[1] != ""
|
241
|
-
$stderr.print _("Warning: fuzzy message was ignored.\n")
|
242
|
-
$stderr.print "msgid = '#{val[1]}\n"
|
243
|
-
else
|
244
|
-
on_message('', unescape(val[3]))
|
245
|
-
end
|
246
|
-
@fuzzy = false
|
247
|
-
else
|
248
|
-
on_message(unescape(val[1]) + "\000" + unescape(val[3]), unescape(val[4]))
|
249
|
-
end
|
250
|
-
result = ""
|
251
|
-
result
|
252
|
-
end
|
253
|
-
.,.,
|
254
|
-
|
255
|
-
module_eval <<'.,.,', 'src/poparser.ry', 58
|
256
|
-
def _reduce_6( val, _values, result )
|
257
|
-
result = val[0] + "\000" + val[1]
|
258
|
-
result
|
259
|
-
end
|
260
|
-
.,.,
|
261
|
-
|
262
|
-
# reduce 7 omitted
|
263
|
-
|
264
|
-
module_eval <<'.,.,', 'src/poparser.ry', 66
|
265
|
-
def _reduce_8( val, _values, result )
|
266
|
-
result = val[2]
|
267
|
-
result
|
268
|
-
end
|
269
|
-
.,.,
|
270
|
-
|
271
|
-
module_eval <<'.,.,', 'src/poparser.ry', 73
|
272
|
-
def _reduce_9( val, _values, result )
|
273
|
-
on_comment(val[0])
|
274
|
-
result
|
275
|
-
end
|
276
|
-
.,.,
|
277
|
-
|
278
|
-
module_eval <<'.,.,', 'src/poparser.ry', 81
|
279
|
-
def _reduce_10( val, _values, result )
|
280
|
-
result = val.delete_if{|item| item == ""}.join
|
281
|
-
result
|
282
|
-
end
|
283
|
-
.,.,
|
284
|
-
|
285
|
-
module_eval <<'.,.,', 'src/poparser.ry', 85
|
286
|
-
def _reduce_11( val, _values, result )
|
287
|
-
result = val[0]
|
288
|
-
result
|
289
|
-
end
|
290
|
-
.,.,
|
291
|
-
|
292
|
-
def _reduce_none( val, _values, result )
|
293
|
-
result
|
294
|
-
end
|
295
|
-
|
296
|
-
end # class PoParser
|
297
|
-
|
298
|
-
end # module GetText
|
1
|
+
=begin
|
2
|
+
poparser.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
|
+
# DO NOT MODIFY!!!!
|
12
|
+
# This file is automatically generated by racc 1.4.4
|
13
|
+
# from racc grammer file "src/poparser.ry".
|
14
|
+
#
|
15
|
+
|
16
|
+
require 'racc/parser'
|
17
|
+
|
18
|
+
|
19
|
+
module GetText
|
20
|
+
|
21
|
+
class PoParser < Racc::Parser
|
22
|
+
|
23
|
+
module_eval <<'..end src/poparser.ry modeval..id2c720ef3d7', 'src/poparser.ry', 90
|
24
|
+
include GetText
|
25
|
+
GetText.bindtextdomain("rgettext")
|
26
|
+
|
27
|
+
def unescape(orig)
|
28
|
+
ret = orig.gsub(/\\n/, "\n")
|
29
|
+
ret.gsub!(/\\t/, "\t")
|
30
|
+
ret.gsub!(/\\r/, "\r")
|
31
|
+
ret.gsub!(/\\"/, "\"")
|
32
|
+
ret
|
33
|
+
end
|
34
|
+
|
35
|
+
def parse(str, data, ignore_fuzzy = true)
|
36
|
+
@comments = []
|
37
|
+
@data = data
|
38
|
+
@fuzzy = false
|
39
|
+
$ignore_fuzzy = ignore_fuzzy
|
40
|
+
str.strip!
|
41
|
+
@q = []
|
42
|
+
until str.empty? do
|
43
|
+
case str
|
44
|
+
when /\A\s+/
|
45
|
+
str = $'
|
46
|
+
when /\Amsgid_plural/
|
47
|
+
@q.push [:MSGID_PLURAL, $&]
|
48
|
+
str = $'
|
49
|
+
when /\Amsgid/
|
50
|
+
@q.push [:MSGID, $&]
|
51
|
+
str = $'
|
52
|
+
when /\Amsgstr/
|
53
|
+
@q.push [:MSGSTR, $&]
|
54
|
+
str = $'
|
55
|
+
when /\A\[(\d+)\]/
|
56
|
+
@q.push [:PLURAL_NUM, $1]
|
57
|
+
str = $'
|
58
|
+
when /\A\#~(.*)/
|
59
|
+
$stderr.print _("Warning: obsolete msgid is existed.\n")
|
60
|
+
$stderr.print " #{$&}\n"
|
61
|
+
@q.push [:COMMENT, $&]
|
62
|
+
str = $'
|
63
|
+
when /\A\#(.*)/
|
64
|
+
@q.push [:COMMENT, $&]
|
65
|
+
str = $'
|
66
|
+
when /\A\"(.*)\"/
|
67
|
+
@q.push [:STRING, $1]
|
68
|
+
str = $'
|
69
|
+
else
|
70
|
+
#c = str[0,1]
|
71
|
+
#@q.push [:STRING, c]
|
72
|
+
str = str[1..-1]
|
73
|
+
end
|
74
|
+
end
|
75
|
+
@q.push [false, '$end']
|
76
|
+
if $DEBUG
|
77
|
+
@q.each do |a,b|
|
78
|
+
puts "[#{a}, #{b}]"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
@yydebug = true if $DEBUG
|
82
|
+
do_parse
|
83
|
+
|
84
|
+
if @comments.size > 0
|
85
|
+
@data.set_comment(:last, @comments.join("\n"))
|
86
|
+
end
|
87
|
+
@data
|
88
|
+
end
|
89
|
+
|
90
|
+
def next_token
|
91
|
+
@q.shift
|
92
|
+
end
|
93
|
+
|
94
|
+
def on_message(msgid, msgstr)
|
95
|
+
@data[msgid] = msgstr
|
96
|
+
|
97
|
+
@data.set_comment(msgid, @comments.join("\n"))
|
98
|
+
@comments.clear
|
99
|
+
end
|
100
|
+
|
101
|
+
def on_comment(comment)
|
102
|
+
@fuzzy = true if (/fuzzy/ =~ comment)
|
103
|
+
@comments << comment
|
104
|
+
end
|
105
|
+
|
106
|
+
..end src/poparser.ry modeval..id2c720ef3d7
|
107
|
+
|
108
|
+
##### racc 1.4.4 generates ###
|
109
|
+
|
110
|
+
racc_reduce_table = [
|
111
|
+
0, 0, :racc_error,
|
112
|
+
0, 9, :_reduce_none,
|
113
|
+
2, 9, :_reduce_none,
|
114
|
+
2, 9, :_reduce_none,
|
115
|
+
4, 11, :_reduce_4,
|
116
|
+
5, 11, :_reduce_5,
|
117
|
+
2, 13, :_reduce_6,
|
118
|
+
1, 13, :_reduce_none,
|
119
|
+
3, 14, :_reduce_8,
|
120
|
+
1, 10, :_reduce_9,
|
121
|
+
2, 12, :_reduce_10,
|
122
|
+
1, 12, :_reduce_11 ]
|
123
|
+
|
124
|
+
racc_reduce_n = 12
|
125
|
+
|
126
|
+
racc_shift_n = 21
|
127
|
+
|
128
|
+
racc_action_table = [
|
129
|
+
3, 9, 4, 5, 10, 11, 12, 17, 12, 9,
|
130
|
+
9, 7, 12, 17, 19, 9, 12 ]
|
131
|
+
|
132
|
+
racc_action_check = [
|
133
|
+
1, 5, 1, 1, 8, 8, 8, 13, 13, 10,
|
134
|
+
11, 3, 14, 15, 17, 19, 20 ]
|
135
|
+
|
136
|
+
racc_action_pointer = [
|
137
|
+
nil, 0, nil, 11, nil, -5, nil, nil, 0, nil,
|
138
|
+
3, 4, nil, 2, 6, 8, nil, 7, nil, 9,
|
139
|
+
10 ]
|
140
|
+
|
141
|
+
racc_action_default = [
|
142
|
+
-1, -12, -3, -12, -9, -12, -2, 21, -12, -11,
|
143
|
+
-12, -12, -10, -12, -4, -5, -7, -12, -6, -12,
|
144
|
+
-8 ]
|
145
|
+
|
146
|
+
racc_goto_table = [
|
147
|
+
8, 16, 2, 18, 6, 13, 14, 15, 1, nil,
|
148
|
+
nil, nil, nil, nil, 20 ]
|
149
|
+
|
150
|
+
racc_goto_check = [
|
151
|
+
4, 6, 3, 6, 2, 4, 4, 5, 1, nil,
|
152
|
+
nil, nil, nil, nil, 4 ]
|
153
|
+
|
154
|
+
racc_goto_pointer = [
|
155
|
+
nil, 8, 3, 1, -5, -6, -12 ]
|
156
|
+
|
157
|
+
racc_goto_default = [
|
158
|
+
nil, nil, nil, nil, nil, nil, nil ]
|
159
|
+
|
160
|
+
racc_token_table = {
|
161
|
+
false => 0,
|
162
|
+
Object.new => 1,
|
163
|
+
:COMMENT => 2,
|
164
|
+
:MSGID => 3,
|
165
|
+
:MSGID_PLURAL => 4,
|
166
|
+
:MSGSTR => 5,
|
167
|
+
:STRING => 6,
|
168
|
+
:PLURAL_NUM => 7 }
|
169
|
+
|
170
|
+
racc_use_result_var = true
|
171
|
+
|
172
|
+
racc_nt_base = 8
|
173
|
+
|
174
|
+
Racc_arg = [
|
175
|
+
racc_action_table,
|
176
|
+
racc_action_check,
|
177
|
+
racc_action_default,
|
178
|
+
racc_action_pointer,
|
179
|
+
racc_goto_table,
|
180
|
+
racc_goto_check,
|
181
|
+
racc_goto_default,
|
182
|
+
racc_goto_pointer,
|
183
|
+
racc_nt_base,
|
184
|
+
racc_reduce_table,
|
185
|
+
racc_token_table,
|
186
|
+
racc_shift_n,
|
187
|
+
racc_reduce_n,
|
188
|
+
racc_use_result_var ]
|
189
|
+
|
190
|
+
Racc_token_to_s_table = [
|
191
|
+
'$end',
|
192
|
+
'error',
|
193
|
+
'COMMENT',
|
194
|
+
'MSGID',
|
195
|
+
'MSGID_PLURAL',
|
196
|
+
'MSGSTR',
|
197
|
+
'STRING',
|
198
|
+
'PLURAL_NUM',
|
199
|
+
'$start',
|
200
|
+
'msgfmt',
|
201
|
+
'comment',
|
202
|
+
'message',
|
203
|
+
'string_list',
|
204
|
+
'msgstr_plural',
|
205
|
+
'msgstr_plural_line']
|
206
|
+
|
207
|
+
Racc_debug_parser = true
|
208
|
+
|
209
|
+
##### racc system variables end #####
|
210
|
+
|
211
|
+
# reduce 0 omitted
|
212
|
+
|
213
|
+
# reduce 1 omitted
|
214
|
+
|
215
|
+
# reduce 2 omitted
|
216
|
+
|
217
|
+
# reduce 3 omitted
|
218
|
+
|
219
|
+
module_eval <<'.,.,', 'src/poparser.ry', 36
|
220
|
+
def _reduce_4( val, _values, result )
|
221
|
+
if @fuzzy and $ignore_fuzzy
|
222
|
+
if val[1] != ""
|
223
|
+
$stderr.print _("Warning: fuzzy message was ignored.\n")
|
224
|
+
$stderr.print " msgid '#{val[1]}'\n"
|
225
|
+
else
|
226
|
+
on_message('', unescape(val[3]))
|
227
|
+
end
|
228
|
+
@fuzzy = false
|
229
|
+
else
|
230
|
+
on_message(unescape(val[1]), unescape(val[3]))
|
231
|
+
end
|
232
|
+
result = ""
|
233
|
+
result
|
234
|
+
end
|
235
|
+
.,.,
|
236
|
+
|
237
|
+
module_eval <<'.,.,', 'src/poparser.ry', 51
|
238
|
+
def _reduce_5( val, _values, result )
|
239
|
+
if @fuzzy and $ignore_fuzzy
|
240
|
+
if val[1] != ""
|
241
|
+
$stderr.print _("Warning: fuzzy message was ignored.\n")
|
242
|
+
$stderr.print "msgid = '#{val[1]}\n"
|
243
|
+
else
|
244
|
+
on_message('', unescape(val[3]))
|
245
|
+
end
|
246
|
+
@fuzzy = false
|
247
|
+
else
|
248
|
+
on_message(unescape(val[1]) + "\000" + unescape(val[3]), unescape(val[4]))
|
249
|
+
end
|
250
|
+
result = ""
|
251
|
+
result
|
252
|
+
end
|
253
|
+
.,.,
|
254
|
+
|
255
|
+
module_eval <<'.,.,', 'src/poparser.ry', 58
|
256
|
+
def _reduce_6( val, _values, result )
|
257
|
+
result = val[0] + "\000" + val[1]
|
258
|
+
result
|
259
|
+
end
|
260
|
+
.,.,
|
261
|
+
|
262
|
+
# reduce 7 omitted
|
263
|
+
|
264
|
+
module_eval <<'.,.,', 'src/poparser.ry', 66
|
265
|
+
def _reduce_8( val, _values, result )
|
266
|
+
result = val[2]
|
267
|
+
result
|
268
|
+
end
|
269
|
+
.,.,
|
270
|
+
|
271
|
+
module_eval <<'.,.,', 'src/poparser.ry', 73
|
272
|
+
def _reduce_9( val, _values, result )
|
273
|
+
on_comment(val[0])
|
274
|
+
result
|
275
|
+
end
|
276
|
+
.,.,
|
277
|
+
|
278
|
+
module_eval <<'.,.,', 'src/poparser.ry', 81
|
279
|
+
def _reduce_10( val, _values, result )
|
280
|
+
result = val.delete_if{|item| item == ""}.join
|
281
|
+
result
|
282
|
+
end
|
283
|
+
.,.,
|
284
|
+
|
285
|
+
module_eval <<'.,.,', 'src/poparser.ry', 85
|
286
|
+
def _reduce_11( val, _values, result )
|
287
|
+
result = val[0]
|
288
|
+
result
|
289
|
+
end
|
290
|
+
.,.,
|
291
|
+
|
292
|
+
def _reduce_none( val, _values, result )
|
293
|
+
result
|
294
|
+
end
|
295
|
+
|
296
|
+
end # class PoParser
|
297
|
+
|
298
|
+
end # module GetText
|