From rex.chung at gmail.com Sun Jan 7 20:03:47 2007 From: rex.chung at gmail.com (Rex Chung) Date: Mon, 8 Jan 2007 12:03:47 +1100 Subject: [gettext-u-en] gettext rails plugin locale in production mode Message-ID: Hi, >It was a bug of gettext-1.8.0 and it's been fixed in CVS. >Could you try CVS version of Ruby-GetText ? I've tried the CVS version by doing this: cvs -d :pserver:anonymous at rubyforge.org:/var/cvs/gettext checkout *gettext and then running ruby setup.rb on /gettext *That hasn't fix the issue. Any other suggestions? Thank you. Rex. On Thu, 28 Dec 2006 18:18:02 +1100 "Rex Chung" wrote: > Hi everyone, > > I am using gettext 1.8.0 with Rails 1.1.6 and it seems that when we start > Rails in 'production' mode the locale translations for > distance_of_time_in_words seems to be lost. It has been working in > development mode. > > I'm not sure where the differences are between 'development ' and > 'production' mode. Has anyone faced the same problem before? > > Thanks, > Rex. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/gettext-users-en/attachments/20070108/c0712b75/attachment.html From mutoh at highway.ne.jp Sat Jan 13 11:57:11 2007 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Sun, 14 Jan 2007 01:57:11 +0900 Subject: [gettext-u-en] gettext rails plugin locale in production mode In-Reply-To: References: Message-ID: <20070114015711.e95d9298.mutoh@highway.ne.jp> Hi, On Mon, 8 Jan 2007 12:03:47 +1100 "Rex Chung" wrote: > Hi, > > >It was a bug of gettext-1.8.0 and it's been fixed in CVS. > >Could you try CVS version of Ruby-GetText ? > > I've tried the CVS version by doing this: > cvs -d :pserver:anonymous at rubyforge.org:/var/cvs/gettext checkout *gettext > and then running ruby setup.rb on /gettext > > *That hasn't fix the issue. Any other suggestions? It seems to work to use my sample (gettext/samples/rails/app/views/blog/list.rhtml). Did you "gem uninstall gettext" first? > Thank you. > Rex. > > > On Thu, 28 Dec 2006 18:18:02 +1100 > "Rex Chung" wrote: > > > Hi everyone, > > > > I am using gettext 1.8.0 with Rails 1.1.6 and it seems that when we start > > Rails in 'production' mode the locale translations for > > distance_of_time_in_words seems to be lost. It has been working in > > development mode. > > > > I'm not sure where the differences are between 'development ' and > > 'production' mode. Has anyone faced the same problem before? > > > > Thanks, > > Rex. > > > From mutoh at highway.ne.jp Tue Jan 16 12:22:43 2007 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Wed, 17 Jan 2007 02:22:43 +0900 Subject: [gettext-u-en] Ruby gettext problem with localize_error_messages In-Reply-To: <45ABB295.1030006@latnet.lv> References: <45ABB295.1030006@latnet.lv> Message-ID: <20070117022243.0d1ecf38.mutoh@highway.ne.jp> Hi, Could you show test case or small sample to confirm it? On Mon, 15 Jan 2007 18:57:57 +0200 Janis Dzerins wrote: > Hello Masao and gettext hackers, > > I'm having difficulties with gettext and a Rails application. > Specificially, the localize_error_messages in active_record.rb file. > The problem is that the code assumes that each record has a string as an > error message for an attribute, but in reality it can also be an array. > So, when in my application an attribute has more than one error, I get > the following error: > > > TypeError: can't convert Array into String > > /opt/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/active_record.rb:210:in `=~' > > /opt/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/active_record.rb:210:in `localize_error_messages' > > /opt/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/active_record.rb:209:in `each' > > /opt/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/active_record.rb:209:in `localize_error_messages' > > /opt/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/active_record.rb:205:in `each' > > /opt/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/active_record.rb:205:in `localize_error_messages' > > /opt/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/active_record.rb:204:in `each_key' > > /opt/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/active_record.rb:204:in `localize_error_messages' > > /opt/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/active_record.rb:264:in `full_messages' > > test/unit/project_statistics_test.rb:24:in `test_validations' > > When searching for a solution for this problem, I found a discussion of > this (or very similar) problem in gettext-users-en mailing list > (http://rubyforge.org/pipermail/gettext-users-en/2006-August.txt) where > it looked like the problem should have been fixed in version 1.8.0. But > it isn't (or I'm doing something wrong, of course :) > > So, attached is a little patch which makes the problem go away for me. > I tried to keep the code changes at minimum to make the problem apparent. > > So, have I found a bug and fixed it or am I missing something here? > > -- > Janis Dzerins > > If million people say a stupid thing -- it's still a stupid thing. >