Skip to content
This repository
Browse code

Merge the changes by grosser.

  • Loading branch information...
commit 6c0ef83e3d79f995cb2172937db637eeabba07e5 1 parent 60979fd
authored February 07, 2009
8  .gitignore
... ...
@@ -0,0 +1,8 @@
  1
+Manifest
  2
+pkg
  3
+data
  4
+test/locale
  5
+samples/cgi/locale/
  6
+samples/locale/
  7
+
  8
+
175  README.rdoc
Source Rendered
... ...
@@ -0,0 +1,175 @@
  1
+= Ruby-Gettext-Package
  2
+
  3
+Ruby-GetText-Package is a Localization(L10n) library and tool  
  4
+which is modeled after the GNU gettext package.
  5
+
  6
+This library translates original messages to localized  
  7
+messages using client-side locale information(environment  
  8
+variable or CGI variable).
  9
+
  10
+The tools for developers support creating, useing, and modifying  
  11
+localized message files(message catalogs).
  12
+
  13
+((*Rails*))
  14
+Rails support has been removed.  
  15
+Rails / ActiveRecord specific code now lives in gettext_rails and gettext_activerecord.
  16
+
  17
+== Website
  18
+* homepage[http://www.yotabanana.com/hiki/ruby-gettext.html]
  19
+* on rubyforge[http://gettext/rubyforge.org/]
  20
+* on github[http://github.com/gettext/]
  21
+
  22
+== Features
  23
+* Simple APIs(similar to GNU gettext)
  24
+
  25
+* rgettext creates po-files from 
  26
+  * ruby scripts 
  27
+  * glade-2 XML file(.glade)
  28
+  * ERB file(.rhtml, .erb)
  29
+  * Anything (with your own parsers)
  30
+  * The po-files are compatible to GNU gettext.
  31
+
  32
+* rmsgfmt creates a mo-file from a po-file.
  33
+  The mo-file is compatible to GNU gettext(msgfmt).
  34
+
  35
+* textdomain's scope is adapt to ruby class/module mechanism.
  36
+  * A class/module can have plural textdomains.
  37
+  * a message is looked up in its class/module and ancestors.
  38
+
  39
+* CGI support (gettext/cgi)
  40
+  * Locale is retrieved from client informations
  41
+    (HTTP_ACCEPT_LANGUAGE, HTTP_ACCEPT_CHARSET, QUERY_STRING(lang), Cookies(lang)).
  42
+
  43
+* String%() is extended to use named argument such as <tt>%{foo}" %{:foo => 1}</tt>.
  44
+  Notes that Ruby-1.9.x supports this format by itself.
  45
+
  46
+== Requirements
  47
+* {Ruby 1.8.3 or later}[http://www.ruby-lang.org]
  48
+* {Rubygems}[http://www.rubygems.org/]
  49
+* {locale}[http://http://rubyforge.org/projects/locale/] gem
  50
+  * $ gem install locale
  51
+* (for development only)
  52
+  * {GNU gettext 0.10.35 or later}[http://www.gnu.org/software/gettext/gettext.html]
  53
+  * {Racc-1.4.3 or later}[http://www.ruby-lang.org/raa/list.rhtml?name=racc]
  54
+    * (for compiling src/rmsgfmt.ry only)
  55
+
  56
+== Install
  57
+* gem
  58
+    #from github (edge/unstable)
  59
+    sudo gem install locale
  60
+    sudo gem install mutoh-gettext -s http://gems.github.com/
  61
+
  62
+    #from rubyforge (stable)
  63
+    sudo gem install locale
  64
+    sudo gem install gettext
  65
+
  66
+* download tar-ball
  67
+    # De-Compress archive and enter its top directory.
  68
+    sudo ruby setup.rb
  69
+
  70
+You can also install files in your favorite directory by  
  71
+supplying setup.rb some options. Try <tt>ruby setup.rb --help</tt>.
  72
+
  73
+== Usage
  74
+Have a look at the examples folder.
  75
+
  76
+== License
  77
+This program is licenced under the same licence as Ruby.  
  78
+(See the file 'COPYING'.)
  79
+
  80
+* mofile.rb
  81
+  * Copyright (C) 2001-2009 Masao Mutoh <mutoh at highwhay.ne.jp>
  82
+  * Copyright (C) 2001,2002 Masahiro Sakai <s01397ms at sfc.keio.ac.jp>
  83
+
  84
+* gettext.rb
  85
+  * Copyright (C) 2001-2009 Masao Mutoh <mutoh at highwhay.ne.jp>
  86
+  * Copyright (C) 2001,2002 Masahiro Sakai <s01397ms at sfc.keio.ac.jp>
  87
+
  88
+* rgettext 
  89
+  * Copyright (C) 2001-2009 Masao Mutoh <mutoh at highwhay.ne.jp>
  90
+  * Copyright (C) 2001,2002 Yasushi Shoji <yashi at atmark-techno.com>
  91
+
  92
+* setup.rb
  93
+  * Copyright (C) 2000-2005 Minero Aoki <aamine at loveruby.net>
  94
+  * This file is released under LGPL. See the top of the install.rb.
  95
+
  96
+* Others
  97
+  * Copyright (C) 2001-2009 Masao Mutoh <mutoh at highwhay.ne.jp>
  98
+
  99
+
  100
+== Translators
  101
+* Bosnian(bs)                - Sanjin Sehic <saserr at gmail.com>
  102
+* Bulgarian(bg)              - Sava Chankov <sava.chankov at gmail.com>
  103
+* Catalan(ca)                - Ramon Salvadó <rsalvado at gnuine.com>
  104
+* Chinese(Simplified)(zh_CN)
  105
+  * Yang Bob <bob.yang.dev at gmail.com> (current)
  106
+  * Yingfeng <blogyingfeng at gmail.com>
  107
+* Chinese(Traditional)(zh_TW)
  108
+  * Yang Bob <bob.yang.dev at gmail.com> (current)
  109
+  * LIN CHUNG-YI <xmarsh at gmail.com>
  110
+* Croatian(hr)               - Sanjin Sehic <saserr at gmail.com>
  111
+* Czech(cs)                  - Karel Miarka <kajism at yahoo.com>
  112
+* Dutch(nl)                  - Menno Jonkers <ruby-gettext at jonkers.com>
  113
+* Esperanto(eo)              - Malte Milatz <malte at gmx-topmail.de>
  114
+* Estonian(et)               - Erkki Eilonen <erkki at itech.ee>
  115
+* French(fr)
  116
+  * Vincent Isambart <vincent.isambart at gmail.com> (current)
  117
+  * David Sulc <davidsulc at gmail.com>
  118
+  * Laurent Sansonetti <laurent.sansonetti at gmail.com>
  119
+* German(de)
  120
+  * Patrick Lenz <patrick at limited-overload.de> (current)
  121
+  * Detlef Reichl <detlef.reichl at gmx.org>
  122
+  * Sven Herzberg <herzi at abi02.de>
  123
+  * Sascha Ebach <se at digitale-wertschoepfung.de>
  124
+* Greek(el)                  - Vassilis Rizopoulos <damphyr at gmx.net>
  125
+* Hungarian(hu)              - Tamás Tompa <tompata at gmail.com>
  126
+* Italian(it)
  127
+  * Marco Lazzeri <marco.lazzeri at gmail.com>
  128
+  * Gabriele Renzi <surrender_it at yahoo.it>
  129
+* Japanese(ja)               - Masao Mutoh <mutoh at highway.ne.jp>
  130
+* Korean(ko)                 - Gyoung-Yoon Noh <nohmad at gmail.com>
  131
+* Latvian(lv)                - Aivars Akots <aivars.akots at gmail.com>
  132
+* Norwegian(nb)              - Runar Ingebrigtsen <runar at mopo.no>
  133
+* Portuguese(Brazil)(pt_BR)  
  134
+  * Antonio S. de A. Terceiro <terceiro at softwarelivre.org> (current)
  135
+  * Joao Pedrosa <joaopedrosa at gmail.com>
  136
+* Russian(ru)                - Yuri Kozlov <kozlov.y at gmail.com>
  137
+* Serbian(sr)                - Slobodan Paunović" <slobodan.paunovic at gmail.com>
  138
+* Spanish(es)
  139
+  * David Espada <davinci at escomposlinux.org> (current)
  140
+  * David Moreno Garza <damog at damog.net>
  141
+* Swedish(sv)                - Nikolai Weibull <mailing-lists.ruby-talk at rawuncut.elitemail.org>
  142
+* Ukrainian(ua)              - Alex Rootoff <rootoff at pisem.net>
  143
+* Vietnamese(vi)             - Ngoc Dao Thanh <ngocdaothanh at gmail.com>
  144
+
  145
+== Status of translations
  146
+* Bosnian(bs)               - 1.90.0 (old)
  147
+* Bulgarian(bg)             - 2.0.0pre1 (new)
  148
+* Catalan(ca)               - 2.0.0pre1
  149
+* Croatian(hr)              - 1.90.0 (old)
  150
+* Chinese(zh_CN)            - 2.0.0pre1
  151
+* Chinese(zh_TW)            - 2.0.0pre1
  152
+* Czech(cs)                 - 1.9.0 (old)
  153
+* Dutch(nl)                 - 1.90.0 (old)
  154
+* English(default)          - 1.90.0 (old)
  155
+* Esperanto(eo)             - 2.0.0pre1
  156
+* Estonian(et)              - 2.0.0pre1
  157
+* French(fr)                - 2.0.0pre1
  158
+* German(de)                - 2.0.0pre1
  159
+* Greek(el)                 - 2.0.0pre1 
  160
+* Hungarian(hu)             - 2.0.0pre1
  161
+* Italian(it)               - 1.6.0 (old)
  162
+* Japanese(ja)              - 2.0.0pre1
  163
+* Korean(ko)                - 1.9.0 (old)
  164
+* Latvian(lv)               - 2.0.0pre1 (new)
  165
+* Norwegian(nb)             - 2.0.0pre1
  166
+* Portuguese(Brazil)(pt_BR) - 2.0.0pre1
  167
+* Russian(ru)               - 2.0.0pre1
  168
+* Serbian(sr)               - 1.91.0 (old)
  169
+* Spanish(es)               - 2.0.0pre1
  170
+* Swedish(sv)               - 0.8.0 (too much old)
  171
+* Ukrainian(ua)             - 2.0.0pre1
  172
+* Vietnamese(vi)            - 2.0.0pre1
  173
+
  174
+== Maintainer
  175
+Masao Mutoh <mutoh at highway.ne.jp>
12  Rakefile
@@ -195,12 +195,20 @@ end
195 195
 desc 'Run all tests'
196 196
 task :test do
197 197
    Dir.chdir("test") do
198  
-     sh "rake test"
  198
+     if RUBY_PLATFORM =~ /win32/
  199
+       sh "rake.bat", "test"
  200
+     else
  201
+       sh "rake", "test"
  202
+     end
199 203
    end
200 204
 end
201 205
 
202 206
 Rake::RDocTask.new { |rdoc|
203  
-  allison = `allison --path`.chop
  207
+  begin
  208
+    allison = `allison --path`.chop
  209
+  rescue
  210
+    allison = ''
  211
+  end
204 212
   rdoc.rdoc_dir = 'doc'
205 213
   rdoc.title    = "Ruby-GetText-Package API Reference"
206 214
   rdoc.options << '--line-numbers' << '--inline-source'
40  gettext.gemspec
... ...
@@ -0,0 +1,40 @@
  1
+# -*- encoding: utf-8 -*-
  2
+
  3
+Gem::Specification.new do |s|
  4
+  s.name = %q{gettext}
  5
+  s.version = "2.0.0"
  6
+
  7
+  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
  8
+  s.authors = ["Masao Mutoh"]
  9
+  s.date = %q{2009-02-06}
  10
+  s.description = %q{Ruby-GetText-Package is a GNU GetText-like program for Ruby. The catalog file(po-file) is same format with GNU GetText. So you can use GNU GetText tools for maintaining.}
  11
+  s.email = %q{mutoh@highway.ne.jp}
  12
+  s.executables = ["rgettext", "rmsgmerge", "rmsgfmt"]
  13
+  s.extra_rdoc_files = ["lib/gettext.rb", "lib/gettext/tools.rb", "lib/gettext/core_ext/string.rb", "lib/gettext/version.rb", "README.rdoc"]
  14
+  s.files = ["Manifest", "po/hr/rgettext.po", "po/cs/rgettext.po", 
  15
+	"po/el/rgettext.po", "po/bs/rgettext.po", "po/et/rgettext.po", "po/vi/rgettext.po", "po/pt_BR/rgettext.po", "po/nb/rgettext.po", "po/ko/rgettext.po", "po/lv/rgettext.po", "po/ru/rgettext.po", "po/zh_TW/rgettext.po", "po/rgettext.pot", "po/ca/rgettext.po", "po/de/rgettext.po", "po/de/#rails.po#", "po/es/rgettext.po", "po/eo/rgettext.po", "po/nl/rgettext.po", "po/sr/rgettext.po", "po/hu/rgettext.po", "po/zh/rgettext.po", "po/ja/rgettext.po", "po/ja/rails.po.old", "po/bg/rgettext.po", "po/ua/rgettext.po", "po/fr/rgettext.po", "po/sv/rgettext.po", "po/it/rgettext.po", "lib/gettext.rb", "lib/gettext/cgi.rb", "lib/gettext/utils.rb", "lib/gettext/class_info.rb", "lib/gettext/tools.rb", "lib/gettext/core_ext/iconv.rb", "lib/gettext/core_ext/string.rb", "lib/gettext/poparser.rb", "lib/gettext/version.rb", "lib/gettext/mofile.rb", "lib/gettext/parser/glade.rb", "lib/gettext/parser/erb.rb", "lib/gettext/parser/ruby.rb", "lib/gettext/textdomain.rb", "lib/gettext/textdomain_manager.rb", "lib/gettext/tools/rgettext.rb", "lib/gettext/tools/rmsgmerge.rb", "lib/gettext/tools/rmsgfmt.rb", "test/test_textdomain.rb", "test/po/po/plural.po", "test/po/cr/plural.po", "test/po/sl/plural.po", "test/po/li/plural.po", "test/po/ir/plural.po", "test/po/ja/sgettext.po", "test/po/ja/test2.po", "test/po/ja/pgettext.po", "test/po/ja/test1.po", "test/po/ja/nsgettext.po", "test/po/ja/plural_error.po", "test/po/ja/plural.po", "test/po/ja/test6.po", "test/po/ja/rubyparser.po", "test/po/ja/npgettext.po", "test/po/fr/test2.po", "test/po/fr/test1.po", "test/po/fr/plural_error.po", "test/po/fr/plural.po", "test/po/fr/test6.po", "test/po/la/plural_error.po", "test/po/la/plural.po", "test/po/da/plural_error.po", "test/po/da/plural.po", "test/test_textdomain_toplevel.rb", "test/test_gettext.rb", "test/test_parser.rb", "test/README", "test/test_string.rb", "test/Rakefile", "test/test_class_info.rb", "test/test_textdomain_multi.rb", "test/testlib/simple.rb", "test/testlib/gettext.rb", "test/testlib/gladeparser.glade", "test/testlib/npgettext.rb", "test/testlib/multi_textdomain.rb", "test/testlib/erb.rhtml", "test/testlib/nsgettext.rb", "test/testlib/erb.rxml", "test/testlib/pgettext.rb", "test/testlib/helper.rb", "test/testlib/N_.rb", "test/testlib/ngettext.rb", "test/testlib/sgettext.rb", "bin/rgettext", "bin/rmsgmerge", "bin/rmsgfmt", "Rakefile", "README.rdoc", "ChangeLog", "src/poparser.ry", "samples/cgi/po/hr/main.po", "samples/cgi/po/hr/hellolib.po", "samples/cgi/po/hr/helloerb1.po", "samples/cgi/po/hr/helloerb2.po", "samples/cgi/po/cs/main.po", "samples/cgi/po/cs/hellolib.po", "samples/cgi/po/cs/helloerb1.po", "samples/cgi/po/cs/helloerb2.po", "samples/cgi/po/hellolib.pot", "samples/cgi/po/el/main.po", "samples/cgi/po/el/hellolib.po", "samples/cgi/po/el/helloerb1.po", "samples/cgi/po/el/helloerb2.po", "samples/cgi/po/bs/main.po", "samples/cgi/po/bs/hellolib.po", "samples/cgi/po/bs/helloerb1.po", "samples/cgi/po/bs/helloerb2.po", "samples/cgi/po/vi/main.po", "samples/cgi/po/vi/hellolib.po", "samples/cgi/po/vi/helloerb1.po", "samples/cgi/po/vi/helloerb2.po", "samples/cgi/po/pt_BR/main.po", "samples/cgi/po/pt_BR/hellolib.po", "samples/cgi/po/pt_BR/helloerb1.po", "samples/cgi/po/pt_BR/helloerb2.po", "samples/cgi/po/nb/main.po", "samples/cgi/po/nb/hellolib.po", "samples/cgi/po/nb/helloerb1.po", "samples/cgi/po/nb/helloerb2.po", "samples/cgi/po/ko/main.po", "samples/cgi/po/ko/hellolib.po", "samples/cgi/po/ko/helloerb1.po", "samples/cgi/po/ko/helloerb2.po", "samples/cgi/po/lv/main.po", "samples/cgi/po/lv/hellolib.po", "samples/cgi/po/lv/helloerb1.po", "samples/cgi/po/lv/helloerb2.po", "samples/cgi/po/ru/main.po", "samples/cgi/po/ru/hellolib.po", "samples/cgi/po/ru/helloerb1.po", "samples/cgi/po/ru/helloerb2.po", "samples/cgi/po/zh_TW/main.po", "samples/cgi/po/zh_TW/hellolib.po", "samples/cgi/po/zh_TW/helloerb1.po", "samples/cgi/po/zh_TW/helloerb2.po", "samples/cgi/po/ca/main.po", "samples/cgi/po/ca/hellolib.po", "samples/cgi/po/ca/helloerb1.po", "samples/cgi/po/ca/helloerb2.po", "samples/cgi/po/de/main.po", "samples/cgi/po/de/hellolib.po", "samples/cgi/po/de/helloerb1.po", "samples/cgi/po/de/helloerb2.po", "samples/cgi/po/es/main.po", "samples/cgi/po/es/hellolib.po", "samples/cgi/po/es/helloerb1.po", "samples/cgi/po/es/helloerb2.po", "samples/cgi/po/eo/main.po", "samples/cgi/po/eo/hellolib.po", "samples/cgi/po/eo/helloerb1.po", "samples/cgi/po/eo/helloerb2.po", "samples/cgi/po/nl/main.po", "samples/cgi/po/nl/hellolib.po", "samples/cgi/po/nl/helloerb1.po", "samples/cgi/po/nl/helloerb2.po", "samples/cgi/po/sr/main.po", "samples/cgi/po/sr/hellolib.po", "samples/cgi/po/sr/helloerb1.po", "samples/cgi/po/sr/helloerb2.po", "samples/cgi/po/hu/main.po", "samples/cgi/po/hu/hellolib.po", "samples/cgi/po/hu/helloerb1.po", "samples/cgi/po/hu/helloerb2.po", "samples/cgi/po/helloerb1.pot", "samples/cgi/po/helloerb2.pot", "samples/cgi/po/zh/main.po", "samples/cgi/po/zh/hellolib.po", "samples/cgi/po/zh/helloerb1.po", "samples/cgi/po/zh/helloerb2.po", "samples/cgi/po/ja/main.po", "samples/cgi/po/ja/hellolib.po", "samples/cgi/po/ja/helloerb1.po", "samples/cgi/po/ja/helloerb2.po", "samples/cgi/po/bg/main.po", "samples/cgi/po/bg/hellolib.po", "samples/cgi/po/bg/helloerb1.po", "samples/cgi/po/bg/helloerb2.po", "samples/cgi/po/main.pot", "samples/cgi/po/ua/main.po", "samples/cgi/po/ua/hellolib.po", "samples/cgi/po/ua/helloerb1.po", "samples/cgi/po/ua/helloerb2.po", "samples/cgi/po/fr/main.po", "samples/cgi/po/fr/hellolib.po", "samples/cgi/po/fr/helloerb1.po", "samples/cgi/po/fr/helloerb2.po", "samples/cgi/po/it/main.po", "samples/cgi/po/it/hellolib.po", "samples/cgi/po/it/helloerb1.po", "samples/cgi/po/it/helloerb2.po", "samples/cgi/hellolib.rb", "samples/cgi/helloerb1.cgi", "samples/cgi/cookie.cgi", "samples/cgi/README", "samples/cgi/other.rhtml", "samples/cgi/Rakefile", "samples/cgi/gettext.css", "samples/cgi/helloerb2.cgi", "samples/cgi/http.rb", "samples/cgi/helloerb.rhtml", "samples/cgi/index.cgi", "samples/po/hello_plural.pot", "samples/po/hr/hello_glade2.po", "samples/po/hr/hello_plural.po", "samples/po/hr/hello_noop.po", "samples/po/hr/hello.po", "samples/po/hr/hello2.po", "samples/po/hr/hello_tk.po", "samples/po/hr/hello_gtk.po", "samples/po/cs/hello_glade2.po", "samples/po/cs/hello_plural.po", "samples/po/cs/hello_noop.po", "samples/po/cs/hello.po", "samples/po/cs/hello2.po", "samples/po/cs/hello_tk.po", "samples/po/cs/hello_gtk.po", "samples/po/el/hello_glade2.po", "samples/po/el/hello_plural.po", "samples/po/el/hello_noop.po", "samples/po/el/hello.po", "samples/po/el/hello2.po", "samples/po/el/hello_tk.po", "samples/po/el/hello_gtk.po", "samples/po/bs/hello_glade2.po", "samples/po/bs/hello_plural.po", "samples/po/bs/hello_noop.po", "samples/po/bs/hello.po", "samples/po/bs/hello2.po", "samples/po/bs/hello_tk.po", "samples/po/bs/hello_gtk.po", "samples/po/vi/hello_glade2.po", "samples/po/vi/hello_plural.po", "samples/po/vi/hello_noop.po", "samples/po/vi/hello.po", "samples/po/vi/hello2.po", "samples/po/vi/hello_tk.po", "samples/po/vi/hello_gtk.po", "samples/po/pt_BR/hello_glade2.po", "samples/po/pt_BR/hello_plural.po", "samples/po/pt_BR/hello_noop.po", "samples/po/pt_BR/hello.po", "samples/po/pt_BR/hello2.po", "samples/po/pt_BR/hello_tk.po", "samples/po/pt_BR/hello_gtk.po", "samples/po/nb/hello_glade2.po", "samples/po/nb/hello_plural.po", "samples/po/nb/hello_noop.po", "samples/po/nb/hello.po", "samples/po/nb/hello2.po", "samples/po/nb/hello_tk.po", "samples/po/nb/hello_gtk.po", "samples/po/hello_noop.pot", "samples/po/ko/hello_glade2.po", "samples/po/ko/hello_plural.po", "samples/po/ko/hello_noop.po", "samples/po/ko/hello.po", "samples/po/ko/hello2.po", "samples/po/ko/hello_tk.po", "samples/po/ko/hello_gtk.po", "samples/po/lv/hello_glade2.po", "samples/po/lv/hello_plural.po", "samples/po/lv/hello_noop.po", "samples/po/lv/hello.po", "samples/po/lv/hello2.po", "samples/po/lv/hello_tk.po", "samples/po/lv/hello_gtk.po", "samples/po/ru/hello_glade2.po", "samples/po/ru/hello_plural.po", "samples/po/ru/hello_noop.po", "samples/po/ru/hello.po", "samples/po/ru/hello2.po", "samples/po/ru/hello_tk.po", "samples/po/ru/hello_gtk.po", "samples/po/zh_TW/hello_glade2.po", "samples/po/zh_TW/hello_plural.po", "samples/po/zh_TW/hello_noop.po", "samples/po/zh_TW/hello.po", "samples/po/zh_TW/hello2.po", "samples/po/zh_TW/hello_tk.po", "samples/po/zh_TW/hello_gtk.po", "samples/po/ca/hello_glade2.po", "samples/po/ca/hello_plural.po", "samples/po/ca/hello_noop.po", "samples/po/ca/hello.po", "samples/po/ca/hello2.po", "samples/po/ca/hello_tk.po", "samples/po/ca/hello_gtk.po", "samples/po/hello2.pot", "samples/po/de/hello_glade2.po", "samples/po/de/hello_plural.po", "samples/po/de/hello_noop.po", "samples/po/de/hello.po", "samples/po/de/hello2.po", "samples/po/de/hello_tk.po", "samples/po/de/hello_gtk.po", "samples/po/es/hello_glade2.po", "samples/po/es/hello_plural.po", "samples/po/es/hello_noop.po", "samples/po/es/hello.po", "samples/po/es/hello2.po", "samples/po/es/hello_tk.po", "samples/po/es/hello_gtk.po", "samples/po/hello_gtk.pot", "samples/po/eo/hello_glade2.po", "samples/po/eo/hello_plural.po", "samples/po/eo/hello_noop.po", "samples/po/eo/hello.po", "samples/po/eo/hello2.po", "samples/po/eo/hello_tk.po", "samples/po/eo/hello_gtk.po", "samples/po/nl/hello_glade2.po", "samples/po/nl/hello_plural.po", "samples/po/nl/hello_noop.po", "samples/po/nl/hello.po", "samples/po/nl/hello2.po", "samples/po/nl/hello_tk.po", "samples/po/nl/hello_gtk.po", "samples/po/sr/hello_glade2.po", "samples/po/sr/hello_plural.po", "samples/po/sr/hello_noop.po", "samples/po/sr/hello.po", "samples/po/sr/hello2.po", "samples/po/sr/hello_tk.po", "samples/po/sr/hello_gtk.po", "samples/po/hello.pot", "samples/po/hu/hello_glade2.po", "samples/po/hu/hello_plural.po", "samples/po/hu/hello_noop.po", "samples/po/hu/hello.po", "samples/po/hu/hello2.po", "samples/po/hu/hello_tk.po", "samples/po/hu/hello_gtk.po", "samples/po/zh/hello_glade2.po", "samples/po/zh/hello_plural.po", "samples/po/zh/hello_noop.po", "samples/po/zh/hello.po", "samples/po/zh/hello2.po", "samples/po/zh/hello_tk.po", "samples/po/zh/hello_gtk.po", "samples/po/test.rb", "samples/po/ja/hello_glade2.po", "samples/po/ja/hello_plural.po", "samples/po/ja/hello_noop.po", "samples/po/ja/hello.po", "samples/po/ja/hello2.po", "samples/po/ja/hello_tk.po", "samples/po/ja/hello_gtk.po", "samples/po/bg/hello_glade2.po", "samples/po/bg/hello_plural.po", "samples/po/bg/hello_noop.po", "samples/po/bg/hello.po", "samples/po/bg/hello2.po", "samples/po/bg/hello_tk.po", "samples/po/bg/hello_gtk.po", "samples/po/ua/hello_glade2.po", "samples/po/ua/hello_plural.po", "samples/po/ua/hello_noop.po", "samples/po/ua/hello.po", "samples/po/ua/hello2.po", "samples/po/ua/hello_tk.po", "samples/po/ua/hello_gtk.po", "samples/po/fr/hello_glade2.po", "samples/po/fr/hello_plural.po", "samples/po/fr/hello_noop.po", "samples/po/fr/hello.po", "samples/po/fr/hello2.po", "samples/po/fr/hello_tk.po", "samples/po/fr/hello_gtk.po", "samples/po/hello_tk.pot", "samples/po/sv/hello_glade2.po", "samples/po/sv/hello_plural.po", "samples/po/sv/hello_noop.po", "samples/po/sv/hello.po", "samples/po/sv/hello2.po", "samples/po/sv/hello_tk.po", "samples/po/sv/hello_gtk.po", "samples/po/hello_glade2.pot", "samples/po/it/hello_glade2.po", "samples/po/it/hello_plural.po", "samples/po/it/hello_noop.po", "samples/po/it/hello.po", "samples/po/it/hello2.po", "samples/po/it/hello_tk.po", "samples/po/it/hello_gtk.po", "samples/hello_noop.rb", "samples/hello_plural.rb", "samples/makemo.rb", "samples/hello_glade2.glade", "samples/hello.rb", "samples/hello_gtk2.rb", "samples/README", "samples/hello_glade2.rb", "samples/hello2.rb", "samples/hello_tk.rb", "gettext.gemspec"]
  16
+  s.has_rdoc = true
  17
+  s.homepage = %q{http://gettext.rubyforge.org/}
  18
+  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "GetText", "--main", "README.rdoc"]
  19
+  s.require_paths = ["lib"]
  20
+  s.rubyforge_project = %q{gettext}
  21
+  s.rubygems_version = %q{1.3.1}
  22
+  s.summary = %q{Ruby-GetText-Package is a libary and tools to localize messages.}
  23
+  s.test_files = ["test/test_textdomain.rb", "test/test_textdomain_toplevel.rb", "test/test_gettext.rb", "test/test_parser.rb", "test/test_string.rb", "test/test_class_info.rb", "test/test_textdomain_multi.rb"]
  24
+
  25
+  if s.respond_to? :specification_version then
  26
+    current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
  27
+    s.specification_version = 2
  28
+
  29
+    if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
  30
+      s.add_runtime_dependency(%q<locale>, [">= 0"])
  31
+      s.add_development_dependency(%q<echoe>, [">= 0"])
  32
+    else
  33
+      s.add_dependency(%q<locale>, [">= 0"])
  34
+      s.add_dependency(%q<echoe>, [">= 0"])
  35
+    end
  36
+  else
  37
+    s.add_dependency(%q<locale>, [">= 0"])
  38
+    s.add_dependency(%q<echoe>, [">= 0"])
  39
+  end
  40
+end
2  lib/gettext.rb
... ...
@@ -1,4 +1,6 @@
  1
+gem 'locale', '>=0.9'
1 2
 require 'locale'
  3
+
2 4
 require 'gettext/version'
3 5
 require 'gettext/textdomain_manager'
4 6
 
1  lib/gettext/cgi.rb
@@ -11,7 +11,6 @@
11 11
 
12 12
 require 'cgi'
13 13
 require 'gettext'
14  
-require 'locale'
15 14
 
16 15
 Locale.init(:driver => :cgi)
17 16
 
14  lib/gettext/core_ext/string.rb
@@ -46,15 +46,15 @@ def %(args)
46 46
     else
47 47
       ret = gsub(/%\{/, '%%{')
48 48
       begin
49  
-	ret._old_format_m(args)
  49
+        ret._old_format_m(args)
50 50
       rescue ArgumentError => e
51 51
         if $DEBUG
52  
-  	   $stderr.puts "  The string:#{ret}"
53  
-	   $stderr.puts "  args:#{args.inspect}"
54  
-           puts e.backtrace
55  
-	else	
56  
-	  raise ArgumentError, e.message
57  
-	end
  52
+          $stderr.puts "  The string:#{ret}"
  53
+          $stderr.puts "  args:#{args.inspect}"
  54
+          puts e.backtrace
  55
+        else
  56
+          raise ArgumentError, e.message
  57
+        end
58 58
       end
59 59
     end
60 60
   end
126  lib/gettext/parser/ruby.rb
@@ -32,11 +32,11 @@ def tk.value=(s)
32 32
         if @here_header
33 33
           s = s.sub(/\A.*?\n/, '').sub(/^.*\n\Z/, '')
34 34
         else
35  
-	  begin
36  
-	    s = eval(s)
37  
-	  rescue Exception
38  
-	    # Do nothing.
39  
-	  end
  35
+          begin
  36
+            s = eval(s)
  37
+          rescue Exception
  38
+            # Do nothing.
  39
+          end
40 40
         end
41 41
         
42 42
         tk.value = s
@@ -84,66 +84,67 @@ def parse_lines(file_name, lines, targets)  # :nodoc:
84 84
       line_no = nil
85 85
       tk = nil
86 86
       begin
87  
-	rl.parse do |tk|
88  
-	  case tk
89  
-	  when RubyToken::TkIDENTIFIER, RubyToken::TkCONSTANT
90  
-	    if ID.include?(tk.name)
91  
-	      target = :normal
92  
-	    elsif PLURAL_ID.include?(tk.name)
93  
-	      target = :plural
94  
-	    elsif MSGCTXT_ID.include?(tk.name)
95  
-	      target = :msgctxt
96  
-	    elsif MSGCTXT_PLURAL_ID.include?(tk.name)
97  
-	      target = :msgctxt_plural
98  
-	    else
99  
-	      target = nil
100  
-	    end
101  
-	    line_no = tk.line_no.to_s
102  
-	  when RubyToken::TkSTRING
103  
-	    if target
104  
-	      if msgid
105  
-		msgid += tk.value
106  
-	      else
107  
-		msgid = tk.value 
108  
-	      end
109  
-	    end
110  
-	  when RubyToken::TkPLUS, RubyToken::TkNL
111  
-	    #do nothing
112  
-	  when RubyToken::TkCOMMA
113  
-	    if msgid
114  
-	      if target == :plural
115  
-	        msgid += "\000"
116  
-		target = :normal
117  
-	      elsif target == :msgctxt
118  
-	        msgid += "\004"
119  
-		target = :normal
120  
-	      elsif target == :msgctxt_plural
121  
-	        msgid += "\004"
122  
-		target = :plural
123  
-	      else   
124  
-       	        target = :normal
125  
-	      end
126  
-	    end
127  
-	  else
128  
-	    if msgid
129  
-	      key_existed = targets.assoc(msgid.gsub(/\n/, '\n'))
130  
-	      if key_existed 
131  
-		targets[targets.index(key_existed)] = key_existed <<
132  
-		  file_name + ":" + line_no
133  
-	      else
134  
-		targets << [msgid.gsub(/\n/, '\n'), file_name + ":" + line_no]
135  
-	      end
136  
-	      msgid = nil
137  
-	      target = nil
138  
-	    end
139  
-	  end
140  
-	  targets
141  
-	end
  87
+        rl.parse do |tk|
  88
+          case tk
  89
+          when RubyToken::TkIDENTIFIER, RubyToken::TkCONSTANT
  90
+            if ID.include?(tk.name)
  91
+              target = :normal
  92
+            elsif PLURAL_ID.include?(tk.name)
  93
+              target = :plural
  94
+            elsif MSGCTXT_ID.include?(tk.name)
  95
+              target = :msgctxt
  96
+            elsif MSGCTXT_PLURAL_ID.include?(tk.name)
  97
+              target = :msgctxt_plural
  98
+            else
  99
+              target = nil
  100
+            end
  101
+            line_no = tk.line_no.to_s
  102
+          when RubyToken::TkSTRING
  103
+            if target
  104
+              if msgid
  105
+                msgid += tk.value
  106
+              else
  107
+                msgid = tk.value
  108
+              end
  109
+            end
  110
+          when RubyToken::TkPLUS, RubyToken::TkNL
  111
+            #do nothing
  112
+          when RubyToken::TkCOMMA
  113
+            if msgid
  114
+              case target
  115
+              when :plural
  116
+                msgid += "\000"
  117
+                target = :normal
  118
+              when :msgctxt
  119
+                msgid += "\004"
  120
+                target = :normal
  121
+              when :msgctxt_plural
  122
+                msgid += "\004"
  123
+                target = :plural
  124
+              else
  125
+                target = :normal
  126
+              end
  127
+            end
  128
+          else
  129
+            if msgid
  130
+              key_existed = targets.assoc(msgid.gsub(/\n/, '\n'))
  131
+              if key_existed
  132
+                targets[targets.index(key_existed)] = key_existed <<
  133
+                file_name + ":" + line_no
  134
+              else
  135
+                targets << [msgid.gsub(/\n/, '\n'), file_name + ":" + line_no]
  136
+              end
  137
+              msgid = nil
  138
+              target = nil
  139
+            end
  140
+          end
  141
+          targets
  142
+        end
142 143
       rescue
143  
-	$stderr.print "\n\nError: #{$!.inspect} "
  144
+        $stderr.print "\n\nError: #{$!.inspect} "
144 145
         $stderr.print " in #{file_name}:#{tk.line_no}\n\t #{lines[tk.line_no - 1]}" if tk
145 146
         $stderr.print "\n"
146  
-	exit 1
  147
+        exit 1
147 148
       end
148 149
       targets
149 150
     end
@@ -151,7 +152,6 @@ def parse_lines(file_name, lines, targets)  # :nodoc:
151 152
     def target?(file)  # :nodoc:
152 153
       true # always true, as default parser.
153 154
     end
154  
-    
155 155
   end 
156 156
 end
157 157
 
1  lib/gettext/tools.rb
@@ -16,6 +16,7 @@
16 16
 
17 17
 require 'gettext/tools/rgettext'
18 18
 require 'gettext/tools/rmsgfmt'
  19
+require 'gettext/mofile'
19 20
 require 'fileutils'
20 21
 
21 22
 module GetText
142  lib/gettext/tools/rgettext.rb
@@ -37,11 +37,11 @@ module RGetText #:nodoc:
37 37
       ["ruby.rb", "RubyParser"] # Default parser.
38 38
     ].each do |f, klass|
39 39
       begin
40  
-	require "gettext/parser/#{f}"
41  
-	@ex_parsers << GetText.const_get(klass)
  40
+        require "gettext/parser/#{f}"
  41
+        @ex_parsers << GetText.const_get(klass)
42 42
       rescue
43  
-	$stderr.puts _("'%{klass}' is ignored.") % {:klass => klass}
44  
-	$stderr.puts $! if $DEBUG
  43
+        $stderr.puts _("'%{klass}' is ignored.") % {:klass => klass}
  44
+        $stderr.puts $! if $DEBUG
45 45
       end
46 46
     end
47 47
 
@@ -73,7 +73,8 @@ def generate_pot_header # :nodoc:
73 73
       sign = off <= 0 ? '-' : '+'
74 74
       time += sprintf('%s%02d%02d', sign, *(off.abs / 60).divmod(60))
75 75
 
76  
-      %Q[# SOME DESCRIPTIVE TITLE.
  76
+      <<TITLE
  77
+# SOME DESCRIPTIVE TITLE.
77 78
 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
78 79
 # This file is distributed under the same license as the PACKAGE package.
79 80
 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
@@ -89,42 +90,42 @@ def generate_pot_header # :nodoc:
89 90
 "MIME-Version: 1.0\\n"
90 91
 "Content-Type: text/plain; charset=UTF-8\\n"
91 92
 "Content-Transfer-Encoding: 8bit\\n"
92  
-"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\n"]
  93
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\n"
  94
+TITLE
93 95
     end
94 96
 
95 97
     def generate_pot(ary) # :nodoc:
96 98
       str = ""
97  
-      result = Array.new
98 99
       ary.each do |key|
99  
-	msgid = key.shift
100  
-	curr_pos = MAX_LINE_LEN
101  
-	key.each do |e|
102  
-	  if curr_pos + e.size > MAX_LINE_LEN
103  
-	    str << "\n#:"
104  
-	    curr_pos = 3
105  
-	  else
106  
-	    curr_pos += (e.size + 1)
107  
-	  end
108  
-	  str << " " << e
109  
-	end
110  
-	msgid.gsub!(/"/, '\"')
111  
-	msgid.gsub!(/\r/, '')
112  
-	if msgid.include?("\004")
113  
-	  msgctxt, msgid = msgid.split(/\004/)
114  
-	  str << "\nmsgctxt \"" << msgctxt << "\"\n"
  100
+        msgid = key.shift
  101
+        curr_pos = MAX_LINE_LEN
  102
+        key.each do |e|
  103
+          if curr_pos + e.size > MAX_LINE_LEN
  104
+            str << "\n#:"
  105
+            curr_pos = 3
  106
+          else
  107
+            curr_pos += (e.size + 1)
  108
+          end
  109
+          str << " " << e
  110
+        end
  111
+        msgid.gsub!(/"/, '\"')
  112
+        msgid.gsub!(/\r/, '')
  113
+        if msgid.include?("\004")
  114
+          msgctxt, msgid = msgid.split(/\004/)
  115
+          str << "\nmsgctxt \"" << msgctxt << "\"\n"
115 116
         else
116 117
           str << "\n"
117  
-	end	
118  
-	if msgid.include?("\000")
119  
-	  ids = msgid.split(/\000/)
120  
-	  str << "msgid \"" << ids[0] << "\"\n"
121  
-	  str << "msgid_plural \"" << ids[1] << "\"\n"
122  
-	  str << "msgstr[0] \"\"\n"
123  
-	  str << "msgstr[1] \"\"\n"
124  
-	else
125  
-	  str << "msgid \"" << msgid << "\"\n"
126  
-	  str << "msgstr \"\"\n"
127  
-	end
  118
+        end
  119
+        if msgid.include?("\000")
  120
+          ids = msgid.split(/\000/)
  121
+          str << "msgid \"" << ids[0] << "\"\n"
  122
+          str << "msgid_plural \"" << ids[1] << "\"\n"
  123
+          str << "msgstr[0] \"\"\n"
  124
+          str << "msgstr[1] \"\"\n"
  125
+        else
  126
+          str << "msgid \"" << msgid << "\"\n"
  127
+          str << "msgstr \"\"\n"
  128
+        end
128 129
       end
129 130
       str
130 131
     end
@@ -142,7 +143,7 @@ def normalize(ary)  # :nodoc:
142 143
                single_msg[0] != plural_msg[0])
143 144
             if single_msg[0] != key 
144 145
               warn %Q[Warning: n_("#{plural_msg[0].gsub(/\000/, '", "')}") and n_("#{single_msg[0].gsub(/\000/, '", "')}") are duplicated. First msgid was used.] 
145  
-                used_plural_msgs << single_msg[0]
  146
+              used_plural_msgs << single_msg[0]
146 147
             end
147 148
 
148 149
             single_msg[1..-1].each do |line_info|
@@ -167,17 +168,17 @@ def normalize(ary)  # :nodoc:
167 168
     def parse(files) # :nodoc:
168 169
       ary = []
169 170
       files.each do |file|
170  
-	begin
171  
-	  @ex_parsers.each do |klass|
172  
-	    if klass.target?(file)
173  
-	      ary = klass.parse(file, ary)
174  
-	      break
175  
-	    end
176  
-	  end
177  
-	rescue
178  
-	  puts "Error occurs in " + file
179  
-	  raise
180  
-	end
  171
+        begin
  172
+          @ex_parsers.each do |klass|
  173
+            if klass.target?(file)
  174
+              ary = klass.parse(file, ary)
  175
+              break
  176
+            end
  177
+          end
  178
+        rescue
  179
+          puts "Error occurs in " + file
  180
+          raise
  181
+        end
181 182
       end
182 183
       normalize(ary)
183 184
     end
@@ -193,33 +194,33 @@ def check_options # :nodoc:
193 194
       opts.separator(_("Specific options:"))
194 195
 
195 196
       opts.on("-o", "--output=FILE", _("write output to specified file")) do |out|
196  
-	unless FileTest.exist? out
197  
-	  output = File.new(File.expand_path(out), "w+")
198  
-	else
199  
-	  $stderr.puts(_("File '%s' already exists.") % out)
200  
-	  exit 1
201  
-	end
  197
+        unless FileTest.exist? out
  198
+          output = File.new(File.expand_path(out), "w+")
  199
+        else
  200
+          $stderr.puts(_("File '%s' already exists.") % out)
  201
+          exit 1
  202
+        end
202 203
       end
203 204
 
204 205
       opts.on("-r", "--require=library", _("require the library before executing rgettext")) do |out|
205  
-	require out
  206
+        require out
206 207
       end
207 208
 
208 209
       opts.on("-d", "--debug", _("run in debugging mode")) do
209  
-	$DEBUG = true
  210
+        $DEBUG = true
210 211
       end
211 212
 
212 213
       opts.on_tail("--version", _("display version information and exit")) do
213  
-	puts "#{$0} #{VERSION} (#{DATE})"
214  
-	puts "#{File.join(Config::CONFIG["bindir"], Config::CONFIG["RUBY_INSTALL_NAME"])} #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
215  
-	exit
  214
+        puts "#{$0} #{VERSION} (#{DATE})"
  215
+        puts "#{File.join(Config::CONFIG["bindir"], Config::CONFIG["RUBY_INSTALL_NAME"])} #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
  216
+        exit
216 217
       end
217 218
 
218 219
       opts.parse!(ARGV)
219 220
 
220 221
       if ARGV.size == 0
221  
-	puts opts.help
222  
-	exit 1
  222
+        puts opts.help
  223
+        exit 1
223 224
       end
224 225
 
225 226
       [ARGV, output]
@@ -227,38 +228,35 @@ def check_options # :nodoc:
227 228
 
228 229
     def run(targetfiles = nil, out = STDOUT)  # :nodoc:
229 230
       if targetfiles.is_a? String
230  
-	targetfiles = [targetfiles]
  231
+        targetfiles = [targetfiles]
231 232
       elsif ! targetfiles
232  
-	targetfiles, out = check_options
  233
+        targetfiles, out = check_options
233 234
       end
234 235
 
235 236
       if targetfiles.size == 0
236  
-	raise ArgumentError, _("no input files")
  237
+        raise ArgumentError, _("no input files")
237 238
       end
238 239
 
239 240
       if out.is_a? String
240  
-	File.open(File.expand_path(out), "w+") do |file|
241  
-	  file.puts generate_pot_header
242  
-	  file.puts generate_pot(parse(targetfiles))
243  
-	end
  241
+        File.open(File.expand_path(out), "w+") do |file|
  242
+          file.puts generate_pot_header
  243
+          file.puts generate_pot(parse(targetfiles))
  244
+        end
244 245
       else
245  
-	out.puts generate_pot_header
246  
-	out.puts generate_pot(parse(targetfiles))
  246
+        out.puts generate_pot_header
  247
+        out.puts generate_pot(parse(targetfiles))
247 248
       end
248 249
       self
249 250
     end
250 251
   end
251 252
 
252 253
   module_function
253  
-  # Creates a po-file from targetfiles(ruby-script-files, ActiveRecord, .rhtml files, glade-2 XML files), 
  254
+  # Creates a po-file from targetfiles(ruby-script-files, .rhtml files, glade-2 XML files), 
254 255
   # then output the result to out. If no parameter is set, it behaves same as command line tools(rgettet). 
255 256
   #
256 257
   # This function is a part of GetText.create_pofiles.
257 258
   # Usually you don't need to call this function directly.
258 259
   #
259  
-  # *Note* for ActiveRecord, you need to run your database server and configure the config/database.xml 
260  
-  # correctly before execute this function.
261  
-  #
262 260
   # * targetfiles: An Array of po-files or nil.
263 261
   # * out: output IO or output path.
264 262
   # * Returns: self
1  test/README
... ...
@@ -0,0 +1 @@
  1
+Go to gettext dir and run "rake makemo" prior to running any tests!
11  test/Rakefile
... ...
@@ -1,6 +1,9 @@
1  
-$:.unshift "../lib"
2  
-require 'rubygems'
3  
-require 'rake/testtask'
  1
+$LOAD_PATH.unshift "../lib"
  2
+
  3
+#gems that are required, to run the tests...
  4
+gem 'locale'
  5
+
  6
+task :default => :test
4 7
 
5 8
 desc "Create mo files"
6 9
 task :makemo do
@@ -11,6 +14,6 @@ end
11 14
 desc 'Run all tests'
12 15
 task :test do
13 16
    Dir.glob("test_*.rb").each do |path|
14  
-     ruby "-I../lib", "-rubygems", path
  17
+    ruby "-I../lib", "-rubygems", path rescue nil
15 18
    end
16 19
 end
2  test/test_class_info.rb
... ...
@@ -1,4 +1,4 @@
1  
-require 'test/unit'
  1
+require 'testlib/helper.rb'
2 2
 require 'gettext/class_info'
3 3
 
4 4
 module M1; end
22  test/test_gettext.rb
... ...
@@ -1,6 +1,4 @@
1  
-require 'test/unit'
2  
-require 'gettext'
3  
-
  1
+require 'testlib/helper.rb'
4 2
 require 'testlib/simple.rb'
5 3
 require 'testlib/gettext.rb'
6 4
 require 'testlib/sgettext.rb'
@@ -77,12 +75,12 @@ def test_pgettext
77 75
     GetText.locale = nil
78 76
     test = TestPGetText.new
79 77
 
80  
-    assert_equal("えーびー", test.test_1)
81  
-    assert_equal("えーびー", test.test_2)
82  
-    assert_equal("えーびーしー", test.test_3)
  78
+    assert_equal("鐃緒申鐃緒申鐃俊¥申", test.test_1)
  79
+    assert_equal("鐃緒申鐃緒申鐃俊¥申", test.test_2)
  80
+    assert_equal("鐃緒申鐃緒申鐃俊¥申鐃緒申鐃緒申", test.test_3)
83 81
     assert_equal("CCC", test.test_4)
84  
-    assert_equal("しーびー", test.test_5)
85  
-    assert_equal("びー", test.test_6)
  82
+    assert_equal("鐃緒申鐃緒申鐃俊¥申", test.test_5)
  83
+    assert_equal("鐃俊¥申", test.test_6)
86 84
 
87 85
     GetText.locale = "en"
88 86
     test = TestPGetText.new
@@ -98,10 +96,10 @@ def test_pgettext
98 96
   def test_npgettext
99 97
     GetText.locale = nil
100 98
     test = TestNPGetText.new
101  
-    assert_equal(["一つの本", "%{num}の本たち"], test.test_1)
102  
-    assert_equal(["一つの本", "%{num}の本たち"], test.test_2)
103  
-    assert_equal(["一つのハードカバー本", "%{num}のハードカバー本たち"], test.test_3)
104  
-    assert_equal(["マガジンを1冊持ってます。", "マガジンたちを%{num}冊持ってます。"], test.test_4)
  99
+    assert_equal(["鐃緒申弔鐃緒申鐃", "%{num}鐃緒申鐃旬わ申鐃緒申"], test.test_1)
  100
+    assert_equal(["鐃緒申弔鐃緒申鐃", "%{num}鐃緒申鐃旬わ申鐃緒申"], test.test_2)
  101
+    assert_equal(["鐃緒申弔離蓮鐃緒申疋鐃緒申弌鐃緒申鐃", "%{num}鐃塾ハ¥申鐃宿ワ申鐃出¥申鐃旬わ申鐃緒申"], test.test_3)
  102
+    assert_equal(["鐃殉ワ申鐃緒申鐃緒申鐃1鐃緒申鐃獣てまわ申鐃緒申", "鐃殉ワ申鐃緒申鐃藷たわ申鐃緒申%{num}鐃緒申鐃獣てまわ申鐃緒申"], test.test_4)
105 103
     assert_equal(["a picture", "%{num} pictures"], test.test_5)
106 104
   end
107 105
 
3  test/test_parser.rb
... ...
@@ -1,9 +1,8 @@
1  
-require 'test/unit'
  1
+require 'testlib/helper.rb'
2 2
 require 'gettext/parser/ruby'
3 3
 require 'gettext/parser/glade'
4 4
 require 'gettext/parser/erb'
5 5
 
6  
-require 'rubygems'
7 6
 require 'gettext/tools/rgettext'
8 7
 
9 8
 class TestGetTextParser < Test::Unit::TestCase
3  test/test_string.rb
... ...
@@ -1,5 +1,4 @@
1  
-require 'test/unit'
2  
-require 'gettext'
  1
+require 'testlib/helper.rb'
3 2
 
4 3
 class TestGetTextString < Test::Unit::TestCase
5 4
   def test_string_sprintf
4  test/test_textdomain.rb
... ...
@@ -1,6 +1,4 @@
1  
-require 'test/unit'
2  
-
3  
-require 'gettext'
  1
+require 'testlib/helper.rb'
4 2
 require 'testlib/simple'
5 3
 
6 4
 class TestTextDomain < Test::Unit::TestCase
4  test/test_textdomain_multi.rb
... ...
@@ -1,6 +1,4 @@
1  
-require 'test/unit'
2  
-
3  
-require 'gettext'
  1
+require 'testlib/helper.rb'
4 2
 require 'testlib/multi_textdomain.rb'
5 3
 
6 4
 class TestGetTextMulti < Test::Unit::TestCase
4  test/test_textdomain_toplevel.rb
... ...
@@ -1,6 +1,4 @@
1  
-require 'test/unit'
2  
-
3  
-require 'gettext'
  1
+require 'testlib/helper.rb'
4 2
 include GetText
5 3
 
6 4
 bindtextdomain("test1", :path => "locale")
11  test/testlib/helper.rb
... ...
@@ -0,0 +1,11 @@
  1
+$LOAD_PATH << File.expand_path("../../lib", File.dirname(__FILE__))
  2
+require 'test/unit'
  3
+
  4
+require 'rubygems'
  5
+require 'gettext'
  6
+
  7
+#optional gems
  8
+begin
  9
+  require 'redgreen'
  10
+rescue LoadError
  11
+end

0 notes on commit 6c0ef83

Please sign in to comment.
Something went wrong with that request. Please try again.