gettext 1.9.0-mswin32 → 1.10.0-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +122 -1
- data/NEWS +21 -0
- data/README +30 -22
- data/data/locale/bs/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/bs/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ca/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/ca/LC_MESSAGES/rgettext.mo +0 -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/el/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/el/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/eo/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/eo/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/et/LC_MESSAGES/rails.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/hr/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/hr/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/nb/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/nb/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/vi/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/vi/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/data/locale/zh_TW/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/zh_TW/LC_MESSAGES/rgettext.mo +0 -0
- data/ext/gettext/Makefile +2 -2
- data/ext/gettext/locale_system.o +0 -0
- data/ext/gettext/locale_system.so +0 -0
- data/lib/gettext/active_record.rb +51 -31
- data/lib/gettext/locale_win32.rb +2 -1
- data/lib/gettext/parser/active_record.rb +2 -2
- data/lib/gettext/parser/ruby.rb +2 -2
- data/lib/gettext/poparser.rb +303 -298
- data/lib/gettext/rails.rb +104 -50
- data/lib/gettext/rails_compat.rb +16 -0
- data/lib/gettext/rgettext.rb +37 -3
- data/lib/gettext/textdomain.rb +45 -6
- data/lib/gettext/utils.rb +7 -0
- data/lib/gettext/version.rb +1 -1
- data/lib/gettext.rb +119 -37
- data/lib/locale_system.so +0 -0
- data/po/bs/rails.po +148 -0
- data/po/bs/rgettext.po +131 -0
- data/po/ca/rails.po +45 -26
- data/po/ca/rgettext.po +21 -21
- data/po/cs/rails.po +46 -24
- data/po/cs/rgettext.po +21 -21
- data/po/de/rails.po +46 -27
- data/po/de/rgettext.po +21 -21
- data/po/el/rails.po +46 -25
- data/po/el/rgettext.po +22 -22
- data/po/eo/rails.po +49 -30
- data/po/eo/rgettext.po +21 -21
- data/po/es/rails.po +45 -24
- data/po/es/rgettext.po +21 -21
- data/po/et/rails.po +49 -30
- data/po/fr/rails.po +47 -28
- data/po/fr/rgettext.po +31 -29
- data/po/hr/rails.po +148 -0
- data/po/hr/rgettext.po +131 -0
- data/po/it/rails.po +42 -24
- data/po/it/rgettext.po +21 -21
- data/po/ja/rails.po +43 -25
- data/po/ja/rgettext.po +21 -21
- data/po/ko/rails.po +44 -24
- data/po/ko/rgettext.po +21 -21
- data/po/nb/rails.po +140 -0
- data/po/nb/rgettext.po +127 -0
- data/po/nl/rails.po +50 -30
- data/po/nl/rgettext.po +21 -21
- data/po/pt_BR/rails.po +48 -29
- data/po/pt_BR/rgettext.po +21 -21
- data/po/rails.pot +42 -24
- data/po/rgettext.pot +21 -21
- data/po/ru/rails.po +50 -31
- data/po/ru/rgettext.po +21 -21
- data/po/sv/rgettext.po +21 -21
- data/po/vi/rails.po +141 -0
- data/po/vi/rgettext.po +126 -0
- data/po/zh/rails.po +60 -43
- data/po/zh/rgettext.po +22 -22
- data/po/zh_TW/rails.po +61 -43
- data/po/zh_TW/rgettext.po +22 -22
- data/samples/cgi/locale/bs/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/bs/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/bs/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/bs/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/hr/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/hr/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/hr/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/hr/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/nb/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/nb/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/nb/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/nb/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/vi/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/vi/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/vi/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/vi/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/po/bs/helloerb1.po +59 -0
- data/samples/cgi/po/bs/helloerb2.po +51 -0
- data/samples/cgi/po/bs/hellolib.po +23 -0
- data/samples/cgi/po/bs/main.po +83 -0
- data/samples/cgi/po/hr/helloerb1.po +59 -0
- data/samples/cgi/po/hr/helloerb2.po +51 -0
- data/samples/cgi/po/hr/hellolib.po +23 -0
- data/samples/cgi/po/hr/main.po +83 -0
- data/samples/cgi/po/nb/helloerb1.po +58 -0
- data/samples/cgi/po/nb/helloerb2.po +50 -0
- data/samples/cgi/po/nb/hellolib.po +22 -0
- data/samples/cgi/po/nb/main.po +82 -0
- data/samples/cgi/po/vi/helloerb1.po +65 -0
- data/samples/cgi/po/vi/helloerb2.po +52 -0
- data/samples/cgi/po/vi/hellolib.po +24 -0
- data/samples/cgi/po/vi/main.po +77 -0
- data/samples/locale/bs/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/bs/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/bs/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/bs/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/bs/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/bs/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/bs/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/locale/hr/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/hr/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/hr/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/hr/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/hr/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/hr/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/hr/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/locale/ja/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/nb/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/nb/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/nb/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/nb/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/nb/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/nb/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/nb/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/locale/vi/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/vi/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/vi/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/vi/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/vi/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/vi/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/vi/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/po/bs/hello.po +23 -0
- data/samples/po/bs/hello2.po +31 -0
- data/samples/po/bs/hello_noop.po +27 -0
- data/samples/po/bs/hello_plural.po +26 -0
- data/samples/po/bs/helloglade2.po +31 -0
- data/samples/po/bs/hellogtk.po +23 -0
- data/samples/po/bs/hellotk.po +23 -0
- data/samples/po/hr/hello.po +23 -0
- data/samples/po/hr/hello2.po +31 -0
- data/samples/po/hr/hello_noop.po +27 -0
- data/samples/po/hr/hello_plural.po +26 -0
- data/samples/po/hr/helloglade2.po +31 -0
- data/samples/po/hr/hellogtk.po +23 -0
- data/samples/po/hr/hellotk.po +23 -0
- data/samples/po/ja/hello_plural.po +1 -1
- data/samples/po/nb/hello.po +22 -0
- data/samples/po/nb/hello2.po +31 -0
- data/samples/po/nb/hello_noop.po +26 -0
- data/samples/po/nb/hello_plural.po +24 -0
- data/samples/po/nb/helloglade2.po +30 -0
- data/samples/po/nb/hellogtk.po +22 -0
- data/samples/po/nb/hellotk.po +22 -0
- data/samples/po/vi/hello.po +23 -0
- data/samples/po/vi/hello2.po +31 -0
- data/samples/po/vi/hello_noop.po +27 -0
- data/samples/po/vi/hello_plural.po +26 -0
- data/samples/po/vi/helloglade2.po +38 -0
- data/samples/po/vi/hellogtk.po +23 -0
- data/samples/po/vi/hellotk.po +24 -0
- data/samples/rails/locale/bs/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/hr/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/nb/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/vi/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/po/bs/blog.po +106 -0
- data/samples/rails/po/hr/blog.po +106 -0
- data/samples/rails/po/nb/blog.po +104 -0
- data/samples/rails/po/vi/blog.po +110 -0
- data/samples/rails/vendor/plugins/gettext/locale/bs/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/vendor/plugins/gettext/locale/hr/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/vendor/plugins/gettext/locale/nb/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/vendor/plugins/gettext/locale/vi/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/vendor/plugins/gettext/po/bs/gettext_plugin.po +27 -0
- data/samples/rails/vendor/plugins/gettext/po/hr/gettext_plugin.po +27 -0
- data/samples/rails/vendor/plugins/gettext/po/nb/gettext_plugin.po +27 -0
- data/samples/rails/vendor/plugins/gettext/po/vi/gettext_plugin.po +28 -0
- data/src/poparser.ry +9 -4
- data/test/README +2 -0
- data/test/Rakefile +2 -0
- data/test/gettext_test.rb +51 -13
- data/test/gettext_test_active_record.rb +33 -0
- data/test/gettext_test_parser.rb +5 -0
- data/test/gettext_test_rails_caching.rb +211 -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/ja/LC_MESSAGES/plural.mo +0 -0
- data/test/locale/ja/LC_MESSAGES/plural_error.mo +0 -0
- data/test/locale/ja/LC_MESSAGES/test_nsgettext.mo +0 -0
- data/test/locale/la/LC_MESSAGES/plural_error.mo +0 -0
- data/test/po/da/plural_error.po +3 -3
- data/test/po/fr/plural.po +6 -0
- data/test/po/fr/plural_error.po +3 -3
- data/test/po/ja/plural.po +6 -0
- data/test/po/ja/plural_error.po +2 -2
- data/test/po/ja/test_nsgettext.po +65 -0
- data/test/po/la/plural_error.po +3 -3
- data/test/rails/README +5 -0
- data/test/rails/Rakefile +35 -0
- data/test/rails/app/controllers/application.rb +8 -0
- data/test/rails/app/controllers/articles_controller.rb +61 -0
- data/test/rails/app/controllers/mailer_controller.rb +19 -0
- data/test/rails/app/helpers/application_helper.rb +3 -0
- data/test/rails/app/helpers/articles_helper.rb +2 -0
- data/test/rails/app/helpers/mailer_helper.rb +2 -0
- data/test/rails/app/models/article.rb +5 -0
- data/test/rails/app/models/mailer.rb +38 -0
- data/test/rails/app/models/user.rb +3 -0
- data/test/rails/app/views/articles/_form.rhtml +13 -0
- data/test/rails/app/views/articles/edit.rhtml +9 -0
- data/test/rails/app/views/articles/list.rhtml +30 -0
- data/test/rails/app/views/articles/list_fr.rhtml +1 -0
- data/test/rails/app/views/articles/multi_error_messages_for.rhtml +19 -0
- data/test/rails/app/views/articles/new.rhtml +8 -0
- data/test/rails/app/views/articles/show.rhtml +28 -0
- data/test/rails/app/views/layouts/application.rhtml +14 -0
- data/test/rails/app/views/layouts/mailer.rhtml +20 -0
- data/test/rails/app/views/mailer/coverpage.rhtml +6 -0
- data/test/rails/app/views/mailer/coverpage_fr.rhtml +6 -0
- data/test/rails/app/views/mailer/singlepart.rhtml +3 -0
- data/test/rails/app/views/mailer/singlepart_fr.rhtml +3 -0
- data/test/rails/config/boot.rb +45 -0
- data/test/rails/config/database.yml +36 -0
- data/test/rails/config/environment.rb +64 -0
- data/test/rails/config/environments/development.rb +21 -0
- data/test/rails/config/environments/production.rb +18 -0
- data/test/rails/config/environments/test.rb +19 -0
- data/test/rails/config/routes.rb +23 -0
- data/test/rails/db/schema.rb +27 -0
- data/test/rails/po/ja/rails_test.po +142 -0
- data/test/rails/po/rails_test.pot +147 -0
- data/test/rails/public/404.html +30 -0
- data/test/rails/public/500.html +30 -0
- data/test/rails/public/dispatch.cgi +10 -0
- data/test/rails/public/dispatch.fcgi +24 -0
- data/test/rails/public/dispatch.rb +10 -0
- data/test/rails/public/favicon.ico +0 -0
- data/test/rails/public/images/rails.png +0 -0
- data/test/rails/public/index.html +277 -0
- data/test/rails/public/javascripts/application.js +2 -0
- data/test/rails/public/javascripts/controls.js +833 -0
- data/test/rails/public/javascripts/dragdrop.js +942 -0
- data/test/rails/public/javascripts/effects.js +1088 -0
- data/test/rails/public/javascripts/prototype.js +2515 -0
- data/test/rails/public/robots.txt +1 -0
- data/test/rails/public/stylesheets/scaffold.css +74 -0
- data/test/rails/script/about +3 -0
- data/test/rails/script/breakpointer +3 -0
- data/test/rails/script/console +3 -0
- data/test/rails/script/destroy +3 -0
- data/test/rails/script/generate +3 -0
- data/test/rails/script/performance/benchmarker +3 -0
- data/test/rails/script/performance/profiler +3 -0
- data/test/rails/script/plugin +3 -0
- data/test/rails/script/process/inspector +3 -0
- data/test/rails/script/process/reaper +3 -0
- data/test/rails/script/process/spawner +3 -0
- data/test/rails/script/runner +3 -0
- data/test/rails/script/server +3 -0
- data/test/rails/test/fixtures/articles.yml +11 -0
- data/test/rails/test/functional/articles_controller_test.rb +109 -0
- data/test/rails/test/functional/mailer_controller_test.rb +93 -0
- data/test/rails/test/integration/general_stories_test.rb +58 -0
- data/test/rails/test/result/en/create_error.html +95 -0
- data/test/rails/test/result/en/list.html +65 -0
- data/test/rails/test/result/en/multi_error_messages_for.html +153 -0
- data/test/rails/test/result/en/multipart.html +67 -0
- data/test/rails/test/result/en/new.html +95 -0
- data/test/rails/test/result/en/show.html +50 -0
- data/test/rails/test/result/en/singlepart.html +10 -0
- data/test/rails/test/result/fr/list.html +15 -0
- data/test/rails/test/result/fr/multipart.html +67 -0
- data/test/rails/test/result/fr/singlepart.html +10 -0
- data/test/rails/test/result/ja/create_error.html +95 -0
- data/test/rails/test/result/ja/list.html +65 -0
- data/test/rails/test/result/ja/multi_error_messages_for.html +153 -0
- data/test/rails/test/result/ja/multipart.html +67 -0
- data/test/rails/test/result/ja/new.html +95 -0
- data/test/rails/test/result/ja/show.html +50 -0
- data/test/rails/test/result/ja/singlepart.html +10 -0
- data/test/rails/test/test_helper.rb +28 -0
- data/test/rails/test/unit/article_test.rb +18 -0
- data/test/test.sh +4 -0
- data/test/test_nsgettext.rb +44 -0
- data/test/test_rubyparser_n_.rb +10 -0
- metadata +317 -20
- data/ext/gettext/locale_system-i386-mswin32.def +0 -2
- data/ext/gettext/locale_system-i386-mswin32.exp +0 -0
- data/ext/gettext/locale_system-i386-mswin32.lib +0 -0
- data/ext/gettext/locale_system-i386-mswin32.pdb +0 -0
- data/ext/gettext/locale_system.obj +0 -0
- data/ext/gettext/vc70.pdb +0 -0
- data/samples/rails/locale/cs/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/de/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/el/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/es/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/fr/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/ja/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/ko/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/nl/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/pt_BR/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/ru/LC_MESSAGES/gettext_plugin.mo +0 -0
data/lib/gettext/poparser.rb
CHANGED
@@ -1,298 +1,303 @@
|
|
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.5
|
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
|
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
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
@
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
0,
|
113
|
-
|
114
|
-
2, 9, :_reduce_none,
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
9,
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
:
|
165
|
-
:
|
166
|
-
:
|
167
|
-
:
|
168
|
-
:
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
'
|
193
|
-
'
|
194
|
-
'
|
195
|
-
'
|
196
|
-
'
|
197
|
-
'
|
198
|
-
'
|
199
|
-
'
|
200
|
-
'
|
201
|
-
'
|
202
|
-
'
|
203
|
-
'
|
204
|
-
'
|
205
|
-
'
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
$stderr.print "
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
$stderr.print "
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
.,.,
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
.,.,
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
.,.,
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
.,.,
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
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.5
|
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..id99edf64163', 'src/poparser.ry', 94
|
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 exists.\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
|
+
if msgstr.size > 0
|
96
|
+
@data[msgid] = msgstr
|
97
|
+
@data.set_comment(msgid, @comments.join("\n"))
|
98
|
+
end
|
99
|
+
@comments.clear
|
100
|
+
end
|
101
|
+
|
102
|
+
def on_comment(comment)
|
103
|
+
@fuzzy = true if (/fuzzy/ =~ comment)
|
104
|
+
@comments << comment
|
105
|
+
end
|
106
|
+
|
107
|
+
..end src/poparser.ry modeval..id99edf64163
|
108
|
+
|
109
|
+
##### racc 1.4.5 generates ###
|
110
|
+
|
111
|
+
racc_reduce_table = [
|
112
|
+
0, 0, :racc_error,
|
113
|
+
0, 9, :_reduce_none,
|
114
|
+
2, 9, :_reduce_none,
|
115
|
+
2, 9, :_reduce_none,
|
116
|
+
4, 11, :_reduce_4,
|
117
|
+
5, 11, :_reduce_5,
|
118
|
+
2, 13, :_reduce_6,
|
119
|
+
1, 13, :_reduce_none,
|
120
|
+
3, 14, :_reduce_8,
|
121
|
+
1, 10, :_reduce_9,
|
122
|
+
2, 12, :_reduce_10,
|
123
|
+
1, 12, :_reduce_11 ]
|
124
|
+
|
125
|
+
racc_reduce_n = 12
|
126
|
+
|
127
|
+
racc_shift_n = 21
|
128
|
+
|
129
|
+
racc_action_table = [
|
130
|
+
3, 9, 4, 5, 10, 11, 12, 17, 12, 9,
|
131
|
+
9, 7, 12, 17, 19, 9, 12 ]
|
132
|
+
|
133
|
+
racc_action_check = [
|
134
|
+
1, 5, 1, 1, 8, 8, 8, 13, 13, 10,
|
135
|
+
11, 3, 14, 15, 17, 19, 20 ]
|
136
|
+
|
137
|
+
racc_action_pointer = [
|
138
|
+
nil, 0, nil, 11, nil, -5, nil, nil, 0, nil,
|
139
|
+
3, 4, nil, 2, 6, 8, nil, 7, nil, 9,
|
140
|
+
10 ]
|
141
|
+
|
142
|
+
racc_action_default = [
|
143
|
+
-1, -12, -3, -12, -9, -12, -2, 21, -12, -11,
|
144
|
+
-12, -12, -10, -12, -4, -5, -7, -12, -6, -12,
|
145
|
+
-8 ]
|
146
|
+
|
147
|
+
racc_goto_table = [
|
148
|
+
8, 16, 2, 18, 6, 13, 14, 15, 1, nil,
|
149
|
+
nil, nil, nil, nil, 20 ]
|
150
|
+
|
151
|
+
racc_goto_check = [
|
152
|
+
4, 6, 3, 6, 2, 4, 4, 5, 1, nil,
|
153
|
+
nil, nil, nil, nil, 4 ]
|
154
|
+
|
155
|
+
racc_goto_pointer = [
|
156
|
+
nil, 8, 3, 1, -5, -6, -12 ]
|
157
|
+
|
158
|
+
racc_goto_default = [
|
159
|
+
nil, nil, nil, nil, nil, nil, nil ]
|
160
|
+
|
161
|
+
racc_token_table = {
|
162
|
+
false => 0,
|
163
|
+
Object.new => 1,
|
164
|
+
:COMMENT => 2,
|
165
|
+
:MSGID => 3,
|
166
|
+
:MSGID_PLURAL => 4,
|
167
|
+
:MSGSTR => 5,
|
168
|
+
:STRING => 6,
|
169
|
+
:PLURAL_NUM => 7 }
|
170
|
+
|
171
|
+
racc_use_result_var = true
|
172
|
+
|
173
|
+
racc_nt_base = 8
|
174
|
+
|
175
|
+
Racc_arg = [
|
176
|
+
racc_action_table,
|
177
|
+
racc_action_check,
|
178
|
+
racc_action_default,
|
179
|
+
racc_action_pointer,
|
180
|
+
racc_goto_table,
|
181
|
+
racc_goto_check,
|
182
|
+
racc_goto_default,
|
183
|
+
racc_goto_pointer,
|
184
|
+
racc_nt_base,
|
185
|
+
racc_reduce_table,
|
186
|
+
racc_token_table,
|
187
|
+
racc_shift_n,
|
188
|
+
racc_reduce_n,
|
189
|
+
racc_use_result_var ]
|
190
|
+
|
191
|
+
Racc_token_to_s_table = [
|
192
|
+
'$end',
|
193
|
+
'error',
|
194
|
+
'COMMENT',
|
195
|
+
'MSGID',
|
196
|
+
'MSGID_PLURAL',
|
197
|
+
'MSGSTR',
|
198
|
+
'STRING',
|
199
|
+
'PLURAL_NUM',
|
200
|
+
'$start',
|
201
|
+
'msgfmt',
|
202
|
+
'comment',
|
203
|
+
'message',
|
204
|
+
'string_list',
|
205
|
+
'msgstr_plural',
|
206
|
+
'msgstr_plural_line']
|
207
|
+
|
208
|
+
Racc_debug_parser = true
|
209
|
+
|
210
|
+
##### racc system variables end #####
|
211
|
+
|
212
|
+
# reduce 0 omitted
|
213
|
+
|
214
|
+
# reduce 1 omitted
|
215
|
+
|
216
|
+
# reduce 2 omitted
|
217
|
+
|
218
|
+
# reduce 3 omitted
|
219
|
+
|
220
|
+
module_eval <<'.,.,', 'src/poparser.ry', 36
|
221
|
+
def _reduce_4( val, _values, result )
|
222
|
+
if @fuzzy and $ignore_fuzzy
|
223
|
+
if val[1] != ""
|
224
|
+
$stderr.print _("Warning: fuzzy message was ignored.\n")
|
225
|
+
$stderr.print " msgid '#{val[1]}'\n"
|
226
|
+
else
|
227
|
+
on_message('', unescape(val[3]))
|
228
|
+
end
|
229
|
+
@fuzzy = false
|
230
|
+
else
|
231
|
+
on_message(unescape(val[1]), unescape(val[3]))
|
232
|
+
end
|
233
|
+
result = ""
|
234
|
+
result
|
235
|
+
end
|
236
|
+
.,.,
|
237
|
+
|
238
|
+
module_eval <<'.,.,', 'src/poparser.ry', 51
|
239
|
+
def _reduce_5( val, _values, result )
|
240
|
+
if @fuzzy and $ignore_fuzzy
|
241
|
+
if val[1] != ""
|
242
|
+
$stderr.print _("Warning: fuzzy message was ignored.\n")
|
243
|
+
$stderr.print "msgid = '#{val[1]}\n"
|
244
|
+
else
|
245
|
+
on_message('', unescape(val[3]))
|
246
|
+
end
|
247
|
+
@fuzzy = false
|
248
|
+
else
|
249
|
+
on_message(unescape(val[1]) + "\000" + unescape(val[3]), unescape(val[4]))
|
250
|
+
end
|
251
|
+
result = ""
|
252
|
+
result
|
253
|
+
end
|
254
|
+
.,.,
|
255
|
+
|
256
|
+
module_eval <<'.,.,', 'src/poparser.ry', 62
|
257
|
+
def _reduce_6( val, _values, result )
|
258
|
+
if val[0].size > 0
|
259
|
+
result = val[0] + "\000" + val[1]
|
260
|
+
else
|
261
|
+
result = ""
|
262
|
+
end
|
263
|
+
result
|
264
|
+
end
|
265
|
+
.,.,
|
266
|
+
|
267
|
+
# reduce 7 omitted
|
268
|
+
|
269
|
+
module_eval <<'.,.,', 'src/poparser.ry', 70
|
270
|
+
def _reduce_8( val, _values, result )
|
271
|
+
result = val[2]
|
272
|
+
result
|
273
|
+
end
|
274
|
+
.,.,
|
275
|
+
|
276
|
+
module_eval <<'.,.,', 'src/poparser.ry', 77
|
277
|
+
def _reduce_9( val, _values, result )
|
278
|
+
on_comment(val[0])
|
279
|
+
result
|
280
|
+
end
|
281
|
+
.,.,
|
282
|
+
|
283
|
+
module_eval <<'.,.,', 'src/poparser.ry', 85
|
284
|
+
def _reduce_10( val, _values, result )
|
285
|
+
result = val.delete_if{|item| item == ""}.join
|
286
|
+
result
|
287
|
+
end
|
288
|
+
.,.,
|
289
|
+
|
290
|
+
module_eval <<'.,.,', 'src/poparser.ry', 89
|
291
|
+
def _reduce_11( val, _values, result )
|
292
|
+
result = val[0]
|
293
|
+
result
|
294
|
+
end
|
295
|
+
.,.,
|
296
|
+
|
297
|
+
def _reduce_none( val, _values, result )
|
298
|
+
result
|
299
|
+
end
|
300
|
+
|
301
|
+
end # class PoParser
|
302
|
+
|
303
|
+
end # module GetText
|