From sakuro at ex-machina.jp Mon Jul 10 22:18:59 2006 From: sakuro at ex-machina.jp (OZAWA Sakuro) Date: Tue, 11 Jul 2006 11:18:59 +0900 Subject: [gettext-u-ja] undefined method `_' Message-ID: ???????? ML ????????????5??????????????? ??????????? Rails ????????rake test:units ???? ActiveRecord ? validation ??????? ????????????????????? 1) Failure: test_name_length(PersonTest) [./test/unit/person_test.rb:7]: exception expected but was Class: Message: <"undefined method `_' for #"> ---Backtrace--- /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/ active_record/base.rb:1792:in `method_missing' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.6.0/lib/gettext/rails.rb: 266:in `gettext' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.6.0/lib/gettext/rails.rb: 306:in `full_messages' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.6.0/lib/gettext/rails.rb: 304:in `full_messages' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.6.0/lib/gettext/rails.rb: 300:in `full_messages' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.6.0/lib/gettext/rails.rb: 299:in `full_messages' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/ active_record/validations.rb:13:in `initialize' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/ active_record/validations.rb:736:in `save!' ./test/unit/person_test.rb:9:in `test_name_length' ./test/unit/person_test.rb:7:in `test_name_length' ruby script/about ?????(development ??)? $ ruby script/about About your application's environment Ruby version 1.8.4 (i686-darwin) RubyGems version 0.9.0 Rails version 1.1.4 Active Record version 1.14.3 Action Pack version 1.12.3 Action Web Service version 1.1.4 Action Mailer version 1.2.3 Active Support version 1.3.1 Application root /Users/sakuro/test Environment development Database adapter sqlite3 Database schema version 1 ??????????????? $ rails -q -d sqlite3 test $ cd test $ ruby script/generate model Person $ vi db/migrate/001_create_people.rb ?up?????? t.column :name, :string ????? ???? $ rake db:migrate $ vi app/models/person.rb ?????? validates_length_of :name, :minimum => 2 ?? ?? $ vi test/unit/person_test.rb ???? test_truth ??? ?????????????? def test_name_length assert_raise(ActiveRecord::RecordInvalid) do p = Person.new(:name => 'X') p.save! end end $ rake test:units ??????????????? $ vi app/controllers/application.rb ???? require 'gettext/rails' ???? ?????? init_gettext 'test' ????(????? ???????????) $ rake test:units ????????? ????? -- OZAWA Sakuro Fere libenter homines id quod volunt credunt. From sakuro at ex-machina.jp Tue Jul 11 01:28:09 2006 From: sakuro at ex-machina.jp (OZAWA Sakuro) Date: Tue, 11 Jul 2006 14:28:09 +0900 Subject: [gettext-u-ja] undefined method `_' In-Reply-To: References: Message-ID: <24C0E6CE-A1DE-49BD-B757-AE34BEA123C9@ex-machina.jp> On 2006/07/11, at 11:18, OZAWA Sakuro wrote: > ML ????????????5??????????????? > ??????????? > Rails ????????rake test:units ???? > ActiveRecord ? validation ??????? > ????????????????????? (?) http://www.yotabanana.com/lab/20060614.html#p01 ??????????????????? -- OZAWA Sakuro Fere libenter homines id quod volunt credunt. From sakuro at ex-machina.jp Tue Jul 11 01:52:52 2006 From: sakuro at ex-machina.jp (OZAWA Sakuro) Date: Tue, 11 Jul 2006 14:52:52 +0900 Subject: [gettext-u-ja] =?iso-2022-jp?b?TWlncmF0aW9uGyRCJEckTjtITVEbKEI=?= Message-ID: <46E3E0CE-93C2-478F-A041-B1FDDC9349AB@ex-machina.jp> ????? ?????????(??????)?????????? ????????? ?????????????????Migration??????? ?????? ??????? require 'gettext/rails' # ???? class CreateRoles < ActiveRecord::Migration extend GetText # ??? def self.up create_table :roles do |t| t.column :name, :string end Role.reset_column_information Role.create(:name => N_('Administrator')) Role.create(:name => N_('Generic User')) Role.create(:name => N_('Guest')) end end ???Migration???? extend GetText????? ??????????? ??????????????????? -------------- next part -------------- A non-text attachment was scrubbed... Name: migration.diff Type: application/octet-stream Size: 234 bytes Desc: not available Url : http://rubyforge.org/pipermail/gettext-users-ja/attachments/20060711/8cfddbc2/attachment.obj -------------- next part -------------- -- OZAWA Sakuro Fere libenter homines id quod volunt credunt. From mutoh at highway.ne.jp Tue Jul 11 14:04:57 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Wed, 12 Jul 2006 03:04:57 +0900 Subject: [gettext-u-ja] undefined method `_' In-Reply-To: <24C0E6CE-A1DE-49BD-B757-AE34BEA123C9@ex-machina.jp> References: <24C0E6CE-A1DE-49BD-B757-AE34BEA123C9@ex-machina.jp> Message-ID: <20060712030457.22ff825f.mutoh@highway.ne.jp> ?????? ???????????? ?????????????????????? ????????????????????????? On Tue, 11 Jul 2006 14:28:09 +0900 OZAWA Sakuro wrote: > On 2006/07/11, at 11:18, OZAWA Sakuro wrote: > > > ML ????????????5??????????????? > > ??????????? > > Rails ????????rake test:units ???? > > ActiveRecord ? validation ??????? > > ????????????????????? > > (?) > > http://www.yotabanana.com/lab/20060614.html#p01 > > ??????????????????? > > -- > OZAWA Sakuro > Fere libenter homines id quod volunt credunt. > > > > > _______________________________________________ > gettext-users-ja mailing list > gettext-users-ja at rubyforge.org > http://rubyforge.org/mailman/listinfo/gettext-users-ja > -- -- .:% Masao Mutoh From mutoh at highway.ne.jp Tue Jul 11 14:11:38 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Wed, 12 Jul 2006 03:11:38 +0900 Subject: [gettext-u-ja] =?iso-2022-jp?b?TWlncmF0aW9uGyRCJEckTjtITVEbKEI=?= In-Reply-To: <46E3E0CE-93C2-478F-A041-B1FDDC9349AB@ex-machina.jp> References: <46E3E0CE-93C2-478F-A041-B1FDDC9349AB@ex-machina.jp> Message-ID: <20060712031138.500fdaf7.mutoh@highway.ne.jp> ?????? On Tue, 11 Jul 2006 14:52:52 +0900 OZAWA Sakuro wrote: > ????? > > ?????????(??????)?????????? > ????????? > ?????????????????Migration??????? > ?????? > ??????? > > require 'gettext/rails' # ???? > > class CreateRoles < ActiveRecord::Migration > > extend GetText # ??? > > def self.up > create_table :roles do |t| > t.column :name, :string > end > > Role.reset_column_information > Role.create(:name => N_('Administrator')) > Role.create(:name => N_('Generic User')) > Role.create(:name => N_('Guest')) > end > > end > > ???Migration???? extend GetText????? > ??????????? > ??????????????????? ????????????????????????????????? ?????????????????????????? N_()???????(Administrator??)??DB??Administrator ??????????????????_()?????????????? ??????????? ????????????????????????????? (po/mo-file)??????????????????????? ??????Globalize??????????? ????????????????????? -- .:% Masao Mutoh From sakuro at ex-machina.jp Tue Jul 11 21:30:19 2006 From: sakuro at ex-machina.jp (OZAWA Sakuro) Date: Wed, 12 Jul 2006 10:30:19 +0900 Subject: [gettext-u-ja] =?iso-2022-jp?b?TWlncmF0aW9uGyRCJEckTjtITVEbKEI=?= In-Reply-To: <20060712031138.500fdaf7.mutoh@highway.ne.jp> References: <46E3E0CE-93C2-478F-A041-B1FDDC9349AB@ex-machina.jp> <20060712031138.500fdaf7.mutoh@highway.ne.jp> Message-ID: ????? On 2006/07/12, at 3:11, Masao Mutoh wrote: > ?????????????????????????? > N_()???????(Administrator??)??DB > ??Administrator > ??????????????????_()???????? > ?????? > ??????????? ?????????DB???????????????????? ???????? ???????.rb???????????(?????? ???) _('Male'); _('Female') ????????????????????????? Migration???? DB?????????INSERT???????????????? ?? Migration???????????????DRY????? > ????????????????????????????? > (po/mo-file)??????????????????????? ???????????? ???????????????ActiveRecord???????? ??? ?????????:-) -- OZAWA Sakuro Fere libenter homines id quod volunt credunt. From nori1 at dolphin.c.u-tokyo.ac.jp Tue Jul 25 18:49:07 2006 From: nori1 at dolphin.c.u-tokyo.ac.jp (Kobayashi Noritada) Date: Wed, 26 Jul 2006 07:49:07 +0900 (JST) Subject: [gettext-u-ja] Using user-defined parsers for rgettext Message-ID: <20060726.074907.41637336.nori1@dolphin.c.u-tokyo.ac.jp> ??????????? ????????????????????????????? ??????????????????????? ???????????? rgettext ???? pot ??????????? ?????????????????? ?????? ??????????? (Debian Weekly News ???) ? po ???? ????????????????????? (??? HTML ??????) ? ?????????????????????????????????????? ?? API ?? (????? public ? API ??????????) gettext/parser/*.rb ? GetText::*.parse ??????????? ??????? gettext/rgettext.rb ?????? gettext/parser/*.rb ????????? @ex_parsers ??????????? ????????gettext/rgettext.rb ??????????????????? pot ????????????????? # ????? # GetText::RGetText.generate_pot_header ? GetText::RGetText.generate_pot # ????????????????????????????? # (????????????????????????????????) ????rgettext ?????????????????????????? GetText::RGetText ?????????????????????????? ?????????? ????????????????????????? pot ???????? ?????????????????????????????????? ???????????????????????????????? ???????????????? ?????????????????????????????????????? ????????????????????????????????? -- |: Noritada KOBAYASHI |: Dept. of General Systems Studies, |: Graduate School of Arts and Sciences, Univ. of Tokyo |: E-mail: nori1 at dolphin.c.u-tokyo.ac.jp (preferable) |: nori at esa.c.u-tokyo.ac.jp |: Key fingerprint = AB26 9533 81DA 997B 3C06 4380 19BB ADA0 695C 9F53 -------------- next part -------------- --- lib/gettext/rgettext.rb.orig Mon Jul 24 15:33:56 2006 +++ lib/gettext/rgettext.rb Wed Jul 26 01:30:24 2006 @@ -37,7 +37,7 @@ ["ruby.rb", "RubyParser"] # Default parser. ].each do |f, klass| begin - require File.join("gettext/parser/#{f}") + require "gettext/parser/#{f}" @ex_parsers << GetText.const_get(klass) rescue $stderr.puts _("'%{klass}' is ignored.") % {:klass => klass} From mutoh at highway.ne.jp Fri Jul 28 23:32:31 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Sat, 29 Jul 2006 12:32:31 +0900 Subject: [gettext-u-ja] Using user-defined parsers for rgettext In-Reply-To: <20060726.074907.41637336.nori1@dolphin.c.u-tokyo.ac.jp> References: <20060726.074907.41637336.nori1@dolphin.c.u-tokyo.ac.jp> Message-ID: <20060729123231.4a6c4f55.mutoh@highway.ne.jp> ?????? ????????????? ???????????????????????????????????? ?????????????????????? On Wed, 26 Jul 2006 07:49:07 +0900 (JST) Kobayashi Noritada wrote: > ??????????? > ????????????????????????????? > ??????????????????????? > > ???????????? rgettext ???? pot ??????????? > ?????????????????? > ?????? > ??????????? (Debian Weekly News ???) ? po ???? > ????????????????????? (??? HTML ??????) ? > ?????????????????????????????????????? > ?? API ?? > (????? public ? API ??????????) gettext/parser/*.rb ? > GetText::*.parse ??????????? > ??????? gettext/rgettext.rb ?????? > gettext/parser/*.rb ????????? @ex_parsers ??????????? > ????????gettext/rgettext.rb ??????????????????? > pot ????????????????? > # ????? > # GetText::RGetText.generate_pot_header ? GetText::RGetText.generate_pot > # ????????????????????????????? > # (????????????????????????????????) > ????rgettext ?????????????????????????? > GetText::RGetText ?????????????????????????? > ?????????? ?????????????????????????????????? ???????????????? ????????????????????????????????? ?????????????????????????? > ?????????????????????????????????????? > ????????????????????????????????? ????????????????????? -- .:% Masao Mutoh From mutoh at highway.ne.jp Sat Jul 29 00:41:58 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Sat, 29 Jul 2006 13:41:58 +0900 Subject: [gettext-u-ja] Using user-defined parsers for rgettext In-Reply-To: <20060729123231.4a6c4f55.mutoh@highway.ne.jp> References: <20060726.074907.41637336.nori1@dolphin.c.u-tokyo.ac.jp> <20060729123231.4a6c4f55.mutoh@highway.ne.jp> Message-ID: <20060729134158.5b9c761b.mutoh@highway.ne.jp> ?????? On Sat, 29 Jul 2006 12:32:31 +0900 Masao Mutoh wrote: > > ???????????? rgettext ???? pot ??????????? > > ?????????????????? ??? > ?????????????????????????????????? > ???????????????? > ????????????????????????????????? > ?????????????????????????? ???CVS?????????? ?????????????????????????????????? ???? ????????????????? target?, parse??????????????????????? ???????GetText::RGetText??????? require 'gettext/rgettext' module TestParser module_function # ????????????????????????? # ??????????????true????????false?????? def target?(file) true end # ?????????????? # file?????????????????? # ary???????????????????????????????? # ??msgid?????????????????????????????? # ???????????????ary??????msgid???????? # ??????????? # ?????[["msgid1", "file1:line1", "file2:line2",...], # ["msgid2", "file3:line3",...]] # ???????? def parse(file, ary) [["aaa", "foo.rb:200"], ["bbb", "bar.rb:300", "baz.rb:400"]] end end GetText::RGetText.add_parser(TestParser) ???testparser.rb????????? ?????rgettext???????OK??? $ rgettext -rtestparser foo.txt -o foo.pot Rake??????require 'testparser'??????????? ?????????????? ??????????????????rgettext? pot?????????????????????????? ;)? ????? P.S. ??????????????????????Rails?????????? ????????Rails?????????????????????????? -- .:% Masao Mutoh From nori1 at dolphin.c.u-tokyo.ac.jp Sat Jul 29 04:28:58 2006 From: nori1 at dolphin.c.u-tokyo.ac.jp (Kobayashi Noritada) Date: Sat, 29 Jul 2006 17:28:58 +0900 (JST) Subject: [gettext-u-ja] Using user-defined parsers for rgettext In-Reply-To: <20060729134158.5b9c761b.mutoh@highway.ne.jp> References: <20060726.074907.41637336.nori1@dolphin.c.u-tokyo.ac.jp> <20060729123231.4a6c4f55.mutoh@highway.ne.jp> <20060729134158.5b9c761b.mutoh@highway.ne.jp> Message-ID: <20060729.172858.07631809.nori1@dolphin.c.u-tokyo.ac.jp> ????? > ?????? > > > ???????????? rgettext ???? pot ??????????? > > > ?????????????????? [snip] > ???CVS?????????? > ???? [snip] ???????????????!! ??????????? API ???????:-) > ??????????????????rgettext? > pot?????????????????????????? ;)? ??????????????????????????????????? ???????????! -- |: Noritada KOBAYASHI |: Dept. of General Systems Studies, |: Graduate School of Arts and Sciences, Univ. of Tokyo |: E-mail: nori1 at dolphin.c.u-tokyo.ac.jp (preferable) |: nori at esa.c.u-tokyo.ac.jp |: Key fingerprint = AB26 9533 81DA 997B 3C06 4380 19BB ADA0 695C 9F53