From reynard.list at gmail.com Fri Jul 7 16:57:44 2006 From: reynard.list at gmail.com (Reynard Hilman) Date: Fri, 7 Jul 2006 16:57:44 -0400 Subject: [gettext-u-en] using gettext version > 1.1 does not work Message-ID: <26e148920607071357o5dc4bf18g5de48577b15492a0@mail.gmail.com> Hi, I just tried using ruby gettext for my rails application, but all versions above 1.1.1 does not work when I try to do rake updatepo. error message was: rake aborted! uninitialized constant System also when I try to do the example, this does not work: rgettext hello.rb -o hello.pot /usr/lib/ruby/gems/1.8/gems/gettext-1.6.0/lib/gettext/locale_posix.rb:17: uninitialized constant Locale::System (NameError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from /usr/lib/ruby/gems/1.8/gems/gettext-1.6.0 /lib/gettext/locale.rb:40 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from /usr/lib/ruby/gems/1.8/gems/gettext-1.6.0/lib/gettext.rb:19 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from /usr/lib/ruby/gems/1.8/gems/gettext-1.6.0 /lib/gettext/rgettext.rb:16 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from /usr/lib/ruby/gems/1.8/gems/gettext-1.6.0/bin/rgettext:14 from /usr/bin/rgettext:18 however, this all work when I install gettext 1.1.1 am I missing something? thanks, - reynard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/gettext-users-en/attachments/20060707/757b62fa/attachment.html From mutoh at highway.ne.jp Fri Jul 7 23:20:06 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Sat, 8 Jul 2006 12:20:06 +0900 Subject: [gettext-u-en] using gettext version > 1.1 does not work In-Reply-To: <26e148920607071357o5dc4bf18g5de48577b15492a0@mail.gmail.com> References: <26e148920607071357o5dc4bf18g5de48577b15492a0@mail.gmail.com> Message-ID: <20060708122006.7217ad2f.mutoh@highway.ne.jp> Hi, The extension library (locale_system.so) seems not to be installed or broken. 1. Check /usr/lib/ruby/gems/1.8/gems/gettext-1.6.0/locale_system.so 2. Check the log of "gem install" carefully. # You install "gettext 1.6.0 (ruby)" version, don't you? 3. If you can't solve the problem by yourself, send here your gem's log and the result of "ruby script/about" and "rgettext -v" On Fri, 7 Jul 2006 16:57:44 -0400 "Reynard Hilman" wrote: > Hi, > I just tried using ruby gettext for my rails application, but all versions > above 1.1.1 does not work when I try to do rake updatepo. > error message was: > rake aborted! > uninitialized constant System > > also when I try to do the example, this does not work: > rgettext hello.rb -o hello.pot > > /usr/lib/ruby/gems/1.8/gems/gettext-1.6.0/lib/gettext/locale_posix.rb:17: > uninitialized constant Locale::System (NameError) > from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in > `require' > from /usr/lib/ruby/gems/1.8/gems/gettext-1.6.0 > /lib/gettext/locale.rb:40 > from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in > `require' > from /usr/lib/ruby/gems/1.8/gems/gettext-1.6.0/lib/gettext.rb:19 > from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in > `require' > from /usr/lib/ruby/gems/1.8/gems/gettext-1.6.0 > /lib/gettext/rgettext.rb:16 > from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in > `require' > from /usr/lib/ruby/gems/1.8/gems/gettext-1.6.0/bin/rgettext:14 > from /usr/bin/rgettext:18 > > however, this all work when I install gettext 1.1.1 > am I missing something? > > thanks, > - reynard > -- -- .:% Masao Mutoh From reynard.list at gmail.com Mon Jul 10 10:53:36 2006 From: reynard.list at gmail.com (Reynard Hilman) Date: Mon, 10 Jul 2006 10:53:36 -0400 Subject: [gettext-u-en] using gettext version > 1.1 does not work In-Reply-To: <20060708122006.7217ad2f.mutoh@highway.ne.jp> References: <26e148920607071357o5dc4bf18g5de48577b15492a0@mail.gmail.com> <20060708122006.7217ad2f.mutoh@highway.ne.jp> Message-ID: <26e148920607100753k6686fdd9i3b8e2691fc018bfd@mail.gmail.com> Hi, locale_system.so does not exist. after doing some more investigation actually I don't have make installed on my system yet. gomen ^^; I didn't notice that because gem install gettext reported Successfully installed gettext-1.6.0 but the previous lines have something like: command not found: make command not found: make install I should read all the log messages next time :) domo arigatou! - reynard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/gettext-users-en/attachments/20060710/d03aa61a/attachment.html From reynard.list at gmail.com Mon Jul 10 16:19:09 2006 From: reynard.list at gmail.com (Reynard Hilman) Date: Mon, 10 Jul 2006 16:19:09 -0400 Subject: [gettext-u-en] problem embedding error message in field Message-ID: <26e148920607101319n5793ceerf30e348494cf7b6d@mail.gmail.com> Hi, it's me again :) now I'm trying to display the ActiveRecord error message after the field (instead of listing them at the top), so I overwrite the rails function here (and include this from the environment.rb) ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| errmsg = instance.object.errors.on(instance.method_name).is_a?(Array) ? instance.object.errors.on(instance.method_name)[0] : instance.object.errors.on(instance.method_name) "
#{html_tag}
" + GetText._(errmsg) + "
" end the problem is the _() is not translating, it just returns the original string. I'm guessing maybe it does not find the textdomain? or something else? should this be possible? thanks, - reynard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/gettext-users-en/attachments/20060710/5f7c2c03/attachment.html From reynard.list at gmail.com Mon Jul 10 17:27:41 2006 From: reynard.list at gmail.com (Reynard Hilman) Date: Mon, 10 Jul 2006 17:27:41 -0400 Subject: [gettext-u-en] problem embedding error message in field In-Reply-To: <26e148920607101319n5793ceerf30e348494cf7b6d@mail.gmail.com> References: <26e148920607101319n5793ceerf30e348494cf7b6d@mail.gmail.com> Message-ID: <26e148920607101427v23deb026tec9a62a4bb594580@mail.gmail.com> Sorry, correction: the message actually gets translated but the %{fn} is not replaced with the field name. Should I call another function to do the replacement in the field_error_proc ? I'll dig more into the code, but I would really appreciate if someone can point where the code is :) thanks, - reynard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/gettext-users-en/attachments/20060710/93a418e2/attachment.html From reynard.list at gmail.com Tue Jul 11 11:02:33 2006 From: reynard.list at gmail.com (Reynard Hilman) Date: Tue, 11 Jul 2006 11:02:33 -0400 Subject: [gettext-u-en] problem embedding error message in field In-Reply-To: <26e148920607101427v23deb026tec9a62a4bb594580@mail.gmail.com> References: <26e148920607101319n5793ceerf30e348494cf7b6d@mail.gmail.com> <26e148920607101427v23deb026tec9a62a4bb594580@mail.gmail.com> Message-ID: <26e148920607110802o465efb87y46b54a0d696a921b@mail.gmail.com> Hi :) ok, so I solve it again. apparently the replacement happens in the ActiveRecord::Errors#full_messages that's overwritten in gettext plugin So here is the code that makes it work. ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| m = instance.object.errors.on(instance.method_name) errmsg = (m.is_a?(Array) ? m[0] : m) % {:fn => instance.object.class.human_attribute_name(instance.method_name)} "
#{html_tag}
" + GetText._(errmsg) + "
" end - reynard On 7/10/06, Reynard Hilman wrote: > > Sorry, correction: the message actually gets translated but the %{fn} is > not replaced with the field name. Should I call another function to do the > replacement in the field_error_proc ? > I'll dig more into the code, but I would really appreciate if someone can > point where the code is :) > > thanks, > - reynard > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/gettext-users-en/attachments/20060711/18938397/attachment.html From reynard.list at gmail.com Wed Jul 19 12:45:46 2006 From: reynard.list at gmail.com (Reynard Hilman) Date: Wed, 19 Jul 2006 12:45:46 -0400 Subject: [gettext-u-en] support for virtual attributes & possible patch? Message-ID: <26e148920607190945s564a0ed3hc6f13df29fb2cc01@mail.gmail.com> Hi, I'm wondering, is there currently a support for virtual attribute? So for example I have user table. I have password and password_confirmation fields, but they do not exist in the database table. It seems when I do updatepo, password and password confirmation does not get extracted. is there a workaround for this? Also I have created this patch that might be useful to be included: class ActiveRecord::Errors alias_method :ori_on, :on def on(attr) e = ori_on(attr) e.is_a?(Array) ? e.collect {|m| _(m) % {:fn => ActiveRecord:: Base.human_attribute_name(attr)} } : _(e) % {:fn => ActiveRecord::Base.human_attribute_name(attr)} if e end end this can probably be included in the rails.rb? The problem was the errors.on function does not translate the field before. I'm very new to ruby so let me know if there is better way of doing the patch :) thanks, - reynard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/gettext-users-en/attachments/20060719/9a5139d0/attachment.html From mutoh at highway.ne.jp Wed Jul 19 13:04:32 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Thu, 20 Jul 2006 02:04:32 +0900 Subject: [gettext-u-en] support for virtual attributes & possible patch? In-Reply-To: <26e148920607190945s564a0ed3hc6f13df29fb2cc01@mail.gmail.com> References: <26e148920607190945s564a0ed3hc6f13df29fb2cc01@mail.gmail.com> Message-ID: <20060720020432.32ddaf8e.mutoh@highway.ne.jp> Hi, On Wed, 19 Jul 2006 12:45:46 -0400 "Reynard Hilman" wrote: > Hi, > I'm wondering, is there currently a support for virtual attribute? So for > example I have user table. I have password and password_confirmation fields, > but they do not exist in the database table. It seems when I do updatepo, > password and password confirmation does not get extracted. > is there a workaround for this? Use N_(). e.g.) class User < ActiveRecord::Base attr_accessor :password, :password_confirmation N_("User|Password") N_("User|PasswordConfirmation") end > Also I have created this patch that might be useful to be included: > class ActiveRecord::Errors > alias_method :ori_on, :on > def on(attr) > e = ori_on(attr) > e.is_a?(Array) ? e.collect {|m| _(m) % {:fn => ActiveRecord:: > Base.human_attribute_name(attr)} } : > _(e) % {:fn => ActiveRecord::Base.human_attribute_name(attr)} if e > end > end > > this can probably be included in the rails.rb? > The problem was the errors.on function does not translate the field before. > I'm very new to ruby so let me know if there is better way of doing the > patch :) I didn't understand your request. Because, I think Ruby-GetText-Package-1.7.0 has been fixed this problem. But if it doesn't work, it may be a bug of Ruby-GetText-Package. Could you show me your sample code (not patch) ? P.S. You use Ruby-GetText-Package-1.7.0, don't you? -- .:% Masao Mutoh From anne at wjh.harvard.edu Sat Jul 29 16:11:06 2006 From: anne at wjh.harvard.edu (Anne G) Date: Sat, 29 Jul 2006 16:11:06 -0400 (EDT) Subject: [gettext-u-en] gettext for ruby-gnome2 Message-ID: Hi I am having trouble installing ruby gnome2 0.15 on my mac OS X. I tried to reinstall gettext, in order to reinstall glib, in order to reinstall gtk but I am getting an error message at the gettext installation. I put the log files from anne-g:~/Desktop/gettext-0.15 anne$ ./configure >& logconf.txt anne-g:~/Desktop/gettext-0.15 anne$ make check >& logmakecheck.txt at visionlab.harvard.edu/Members/Anne/logconf.txt and visionlab.harvard.edu/Members/Anne/logmakecheck.txt What is wrong with my install? Is there something I should have installed before I installed tettext? Is this the way to ruby gnome2? Is there an easier way on the mac OS X? thanks for your help. I install and reinstall and don't seem to make progress mostly. anne From mutoh at highway.ne.jp Sat Jul 29 23:18:56 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Sun, 30 Jul 2006 12:18:56 +0900 Subject: [gettext-u-en] gettext for ruby-gnome2 In-Reply-To: References: Message-ID: <20060730121856.4ba7d2a8.mutoh@highway.ne.jp> Hi, Your gettext is GNU gettext not Ruby-GetText. So there is no relation with Ruby-GetText. # Ruby-GetText is not depend on GNU GetText. And here is Ruby-GetText ML. And you mention about ruby-gnome2, but it also has no relation with compiling GNU GetText. So, I recommand to go GNU GetText ML to ask about compiling GNU GetText. But you should ask them not to mention both of Ruby-GNOME2 and Ruby-GetText. IMO, you should consider what's happen on your machine by yourself. My suggestion is to read logmakecheck.txt well. On Sat, 29 Jul 2006 16:11:06 -0400 (EDT) Anne G wrote: > Hi > > I am having trouble installing ruby gnome2 0.15 on my mac OS > X. > > I tried to reinstall gettext, in order to reinstall glib, in > order to reinstall gtk but I am getting an error message > at the gettext installation. > > I put the log files from > anne-g:~/Desktop/gettext-0.15 anne$ ./configure >& logconf.txt > anne-g:~/Desktop/gettext-0.15 anne$ make check >& logmakecheck.txt > > at > visionlab.harvard.edu/Members/Anne/logconf.txt > and > visionlab.harvard.edu/Members/Anne/logmakecheck.txt > > What is wrong with my install? Is there something I should > have installed before I installed tettext? > > Is this the way to ruby gnome2? Is there an easier way on > the mac OS X? thanks for your help. I install and reinstall > and don't seem to make progress mostly. > > anne > > > > > _______________________________________________ > gettext-users-en mailing list > gettext-users-en at rubyforge.org > http://rubyforge.org/mailman/listinfo/gettext-users-en > -- -- .:% Masao Mutoh