gettext 2.2.1 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +2 -1
- data/README.rdoc +9 -9
- data/Rakefile +94 -149
- data/bin/rmsgfmt +23 -20
- data/bin/rmsginit +29 -0
- data/bin/rmsgmerge +22 -20
- data/bin/rxgettext +24 -0
- data/doc/text/news.md +60 -0
- data/gettext.gemspec +7 -4
- data/lib/gettext.rb +3 -3
- data/lib/gettext/core_ext/string.rb +2 -1
- data/lib/gettext/runtime/locale_path.rb +6 -4
- data/lib/gettext/runtime/textdomain.rb +14 -8
- data/lib/gettext/runtime/textdomain_manager.rb +3 -3
- data/lib/gettext/task.rb +203 -0
- data/lib/gettext/tools.rb +33 -24
- data/lib/gettext/tools/msgfmt.rb +104 -0
- data/lib/gettext/tools/msginit.rb +363 -0
- data/lib/gettext/tools/msgmerge.rb +510 -0
- data/lib/gettext/tools/parser/ruby.rb +12 -17
- data/lib/gettext/tools/pomessage.rb +37 -4
- data/lib/gettext/tools/poparser.rb +27 -24
- data/lib/gettext/tools/xgettext.rb +327 -0
- data/lib/gettext/version.rb +2 -2
- data/po/bg/rgettext.po +2 -2
- data/po/bs/rgettext.po +2 -2
- data/po/ca/rgettext.po +2 -2
- data/po/cs/rgettext.po +2 -2
- data/po/de/gettext.po +668 -0
- data/po/de/gettext.po.bak +589 -0
- data/po/de/rgettext.po +2 -2
- data/po/el/gettext.po +571 -0
- data/po/el/rgettext.po +2 -2
- data/po/eo/rgettext.po +2 -2
- data/po/es/rgettext.po +2 -2
- data/po/et/rgettext.po +2 -2
- data/po/fr/gettext.po +589 -0
- data/po/fr/rgettext.po +2 -2
- data/po/gettext.pot +638 -0
- data/po/gettext.pot~ +638 -0
- data/po/hr/rgettext.po +2 -2
- data/po/hu/rgettext.po +2 -2
- data/po/it/gettext.po +589 -0
- data/po/it/rgettext.po +2 -2
- data/po/ja/gettext.po +591 -0
- data/po/ja/rgettext.po +112 -69
- data/po/ko/rgettext.po +2 -2
- data/po/lv/rgettext.po +2 -2
- data/po/nb/rgettext.po +2 -2
- data/po/nl/rgettext.po +2 -2
- data/po/pt_BR/rgettext.po +2 -2
- data/po/ru/rgettext.po +2 -2
- data/po/sr/rgettext.po +2 -2
- data/po/sv/rgettext.po +2 -2
- data/po/uk/gettext.po +571 -0
- data/po/uk/rgettext.po +2 -2
- data/po/vi/rgettext.po +2 -2
- data/po/zh/rgettext.po +2 -2
- data/po/zh_TW/rgettext.po +2 -2
- data/samples/README +2 -4
- data/samples/cgi/README +1 -1
- data/samples/cgi/cookie.cgi +1 -1
- data/samples/cgi/gettext.css +1 -1
- data/samples/cgi/helloerb.rhtml +1 -1
- data/samples/cgi/hellolib.rb +1 -1
- data/samples/cgi/http.rb +2 -2
- data/samples/cgi/index.cgi +1 -1
- data/samples/cgi/locale/bg/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/bg/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/bg/LC_MESSAGES/main.mo +0 -0
- 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/main.mo +0 -0
- data/samples/cgi/locale/ca/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/ca/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/ca/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/cs/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/cs/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/cs/LC_MESSAGES/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/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/main.mo +0 -0
- data/samples/cgi/locale/eo/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/eo/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/eo/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/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/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/main.mo +0 -0
- data/samples/cgi/locale/hu/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/hu/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/hu/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/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/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/main.mo +0 -0
- data/samples/cgi/locale/lv/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/lv/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/lv/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/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/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/main.mo +0 -0
- data/samples/cgi/locale/ru/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/ru/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/ru/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/sr/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/sr/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/sr/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/uk/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/uk/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/uk/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/main.mo +0 -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/main.mo +0 -0
- data/samples/cgi/locale/zh_TW/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/zh_TW/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/zh_TW/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/other.rhtml +1 -1
- data/samples/cgi/po/bg/helloerb1.po +4 -4
- data/samples/cgi/po/bg/helloerb2.po +4 -4
- data/samples/cgi/po/bg/hellolib.po +2 -2
- data/samples/cgi/po/bg/main.po +4 -4
- data/samples/cgi/po/bs/helloerb1.po +3 -3
- data/samples/cgi/po/bs/helloerb2.po +3 -3
- data/samples/cgi/po/bs/hellolib.po +2 -2
- data/samples/cgi/po/bs/main.po +3 -3
- data/samples/cgi/po/ca/helloerb1.po +4 -4
- data/samples/cgi/po/ca/helloerb2.po +4 -4
- data/samples/cgi/po/ca/hellolib.po +2 -2
- data/samples/cgi/po/ca/main.po +4 -4
- data/samples/cgi/po/cs/helloerb1.po +4 -4
- data/samples/cgi/po/cs/helloerb2.po +4 -4
- data/samples/cgi/po/cs/hellolib.po +2 -2
- data/samples/cgi/po/cs/main.po +4 -4
- data/samples/cgi/po/de/helloerb1.po +3 -3
- data/samples/cgi/po/de/helloerb2.po +3 -3
- data/samples/cgi/po/de/hellolib.po +2 -2
- data/samples/cgi/po/de/main.po +3 -3
- data/samples/cgi/po/el/helloerb1.po +3 -3
- data/samples/cgi/po/el/helloerb2.po +3 -3
- data/samples/cgi/po/el/hellolib.po +2 -2
- data/samples/cgi/po/el/main.po +3 -3
- data/samples/cgi/po/eo/helloerb1.po +3 -3
- data/samples/cgi/po/eo/helloerb2.po +3 -3
- data/samples/cgi/po/eo/hellolib.po +2 -2
- data/samples/cgi/po/eo/main.po +3 -3
- data/samples/cgi/po/es/helloerb1.po +4 -4
- data/samples/cgi/po/es/helloerb2.po +4 -4
- data/samples/cgi/po/es/hellolib.po +2 -2
- data/samples/cgi/po/es/main.po +4 -4
- data/samples/cgi/po/fr/helloerb1.po +4 -4
- data/samples/cgi/po/fr/helloerb2.po +4 -4
- data/samples/cgi/po/fr/hellolib.po +2 -2
- data/samples/cgi/po/fr/main.po +4 -4
- data/samples/cgi/po/hr/helloerb1.po +3 -3
- data/samples/cgi/po/hr/helloerb2.po +3 -3
- data/samples/cgi/po/hr/hellolib.po +2 -2
- data/samples/cgi/po/hr/main.po +3 -3
- data/samples/cgi/po/hu/helloerb1.po +4 -4
- data/samples/cgi/po/hu/helloerb2.po +4 -4
- data/samples/cgi/po/hu/hellolib.po +2 -2
- data/samples/cgi/po/hu/main.po +4 -4
- data/samples/cgi/po/it/helloerb1.po +3 -3
- data/samples/cgi/po/it/helloerb2.po +3 -3
- data/samples/cgi/po/it/hellolib.po +2 -2
- data/samples/cgi/po/it/main.po +3 -3
- data/samples/cgi/po/ja/helloerb1.po +4 -4
- data/samples/cgi/po/ja/helloerb2.po +4 -4
- data/samples/cgi/po/ja/hellolib.po +2 -2
- data/samples/cgi/po/ja/main.po +3 -3
- data/samples/cgi/po/ko/helloerb1.po +3 -3
- data/samples/cgi/po/ko/helloerb2.po +3 -3
- data/samples/cgi/po/ko/hellolib.po +2 -2
- data/samples/cgi/po/ko/main.po +3 -3
- data/samples/cgi/po/lv/helloerb1.po +4 -4
- data/samples/cgi/po/lv/helloerb2.po +4 -4
- data/samples/cgi/po/lv/hellolib.po +2 -2
- data/samples/cgi/po/lv/main.po +4 -4
- data/samples/cgi/po/nb/helloerb1.po +3 -3
- data/samples/cgi/po/nb/helloerb2.po +3 -3
- data/samples/cgi/po/nb/hellolib.po +2 -2
- data/samples/cgi/po/nb/main.po +3 -3
- data/samples/cgi/po/nl/helloerb1.po +4 -4
- data/samples/cgi/po/nl/helloerb2.po +4 -4
- data/samples/cgi/po/nl/hellolib.po +2 -2
- data/samples/cgi/po/nl/main.po +4 -4
- data/samples/cgi/po/pt_BR/helloerb1.po +4 -4
- data/samples/cgi/po/pt_BR/helloerb2.po +4 -4
- data/samples/cgi/po/pt_BR/hellolib.po +2 -2
- data/samples/cgi/po/pt_BR/main.po +4 -4
- data/samples/cgi/po/ru/helloerb1.po +4 -4
- data/samples/cgi/po/ru/helloerb2.po +4 -4
- data/samples/cgi/po/ru/hellolib.po +2 -2
- data/samples/cgi/po/ru/main.po +4 -4
- data/samples/cgi/po/sr/helloerb1.po +4 -4
- data/samples/cgi/po/sr/helloerb2.po +4 -4
- data/samples/cgi/po/sr/hellolib.po +2 -2
- data/samples/cgi/po/sr/main.po +4 -4
- data/samples/cgi/po/uk/helloerb1.po +4 -4
- data/samples/cgi/po/uk/helloerb2.po +4 -4
- data/samples/cgi/po/uk/hellolib.po +2 -2
- data/samples/cgi/po/uk/main.po +4 -4
- data/samples/cgi/po/vi/helloerb1.po +3 -3
- data/samples/cgi/po/vi/helloerb2.po +3 -3
- data/samples/cgi/po/vi/hellolib.po +2 -2
- data/samples/cgi/po/vi/main.po +3 -3
- data/samples/cgi/po/zh/helloerb1.po +4 -4
- data/samples/cgi/po/zh/helloerb2.po +4 -4
- data/samples/cgi/po/zh/hellolib.po +2 -2
- data/samples/cgi/po/zh/main.po +4 -4
- data/samples/cgi/po/zh_TW/helloerb1.po +4 -4
- data/samples/cgi/po/zh_TW/helloerb2.po +4 -4
- data/samples/cgi/po/zh_TW/hellolib.po +2 -2
- data/samples/cgi/po/zh_TW/main.po +4 -4
- data/samples/hello.rb +1 -1
- data/samples/hello2.rb +1 -1
- data/samples/hello_glade2.rb +1 -1
- data/samples/hello_gtk2.rb +2 -2
- data/samples/hello_noop.rb +1 -1
- data/samples/hello_plural.rb +1 -1
- data/samples/hello_tk.rb +1 -1
- data/samples/locale/bg/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/bs/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/ca/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/cs/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/de/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/el/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/eo/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/es/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/fr/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/hr/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/hu/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/it/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/ja/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/ko/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/lv/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/nb/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/nl/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/pt_BR/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/ru/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/sr/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/sv/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/uk/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/vi/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/zh/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/locale/zh_TW/LC_MESSAGES/hello_gtk2.mo +0 -0
- data/samples/po/bg/hello.po +2 -2
- data/samples/po/bg/hello2.po +1 -1
- data/samples/po/bg/hello_glade2.po +1 -1
- data/samples/po/bg/{hello_gtk.po → hello_gtk2.po} +1 -1
- data/samples/po/bg/hello_noop.po +1 -1
- data/samples/po/bg/hello_plural.po +1 -1
- data/samples/po/bg/hello_tk.po +1 -1
- data/samples/po/bs/hello.po +2 -2
- data/samples/po/bs/hello2.po +1 -1
- data/samples/po/bs/hello_glade2.po +1 -1
- data/samples/po/bs/{hello_gtk.po → hello_gtk2.po} +1 -1
- data/samples/po/bs/hello_noop.po +1 -1
- data/samples/po/bs/hello_plural.po +1 -1
- data/samples/po/bs/hello_tk.po +1 -1
- data/samples/po/ca/hello.po +2 -2
- data/samples/po/ca/hello2.po +1 -1
- data/samples/po/ca/hello_glade2.po +1 -1
- data/samples/po/ca/{hello_gtk.po → hello_gtk2.po} +1 -1
- data/samples/po/ca/hello_noop.po +1 -1
- data/samples/po/ca/hello_plural.po +1 -1
- data/samples/po/ca/hello_tk.po +1 -1
- data/samples/po/cs/hello.po +1 -1
- data/samples/po/cs/hello_glade2.po +1 -1
- data/samples/po/cs/{hello_gtk.po → hello_gtk2.po} +0 -0
- data/samples/po/cs/hello_plural.po +1 -1
- data/samples/po/de/hello.po +1 -1
- data/samples/po/de/{hello_gtk.po → hello_gtk2.po} +0 -0
- data/samples/po/de/hello_plural.po +1 -1
- data/samples/po/el/hello.po +2 -2
- data/samples/po/el/hello2.po +1 -1
- data/samples/po/el/hello_glade2.po +1 -1
- data/samples/po/el/{hello_gtk.po → hello_gtk2.po} +1 -1
- data/samples/po/el/hello_noop.po +1 -1
- data/samples/po/el/hello_plural.po +1 -1
- data/samples/po/el/hello_tk.po +1 -1
- data/samples/po/eo/hello.po +2 -2
- data/samples/po/eo/hello2.po +1 -1
- data/samples/po/eo/hello_glade2.po +1 -1
- data/samples/po/eo/{hello_gtk.po → hello_gtk2.po} +1 -1
- data/samples/po/eo/hello_noop.po +1 -1
- data/samples/po/eo/hello_plural.po +1 -1
- data/samples/po/eo/hello_tk.po +1 -1
- data/samples/po/es/{hello_gtk.po → hello_gtk2.po} +0 -0
- data/samples/po/fr/{hello_gtk.po → hello_gtk2.po} +0 -0
- data/samples/po/hello.pot +13 -13
- data/samples/po/hello2.pot +17 -17
- data/samples/po/hello_glade2.pot +12 -13
- data/{test/pot/backslash.pot → samples/po/hello_gtk2.pot} +8 -6
- data/samples/po/hello_noop.pot +13 -13
- data/samples/po/hello_plural.pot +14 -15
- data/samples/po/hello_tk.pot +9 -10
- data/samples/po/hr/hello.po +2 -2
- data/samples/po/hr/hello2.po +1 -1
- data/samples/po/hr/hello_glade2.po +1 -1
- data/samples/po/hr/{hello_gtk.po → hello_gtk2.po} +1 -1
- data/samples/po/hr/hello_noop.po +1 -1
- data/samples/po/hr/hello_plural.po +1 -1
- data/samples/po/hr/hello_tk.po +1 -1
- data/samples/po/hu/hello.po +2 -2
- data/samples/po/hu/hello2.po +1 -1
- data/samples/po/hu/hello_glade2.po +1 -1
- data/samples/po/hu/{hello_gtk.po → hello_gtk2.po} +1 -1
- data/samples/po/hu/hello_noop.po +1 -1
- data/samples/po/hu/hello_plural.po +1 -1
- data/samples/po/hu/hello_tk.po +1 -1
- data/samples/po/it/hello.po +1 -1
- data/samples/po/it/{hello_gtk.po → hello_gtk2.po} +0 -0
- data/samples/po/ja/{hello_gtk.po → hello_gtk2.po} +0 -0
- data/samples/po/ko/{hello_gtk.po → hello_gtk2.po} +0 -0
- data/samples/po/ko/hello_plural.po +1 -1
- data/samples/po/lv/hello.po +2 -2
- data/samples/po/lv/hello2.po +1 -1
- data/samples/po/lv/hello_glade2.po +1 -1
- data/samples/po/lv/{hello_gtk.po → hello_gtk2.po} +1 -1
- data/samples/po/lv/hello_noop.po +1 -1
- data/samples/po/lv/hello_plural.po +1 -1
- data/samples/po/lv/hello_tk.po +1 -1
- data/samples/po/nb/hello.po +2 -2
- data/samples/po/nb/hello2.po +1 -1
- data/samples/po/nb/hello_glade2.po +1 -1
- data/samples/po/nb/{hello_gtk.po → hello_gtk2.po} +1 -1
- data/samples/po/nb/hello_noop.po +1 -1
- data/samples/po/nb/hello_plural.po +1 -1
- data/samples/po/nb/hello_tk.po +1 -1
- data/samples/po/nl/hello.po +2 -2
- data/samples/po/nl/hello2.po +1 -1
- data/samples/po/nl/hello_glade2.po +1 -1
- data/samples/po/nl/{hello_gtk.po → hello_gtk2.po} +1 -1
- data/samples/po/nl/hello_noop.po +1 -1
- data/samples/po/nl/hello_plural.po +1 -1
- data/samples/po/nl/hello_tk.po +1 -1
- data/samples/po/pt_BR/{hello_gtk.po → hello_gtk2.po} +0 -0
- data/samples/po/ru/hello.po +2 -2
- data/samples/po/ru/hello2.po +1 -1
- data/samples/po/ru/hello_glade2.po +1 -1
- data/samples/po/ru/{hello_gtk.po → hello_gtk2.po} +1 -1
- data/samples/po/ru/hello_noop.po +1 -1
- data/samples/po/ru/hello_plural.po +1 -1
- data/samples/po/ru/hello_tk.po +1 -1
- data/samples/po/sr/hello.po +2 -2
- data/samples/po/sr/hello2.po +1 -1
- data/samples/po/sr/hello_glade2.po +1 -1
- data/samples/po/sr/{hello_gtk.po → hello_gtk2.po} +1 -1
- data/samples/po/sr/hello_noop.po +1 -1
- data/samples/po/sr/hello_plural.po +1 -1
- data/samples/po/sr/hello_tk.po +1 -1
- data/samples/po/sv/{hello_gtk.po → hello_gtk2.po} +0 -0
- data/samples/po/uk/hello.po +2 -2
- data/samples/po/uk/hello2.po +1 -1
- data/samples/po/uk/hello_glade2.po +1 -1
- data/samples/po/uk/{hello_gtk.po → hello_gtk2.po} +1 -1
- data/samples/po/uk/hello_noop.po +1 -1
- data/samples/po/uk/hello_plural.po +1 -1
- data/samples/po/uk/hello_tk.po +1 -1
- data/samples/po/vi/hello.po +2 -2
- data/samples/po/vi/hello2.po +1 -1
- data/samples/po/vi/hello_glade2.po +1 -1
- data/samples/po/vi/{hello_gtk.po → hello_gtk2.po} +1 -1
- data/samples/po/vi/hello_noop.po +1 -1
- data/samples/po/vi/hello_plural.po +1 -1
- data/samples/po/vi/hello_tk.po +1 -1
- data/samples/po/zh/hello.po +2 -2
- data/samples/po/zh/hello2.po +1 -1
- data/samples/po/zh/hello_glade2.po +1 -1
- data/samples/po/zh/{hello_gtk.po → hello_gtk2.po} +1 -1
- data/samples/po/zh/hello_noop.po +1 -1
- data/samples/po/zh/hello_plural.po +1 -1
- data/samples/po/zh/hello_tk.po +1 -1
- data/samples/po/zh_TW/hello.po +2 -2
- data/samples/po/zh_TW/hello2.po +1 -1
- data/samples/po/zh_TW/hello_glade2.po +1 -1
- data/samples/po/zh_TW/{hello_gtk.po → hello_gtk2.po} +1 -1
- data/samples/po/zh_TW/hello_noop.po +1 -1
- data/samples/po/zh_TW/hello_plural.po +1 -1
- data/samples/po/zh_TW/hello_tk.po +1 -1
- data/src/poparser.ry +18 -14
- data/test/{testlib → fixtures}/N_.rb +0 -0
- data/test/{testlib/gettext.rb → fixtures/_.rb} +27 -1
- data/test/fixtures/_/one_line.rb +32 -0
- data/test/fixtures/backslash.rb +29 -0
- data/test/{testlib → fixtures}/erb.rhtml +0 -0
- data/test/{testlib → fixtures}/erb.rxml +0 -0
- data/test/{testlib → fixtures}/gladeparser.glade +0 -0
- data/test/{testlib → fixtures}/multi_textdomain.rb +0 -0
- data/test/{testlib/ngettext.rb → fixtures/n_.rb} +20 -1
- data/test/{testlib → fixtures}/non_ascii.rb +0 -0
- data/test/fixtures/np_.rb +51 -0
- data/test/{testlib/nsgettext.rb → fixtures/ns_.rb} +20 -2
- data/test/fixtures/ns_/custom.rb +32 -0
- data/test/fixtures/p_.rb +57 -0
- data/test/fixtures/s_.rb +66 -0
- data/test/fixtures/s_/custom.rb +32 -0
- data/test/{testlib → fixtures}/simple.rb +0 -0
- data/test/gettext-test-utils.rb +44 -0
- data/test/locale/ja/LC_MESSAGES/_.mo +0 -0
- data/test/locale/ja/LC_MESSAGES/backslash.mo +0 -0
- data/test/locale/ja/LC_MESSAGES/np_.mo +0 -0
- data/test/locale/ja/LC_MESSAGES/ns_.mo +0 -0
- data/test/locale/ja/LC_MESSAGES/p_.mo +0 -0
- data/test/locale/ja/LC_MESSAGES/s_.mo +0 -0
- data/test/parser/test_ruby.rb +121 -0
- data/test/po/_.pot +109 -0
- data/test/{pot/sgettext.pot → po/backslash.pot} +10 -4
- data/test/po/ja/_.po +114 -0
- data/test/po/ja/backslash.po +3 -3
- data/test/po/ja/non_ascii.po +1 -1
- data/test/po/ja/{npgettext.po → np_.po} +6 -6
- data/test/po/ja/{nsgettext.po → ns_.po} +16 -10
- data/test/po/ja/{pgettext.po → p_.po} +5 -5
- data/test/po/ja/{sgettext.po → s_.po} +0 -0
- data/test/{pot → po}/non_ascii.pot +7 -5
- data/test/{pot/npgettext.pot → po/np_.pot} +10 -9
- data/test/{pot/nsgettext.pot → po/ns_.pot} +20 -12
- data/test/{pot/pgettext.pot → po/p_.pot} +12 -10
- data/test/po/s_.pot +55 -0
- data/test/run-test.rb +5 -0
- data/test/test_class_info.rb +0 -1
- data/test/test_gettext.rb +49 -12
- data/test/test_locale_path.rb +1 -4
- data/test/test_mofile.rb +0 -1
- data/test/test_parser.rb +119 -88
- data/test/test_po_generation.rb +32 -9
- data/test/{test_pomessage.rb → test_po_message.rb} +18 -1
- data/test/test_po_parser.rb +117 -0
- data/test/test_string.rb +0 -2
- data/test/test_textdomain_bind.rb +0 -2
- data/test/test_textdomain_multi.rb +1 -2
- data/test/test_textdomain_toplevel.rb +0 -1
- data/test/test_thread.rb +0 -1
- data/test/tools/test_msginit.rb +351 -0
- data/test/tools/test_msgmerge.rb +202 -0
- data/test/tools/test_tools.rb +0 -2
- data/test/tools/test_xgettext.rb +154 -0
- metadata +822 -753
- data/bin/rgettext +0 -23
- data/data/locale/bg/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/bs/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ca/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/cs/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/de/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/el/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/eo/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/es/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/et/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/fr/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/hr/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/hu/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/it/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ja/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ko/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/lv/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/nb/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/nl/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/pt_BR/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ru/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/sr/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/sv/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/uk/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/vi/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/zh/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/zh_TW/LC_MESSAGES/rgettext.mo +0 -0
- data/lib/gettext/tools/rgettext.rb +0 -251
- data/lib/gettext/tools/rmsgfmt.rb +0 -86
- data/lib/gettext/tools/rmsgmerge.rb +0 -500
- data/samples/makemo.rb +0 -6
- data/samples/po/hello_gtk.pot +0 -23
- data/samples/po/test.rb +0 -13
- data/test/testlib/backslash.rb +0 -12
- data/test/testlib/helper.rb +0 -13
- data/test/testlib/npgettext.rb +0 -33
- data/test/testlib/pgettext.rb +0 -38
- data/test/testlib/sgettext.rb +0 -48
@@ -1,48 +1,50 @@
|
|
1
1
|
# SOME DESCRIPTIVE TITLE.
|
2
2
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3
|
-
# This file is distributed under the same license as the
|
3
|
+
# This file is distributed under the same license as the gettext package.
|
4
4
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5
5
|
#
|
6
6
|
#, fuzzy
|
7
7
|
msgid ""
|
8
8
|
msgstr ""
|
9
|
-
"Project-Id-Version:
|
10
|
-
"
|
11
|
-
"
|
9
|
+
"Project-Id-Version: gettext 2.3.0\n"
|
10
|
+
"Report-Msgid-Bugs-To: \n"
|
11
|
+
"POT-Creation-Date: 2012-08-27 16:00+0900\n"
|
12
|
+
"PO-Revision-Date: 2012-08-27 16:00+0900\n"
|
12
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15
|
+
"Language: \n"
|
14
16
|
"MIME-Version: 1.0\n"
|
15
17
|
"Content-Type: text/plain; charset=UTF-8\n"
|
16
18
|
"Content-Transfer-Encoding: 8bit\n"
|
17
19
|
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
18
20
|
|
19
|
-
#:
|
21
|
+
#: ../fixtures/p_.rb:29 ../fixtures/p_.rb:33
|
20
22
|
msgctxt "AAA"
|
21
23
|
msgid "BBB"
|
22
24
|
msgstr ""
|
23
25
|
|
24
|
-
#:
|
26
|
+
#: ../fixtures/p_.rb:37
|
25
27
|
msgctxt "AAA|BBB"
|
26
28
|
msgid "CCC"
|
27
29
|
msgstr ""
|
28
30
|
|
29
|
-
#:
|
31
|
+
#: ../fixtures/p_.rb:41
|
30
32
|
msgctxt "AAA"
|
31
33
|
msgid "CCC"
|
32
34
|
msgstr ""
|
33
35
|
|
34
|
-
#:
|
36
|
+
#: ../fixtures/p_.rb:45
|
35
37
|
msgctxt "CCC"
|
36
38
|
msgid "BBB"
|
37
39
|
msgstr ""
|
38
40
|
|
39
|
-
#:
|
41
|
+
#: ../fixtures/p_.rb:49
|
40
42
|
msgid "BBB"
|
41
43
|
msgstr ""
|
42
44
|
|
43
45
|
#. please translate 'name' in the context of 'program'.
|
44
46
|
#. Hint: the translation should NOT contain the translation of 'program'.
|
45
|
-
#:
|
47
|
+
#: ../fixtures/p_.rb:55
|
46
48
|
msgctxt "program"
|
47
49
|
msgid "name"
|
48
50
|
msgstr ""
|
data/test/po/s_.pot
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# SOME DESCRIPTIVE TITLE.
|
2
|
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3
|
+
# This file is distributed under the same license as the gettext package.
|
4
|
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5
|
+
#
|
6
|
+
#, fuzzy
|
7
|
+
msgid ""
|
8
|
+
msgstr ""
|
9
|
+
"Project-Id-Version: gettext 2.3.0\n"
|
10
|
+
"Report-Msgid-Bugs-To: \n"
|
11
|
+
"POT-Creation-Date: 2012-08-27 16:00+0900\n"
|
12
|
+
"PO-Revision-Date: 2012-08-27 16:00+0900\n"
|
13
|
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14
|
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15
|
+
"Language: \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=INTEGER; plural=EXPRESSION;\n"
|
20
|
+
|
21
|
+
#: ../fixtures/s_.rb:28 ../fixtures/s_.rb:32
|
22
|
+
msgid "AAA|BBB"
|
23
|
+
msgstr ""
|
24
|
+
|
25
|
+
#: ../fixtures/s_.rb:36
|
26
|
+
msgid "AAA"
|
27
|
+
msgstr ""
|
28
|
+
|
29
|
+
#: ../fixtures/s_.rb:40
|
30
|
+
msgid "AAA|CCC"
|
31
|
+
msgstr ""
|
32
|
+
|
33
|
+
#: ../fixtures/s_.rb:44
|
34
|
+
msgid "AAA|BBB|CCC"
|
35
|
+
msgstr ""
|
36
|
+
|
37
|
+
#: ../fixtures/s_.rb:48
|
38
|
+
msgid "AAA$BBB"
|
39
|
+
msgstr ""
|
40
|
+
|
41
|
+
#: ../fixtures/s_.rb:52
|
42
|
+
msgid "AAA$B|BB"
|
43
|
+
msgstr ""
|
44
|
+
|
45
|
+
#: ../fixtures/s_.rb:56
|
46
|
+
msgid "AAA$B|CC"
|
47
|
+
msgstr ""
|
48
|
+
|
49
|
+
#: ../fixtures/s_.rb:60
|
50
|
+
msgid "AAA|CCC|BBB"
|
51
|
+
msgstr ""
|
52
|
+
|
53
|
+
#: ../fixtures/s_/custom.rb:28
|
54
|
+
msgid "context|context$message"
|
55
|
+
msgstr ""
|
data/test/run-test.rb
CHANGED
@@ -26,8 +26,13 @@ lib_dir = File.join(base_dir, "lib")
|
|
26
26
|
test_dir = File.join(base_dir, "test")
|
27
27
|
|
28
28
|
$LOAD_PATH.unshift(lib_dir)
|
29
|
+
$LOAD_PATH.unshift(test_dir)
|
29
30
|
|
30
31
|
require "test-unit"
|
32
|
+
require "test/unit/notify"
|
33
|
+
require "test/unit/rr"
|
34
|
+
|
35
|
+
require "gettext-test-utils"
|
31
36
|
|
32
37
|
Dir.chdir(test_dir) do
|
33
38
|
Dir.glob("**/test_*.rb").each do |test_file_path|
|
data/test/test_class_info.rb
CHANGED
data/test/test_gettext.rb
CHANGED
@@ -1,12 +1,32 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
2
|
+
#
|
3
|
+
# Copyright (C) 2012 Kouhei Sutou <kou@clear-code.com>
|
4
|
+
# Copyright (C) 2009-2010 Masao Mutoh
|
5
|
+
# Copyright (C) 2009 OZAWA Sakuro <github@2238club.org>
|
6
|
+
# Copyright (C) 2009 grosser <grosser.michael@gmail.com>
|
7
|
+
#
|
8
|
+
# License: Ruby's or LGPL
|
9
|
+
#
|
10
|
+
# This library is free software: you can redistribute it and/or modify
|
11
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
12
|
+
# the Free Software Foundation, either version 3 of the License, or
|
13
|
+
# (at your option) any later version.
|
14
|
+
#
|
15
|
+
# This library is distributed in the hope that it will be useful,
|
16
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18
|
+
# GNU Lesser General Public License for more details.
|
19
|
+
#
|
20
|
+
# You should have received a copy of the GNU Lesser General Public License
|
21
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
22
|
+
|
23
|
+
require 'fixtures/simple.rb'
|
24
|
+
require 'fixtures/_.rb'
|
25
|
+
require "fixtures/_/one_line"
|
26
|
+
require 'fixtures/s_.rb'
|
27
|
+
require 'fixtures/ns_.rb'
|
28
|
+
require 'fixtures/p_.rb'
|
29
|
+
require 'fixtures/np_.rb'
|
10
30
|
|
11
31
|
class TestGetText < Test::Unit::TestCase
|
12
32
|
|
@@ -42,7 +62,17 @@ class TestGetText < Test::Unit::TestCase
|
|
42
62
|
def test_empty
|
43
63
|
bindtextdomain("test1", "locale")
|
44
64
|
assert_equal("japanese", gettext("language"))
|
45
|
-
|
65
|
+
|
66
|
+
pot_header = <<EOH
|
67
|
+
Project-Id-Version: PACKAGE VERSION
|
68
|
+
POT-Creation-Date: 2002-01-01 02:24:56+0900
|
69
|
+
PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE
|
70
|
+
Last-Translator: FULL NAME <EMAIL@ADDRESS>
|
71
|
+
Language-Team: LANGUAGE <LL@li.org>
|
72
|
+
MIME-Version: 1.0\nContent-Type: text/plain; charset=utf-8
|
73
|
+
Content-Transfer-Encoding: ENCODING
|
74
|
+
EOH
|
75
|
+
assert_equal(pot_header, gettext(""))
|
46
76
|
assert_equal("", gettext(nil))
|
47
77
|
end
|
48
78
|
|
@@ -60,11 +90,18 @@ DDD
|
|
60
90
|
assert_equal("GGGHHHIII", test.test_7)
|
61
91
|
end
|
62
92
|
|
93
|
+
class Test_ < self
|
94
|
+
def test_one_line
|
95
|
+
target = Fixtures::Method_::OneLine.new
|
96
|
+
assert_equal("ONE LINE", target.message)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
63
100
|
def test_N_
|
64
101
|
assert_equal("test", N_("test"))
|
65
102
|
end
|
66
103
|
|
67
|
-
def
|
104
|
+
def test_s_
|
68
105
|
test = TestSGetText.new
|
69
106
|
|
70
107
|
assert_equal("MATCHED", test.test_1)
|
@@ -82,7 +119,7 @@ DDD
|
|
82
119
|
assert_equal "AAA|BBB", s_("AAA|BBB", nil)
|
83
120
|
end
|
84
121
|
|
85
|
-
def
|
122
|
+
def test_p_
|
86
123
|
GetText.locale = nil
|
87
124
|
test = TestPGetText.new
|
88
125
|
|
@@ -104,7 +141,7 @@ DDD
|
|
104
141
|
assert_equal("BBB", test.test_6)
|
105
142
|
end
|
106
143
|
|
107
|
-
def
|
144
|
+
def test_np_
|
108
145
|
GetText.locale = nil
|
109
146
|
test = TestNPGetText.new
|
110
147
|
assert_equal(["一つの本", "%{num}の本たち"], test.test_1)
|
data/test/test_locale_path.rb
CHANGED
data/test/test_mofile.rb
CHANGED
data/test/test_parser.rb
CHANGED
@@ -1,128 +1,159 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
#
|
3
|
+
# Copyright (C) 2012 Haruka Yoshihara <yoshihara@clear-code.com>
|
4
|
+
# Copyright (C) 2012 Kouhei Sutou <kou@clear-code.com>
|
5
|
+
# Copyright (C) 2010 masone (Christian Felder) <ema@rh-productions.ch>
|
6
|
+
# Copyright (C) 2009 Vladimir Dobriakov <vladimir@geekq.net>
|
7
|
+
# Copyright (C) 2009-2010 Masao Mutoh
|
8
|
+
#
|
9
|
+
# License: Ruby's or LGPL
|
10
|
+
#
|
11
|
+
# This library is free software: you can redistribute it and/or modify
|
12
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
13
|
+
# the Free Software Foundation, either version 3 of the License, or
|
14
|
+
# (at your option) any later version.
|
15
|
+
#
|
16
|
+
# This library is distributed in the hope that it will be useful,
|
17
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19
|
+
# GNU Lesser General Public License for more details.
|
20
|
+
#
|
21
|
+
# You should have received a copy of the GNU Lesser General Public License
|
22
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2
23
|
|
3
|
-
require 'testlib/helper.rb'
|
4
24
|
require 'gettext/tools/parser/ruby'
|
5
25
|
require 'gettext/tools/parser/glade'
|
6
26
|
require 'gettext/tools/parser/erb'
|
7
27
|
|
8
|
-
require 'gettext/tools/
|
28
|
+
require 'gettext/tools/xgettext'
|
9
29
|
|
10
30
|
class TestGetTextParser < Test::Unit::TestCase
|
31
|
+
def setup
|
32
|
+
@xgettext = GetText::Tools::XGetText.new
|
33
|
+
end
|
34
|
+
|
11
35
|
def test_ruby
|
12
|
-
@ary =
|
13
|
-
|
14
|
-
assert_target 'aaa', ['
|
15
|
-
assert_target '
|
16
|
-
assert_target 'bbb\nccc', ['
|
17
|
-
assert_target '
|
18
|
-
assert_target '
|
19
|
-
assert_target '
|
20
|
-
assert_target '
|
21
|
-
assert_target '
|
22
|
-
assert_target '
|
23
|
-
assert_target '
|
24
|
-
assert_target '
|
25
|
-
assert_target '
|
26
|
-
assert_target '
|
27
|
-
assert_target "
|
28
|
-
assert_target "\\
|
29
|
-
assert_target "
|
30
|
-
assert_target "Francois Pinard", ['testlib/gettext.rb:99'] do |t|
|
36
|
+
@ary = @xgettext.parse(['fixtures/_.rb'])
|
37
|
+
|
38
|
+
assert_target 'aaa\n', ['fixtures/_.rb:34']
|
39
|
+
assert_target 'bbb\nccc', ['fixtures/_.rb:38']
|
40
|
+
assert_target 'bbb\nccc\nddd\n', ['fixtures/_.rb:42']
|
41
|
+
assert_target 'eee', ['fixtures/_.rb:49', 'fixtures/_.rb:53']
|
42
|
+
assert_target 'fff', ['fixtures/_.rb:53']
|
43
|
+
assert_target 'ggghhhiii', ['fixtures/_.rb:57']
|
44
|
+
assert_target 'a"b"c"', ['fixtures/_.rb:63']
|
45
|
+
assert_target 'd"e"f"', ['fixtures/_.rb:67']
|
46
|
+
assert_target 'jjj', ['fixtures/_.rb:71']
|
47
|
+
assert_target 'kkk', ['fixtures/_.rb:72']
|
48
|
+
assert_target 'lllmmm', ['fixtures/_.rb:76']
|
49
|
+
assert_target 'nnn\nooo', ['fixtures/_.rb:84']
|
50
|
+
assert_target "\#", ['fixtures/_.rb:88', 'fixtures/_.rb:92']
|
51
|
+
assert_target "\\taaa", ['fixtures/_.rb:96']
|
52
|
+
assert_target "Here document1\\nHere document2\\n", ['fixtures/_.rb:100']
|
53
|
+
assert_target "Francois Pinard", ['fixtures/_.rb:119'] do |t|
|
31
54
|
assert_match /proper name/, t.comment
|
32
55
|
assert_match /Pronunciation/, t.comment
|
33
56
|
end
|
34
|
-
|
57
|
+
|
58
|
+
assert_target("No TRANSLATORS comment", ["fixtures/_.rb:122"]) do |t|
|
59
|
+
assert_nil(t.comment)
|
60
|
+
end
|
61
|
+
|
62
|
+
assert_target "self explaining", ['fixtures/_.rb:127'] do |t|
|
35
63
|
assert_nil t.comment
|
36
64
|
end
|
37
|
-
|
65
|
+
|
66
|
+
assert_target "This is a # including string.", ["fixtures/_.rb:131"]
|
67
|
+
|
68
|
+
# TODO: assert_target "in_quote", ['fixtures/_.rb:118']
|
38
69
|
end
|
39
70
|
|
40
71
|
def test_ruby_N
|
41
|
-
@ary =
|
42
|
-
|
43
|
-
assert_target 'aaa', ['
|
44
|
-
assert_target 'aaa\n', ['
|
45
|
-
assert_target 'bbb\nccc', ['
|
46
|
-
assert_target 'bbb\nccc\nddd\n', ['
|
47
|
-
assert_target 'eee', ['
|
48
|
-
assert_target 'fff', ['
|
49
|
-
assert_target 'ggghhhiii', ['
|
50
|
-
assert_target 'a"b"c"', ['
|
51
|
-
assert_target 'd"e"f"', ['
|
52
|
-
assert_target 'jjj', ['
|
53
|
-
assert_target 'kkk', ['
|
54
|
-
assert_target 'lllmmm', ['
|
55
|
-
assert_target 'nnn\nooo', ['
|
72
|
+
@ary = @xgettext.parse(['fixtures/N_.rb'])
|
73
|
+
|
74
|
+
assert_target 'aaa', ['fixtures/N_.rb:10']
|
75
|
+
assert_target 'aaa\n', ['fixtures/N_.rb:14']
|
76
|
+
assert_target 'bbb\nccc', ['fixtures/N_.rb:18']
|
77
|
+
assert_target 'bbb\nccc\nddd\n', ['fixtures/N_.rb:22']
|
78
|
+
assert_target 'eee', ['fixtures/N_.rb:29', 'fixtures/N_.rb:33']
|
79
|
+
assert_target 'fff', ['fixtures/N_.rb:33']
|
80
|
+
assert_target 'ggghhhiii', ['fixtures/N_.rb:37']
|
81
|
+
assert_target 'a"b"c"', ['fixtures/N_.rb:43']
|
82
|
+
assert_target 'd"e"f"', ['fixtures/N_.rb:47']
|
83
|
+
assert_target 'jjj', ['fixtures/N_.rb:51']
|
84
|
+
assert_target 'kkk', ['fixtures/N_.rb:52']
|
85
|
+
assert_target 'lllmmm', ['fixtures/N_.rb:56']
|
86
|
+
assert_target 'nnn\nooo', ['fixtures/N_.rb:64']
|
56
87
|
end
|
57
88
|
|
58
89
|
def test_ruby_n
|
59
|
-
@ary =
|
60
|
-
assert_plural_target "aaa", "aaa2", ['
|
61
|
-
assert_plural_target "bbb\\n", "ccc2\\nccc2", ['
|
62
|
-
assert_plural_target "ddd\\nddd", "ddd2\\nddd2", ['
|
63
|
-
assert_plural_target "eee\\neee\\n", "eee2\\neee2\\n", ['
|
64
|
-
assert_plural_target "ddd\\neee\\n", "ddd\\neee2", ['
|
65
|
-
assert_plural_target "fff", "fff2", ['
|
66
|
-
assert_plural_target "ggg", "ggg2", ['
|
67
|
-
assert_plural_target "ggghhhiii", "jjjkkklll", ['
|
68
|
-
assert_plural_target "a\"b\"c\"", "a\"b\"c\"2", ['
|
69
|
-
assert_plural_target "mmmmmm", "mmm2mmm2", ['
|
70
|
-
assert_plural_target "nnn", "nnn2", ['
|
71
|
-
assert_plural_target "comment", "comments", ['
|
90
|
+
@ary = @xgettext.parse(['fixtures/n_.rb'])
|
91
|
+
assert_plural_target "aaa", "aaa2", ['fixtures/n_.rb:29']
|
92
|
+
assert_plural_target "bbb\\n", "ccc2\\nccc2", ['fixtures/n_.rb:33']
|
93
|
+
assert_plural_target "ddd\\nddd", "ddd2\\nddd2", ['fixtures/n_.rb:37']
|
94
|
+
assert_plural_target "eee\\neee\\n", "eee2\\neee2\\n", ['fixtures/n_.rb:42']
|
95
|
+
assert_plural_target "ddd\\neee\\n", "ddd\\neee2", ['fixtures/n_.rb:48']
|
96
|
+
assert_plural_target "fff", "fff2", ['fixtures/n_.rb:55', 'fixtures/n_.rb:59']
|
97
|
+
assert_plural_target "ggg", "ggg2", ['fixtures/n_.rb:59']
|
98
|
+
assert_plural_target "ggghhhiii", "jjjkkklll", ['fixtures/n_.rb:63']
|
99
|
+
assert_plural_target "a\"b\"c\"", "a\"b\"c\"2", ['fixtures/n_.rb:72']
|
100
|
+
assert_plural_target "mmmmmm", "mmm2mmm2", ['fixtures/n_.rb:80']
|
101
|
+
assert_plural_target "nnn", "nnn2", ['fixtures/n_.rb:81']
|
102
|
+
assert_plural_target "comment", "comments", ['fixtures/n_.rb:97'] do |t|
|
72
103
|
assert_equal "please provide translations for all\n the plural forms!", t.comment
|
73
104
|
end
|
74
105
|
end
|
75
106
|
|
76
107
|
def test_ruby_p
|
77
|
-
@ary =
|
78
|
-
assert_target_in_context "AAA", "BBB", ["
|
79
|
-
assert_target_in_context "AAA|BBB", "CCC", ["
|
80
|
-
assert_target_in_context "AAA", "CCC", ["
|
81
|
-
assert_target_in_context "CCC", "BBB", ["
|
82
|
-
assert_target_in_context "program", "name", ['
|
108
|
+
@ary = @xgettext.parse(['fixtures/p_.rb'])
|
109
|
+
assert_target_in_context "AAA", "BBB", ["fixtures/p_.rb:29", "fixtures/p_.rb:33"]
|
110
|
+
assert_target_in_context "AAA|BBB", "CCC", ["fixtures/p_.rb:37"]
|
111
|
+
assert_target_in_context "AAA", "CCC", ["fixtures/p_.rb:41"]
|
112
|
+
assert_target_in_context "CCC", "BBB", ["fixtures/p_.rb:45"]
|
113
|
+
assert_target_in_context "program", "name", ['fixtures/p_.rb:55'] do |t|
|
83
114
|
assert_equal "please translate 'name' in the context of 'program'.\n Hint: the translation should NOT contain the translation of 'program'.", t.comment
|
84
115
|
end
|
85
116
|
end
|
86
117
|
|
87
118
|
def test_glade
|
88
119
|
# Old style (~2.0.4)
|
89
|
-
ary = GetText::GladeParser.parse('
|
90
|
-
|
91
|
-
assert_equal(['window1', '
|
92
|
-
assert_equal(['normal text', '
|
93
|
-
assert_equal(['1st line\n2nd line\n3rd line', '
|
94
|
-
assert_equal(['<span color="red" weight="bold" size="large">markup </span>', '
|
95
|
-
assert_equal(['<span color="red">1st line markup </span>\n<span color="blue">2nd line markup</span>', '
|
96
|
-
assert_equal(['<span>"markup" with <escaped strings></span>', '
|
97
|
-
assert_equal(['duplicated', '
|
120
|
+
ary = GetText::GladeParser.parse('fixtures/gladeparser.glade')
|
121
|
+
|
122
|
+
assert_equal(['window1', 'fixtures/gladeparser.glade:8'], ary[0])
|
123
|
+
assert_equal(['normal text', 'fixtures/gladeparser.glade:29'], ary[1])
|
124
|
+
assert_equal(['1st line\n2nd line\n3rd line', 'fixtures/gladeparser.glade:50'], ary[2])
|
125
|
+
assert_equal(['<span color="red" weight="bold" size="large">markup </span>', 'fixtures/gladeparser.glade:73'], ary[3])
|
126
|
+
assert_equal(['<span color="red">1st line markup </span>\n<span color="blue">2nd line markup</span>', 'fixtures/gladeparser.glade:94'], ary[4])
|
127
|
+
assert_equal(['<span>"markup" with <escaped strings></span>', 'fixtures/gladeparser.glade:116'], ary[5])
|
128
|
+
assert_equal(['duplicated', 'fixtures/gladeparser.glade:137', 'fixtures/gladeparser.glade:158'], ary[6])
|
98
129
|
end
|
99
130
|
|
100
|
-
def
|
101
|
-
@ary = GetText::ErbParser.parse('
|
131
|
+
def fixtures_erb
|
132
|
+
@ary = GetText::ErbParser.parse('fixtures/erb.rhtml')
|
102
133
|
|
103
|
-
assert_target 'aaa', ['
|
104
|
-
assert_target 'aaa\n', ['
|
105
|
-
assert_target 'bbb', ['
|
106
|
-
assert_plural_target "ccc1", "ccc2", ['
|
134
|
+
assert_target 'aaa', ['fixtures/erb.rhtml:8']
|
135
|
+
assert_target 'aaa\n', ['fixtures/erb.rhtml:11']
|
136
|
+
assert_target 'bbb', ['fixtures/erb.rhtml:12']
|
137
|
+
assert_plural_target "ccc1", "ccc2", ['fixtures/erb.rhtml:13']
|
107
138
|
end
|
108
139
|
|
109
|
-
def
|
140
|
+
def test_xgettext_parse
|
110
141
|
GetText::ErbParser.init(:extnames => ['.rhtml', '.rxml'])
|
111
|
-
@ary =
|
112
|
-
assert_target 'aaa', ['
|
113
|
-
assert_target 'aaa\n', ['
|
114
|
-
assert_target 'bbb', ['
|
115
|
-
assert_plural_target "ccc1", "ccc2", ['
|
116
|
-
|
117
|
-
@ary =
|
118
|
-
assert_target 'aaa', ['
|
119
|
-
assert_target 'aaa\n', ['
|
120
|
-
assert_target 'bbb', ['
|
121
|
-
assert_plural_target "ccc1", "ccc2", ['
|
122
|
-
|
123
|
-
@ary =
|
124
|
-
assert_plural_target "ooo", "ppp", ['
|
125
|
-
assert_plural_target "qqq", "rrr", ['
|
142
|
+
@ary = @xgettext.parse(['fixtures/erb.rhtml'])
|
143
|
+
assert_target 'aaa', ['fixtures/erb.rhtml:8']
|
144
|
+
assert_target 'aaa\n', ['fixtures/erb.rhtml:11']
|
145
|
+
assert_target 'bbb', ['fixtures/erb.rhtml:12']
|
146
|
+
assert_plural_target "ccc1", "ccc2", ['fixtures/erb.rhtml:13']
|
147
|
+
|
148
|
+
@ary = @xgettext.parse(['fixtures/erb.rxml'])
|
149
|
+
assert_target 'aaa', ['fixtures/erb.rxml:9']
|
150
|
+
assert_target 'aaa\n', ['fixtures/erb.rxml:12']
|
151
|
+
assert_target 'bbb', ['fixtures/erb.rxml:13']
|
152
|
+
assert_plural_target "ccc1", "ccc2", ['fixtures/erb.rxml:14']
|
153
|
+
|
154
|
+
@ary = @xgettext.parse(['fixtures/n_.rb'])
|
155
|
+
assert_plural_target "ooo", "ppp", ['fixtures/n_.rb:85', 'fixtures/n_.rb:86']
|
156
|
+
assert_plural_target "qqq", "rrr", ['fixtures/n_.rb:90', 'fixtures/n_.rb:91']
|
126
157
|
end
|
127
158
|
|
128
159
|
private
|