From christian.buggle at m-sales.com Wed Aug 6 04:23:36 2008 From: christian.buggle at m-sales.com (mSALES - Christian Buggle) Date: Wed, 6 Aug 2008 10:23:36 +0200 Subject: [gettext-u-en] Untranslated text appears under heavy load Message-ID: Hi, > Hi, I'm currently using Rails 2.0.2 and gettext gems 1.91.0. I'm > currently experiencing issues with my website when the load is > higher. Random untranslated text appears on the page. It is not the > entire page that is untranslated, only 1 part or 2. And the parts > are random and it happens through out the website. Using Rails 2.1.0 and gettext (1.91.0), I am experiencing virtually the same problem. Our application comes in ~10 languages, and when the error occurs some parts of the page are delievered in a wrong language, or untranslated respectively ("translated" into the default locale I guess). All malicious parts of a given page come in the same wrong language. Reloading the page will fully / correctly translate the page most of the time. Reloading again and again will yield a malicious page approx. every 10th to 40th try. This happens only under heavy load, mostly in our productive environment. It is very hard (yet possible) to generate the issue on our testing server. Trying to isolate the problem we think we can rule out most other causes (e.g. caching). Is this a known issue with gettext? Is there any fix or workaround? Christian -- mSALES GmbH - Christian Buggle christian.buggle at m-sales.com Albert-Nestler-Str. 24 76131 Karlsruhe -- Christian Buggle christian.buggle at m-sales.com mSALES GmbH Albert-Nestler-Str. 24 - 76131 Karlsruhe - Germany From mutoh at highway.ne.jp Wed Aug 6 11:34:15 2008 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Thu, 7 Aug 2008 00:34:15 +0900 Subject: [gettext-u-en] Untranslated text appears under heavy load In-Reply-To: References: Message-ID: <20080807003415.48cad42d.mutoh@highway.ne.jp> Hi, How about gettext-1.92.0 with Rails-2.1.0 ? On Wed, 6 Aug 2008 10:23:36 +0200 mSALES - Christian Buggle wrote: > Hi, > > > Hi, I'm currently using Rails 2.0.2 and gettext gems 1.91.0. I'm > > currently experiencing issues with my website when the load is > > higher. Random untranslated text appears on the page. It is not the > > entire page that is untranslated, only 1 part or 2. And the parts > > are random and it happens through out the website. > > > Using Rails 2.1.0 and gettext (1.91.0), I am experiencing virtually > the same problem. > > Our application comes in ~10 languages, and when the error occurs some > parts of the page are delievered in a wrong language, or untranslated > respectively ("translated" into the default locale I guess). All > malicious parts of a given page come in the same wrong language. > > Reloading the page will fully / correctly translate the page most of > the time. Reloading again and again will yield a malicious page > approx. every 10th to 40th try. > > This happens only under heavy load, mostly in our productive > environment. It is very hard (yet possible) to generate the issue on > our testing server. > > Trying to isolate the problem we think we can rule out most other > causes (e.g. caching). > > Is this a known issue with gettext? Is there any fix or workaround? > > Christian > > -- > mSALES GmbH - Christian Buggle > christian.buggle at m-sales.com > Albert-Nestler-Str. 24 > 76131 Karlsruhe > > > > -- > Christian Buggle > christian.buggle at m-sales.com > mSALES GmbH > Albert-Nestler-Str. 24 - 76131 Karlsruhe - Germany > > > > > _______________________________________________ > gettext-users-en mailing list > gettext-users-en at rubyforge.org > http://rubyforge.org/mailman/listinfo/gettext-users-en > -- .:% Masao Mutoh From christian.buggle at m-sales.com Thu Aug 7 11:54:19 2008 From: christian.buggle at m-sales.com (mSALES - Christian Buggle) Date: Thu, 7 Aug 2008 17:54:19 +0200 Subject: [gettext-u-en] Untranslated text appears under heavy load In-Reply-To: <20080807003415.48cad42d.mutoh@highway.ne.jp> References: <20080807003415.48cad42d.mutoh@highway.ne.jp> Message-ID: <4B2379A9-5EFA-4B56-BDA6-52FC4D00EC4F@m-sales.com> Hi, > How about gettext-1.92.0 with Rails-2.1.0 ? Yes, it seems that updating to 1.92.0 has fixed the issue. Thanks Masao for the great work! Christian p.s. Sorry for bothering. I had checked for the most recent gettext version last friday, just hours before 1.92.0 was released. So I wasn't aware there was a new release when i wrote my initial mail, should have checked again before writing :-) -- Christian Buggle christian.buggle at m-sales.com mSALES GmbH Albert-Nestler-Str. 24 - 76131 Karlsruhe - Germany From cyberf at cyberf.org Fri Aug 8 07:12:54 2008 From: cyberf at cyberf.org (=?ISO-8859-1?Q?Fran_Pe=F1a?=) Date: Fri, 08 Aug 2008 13:12:54 +0200 Subject: [gettext-u-en] gettext and Rails Cells error Message-ID: <489C2A36.6050309@cyberf.org> Hello there! Happy Olympics Day! It seems that gettext breaks Rails Cells (http://cells.rubyforge.org/) somehow My setup is Rails 2.1, latest Cells from git, and gettext 1.92.0 When I add the require 'gettext/rails' line to my environment.rb file I get this when trying to render a cell view: |undefined method `file_exists?' for # Any clues on how to fix this? Thanks in advance | From mutoh at highway.ne.jp Fri Aug 8 09:13:45 2008 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Fri, 8 Aug 2008 22:13:45 +0900 Subject: [gettext-u-en] gettext and Rails Cells error In-Reply-To: <489C2A36.6050309@cyberf.org> References: <489C2A36.6050309@cyberf.org> Message-ID: <20080808221345.a54d870f.mutoh@highway.ne.jp> Hi, How about to use config.gem, unless 'require' ? On Fri, 08 Aug 2008 13:12:54 +0200 Fran Pe?a wrote: > Hello there! Happy Olympics Day! > It seems that gettext breaks Rails Cells (http://cells.rubyforge.org/) > somehow > My setup is Rails 2.1, latest Cells from git, and gettext 1.92.0 > When I add the require 'gettext/rails' line to my environment.rb file I > get this when trying to render a cell view: > > |undefined method `file_exists?' for # > > Any clues on how to fix this? > Thanks in advance > | > > > _______________________________________________ > gettext-users-en mailing list > gettext-users-en at rubyforge.org > http://rubyforge.org/mailman/listinfo/gettext-users-en > -- .:% Masao Mutoh From cyberf at cyberf.org Fri Aug 8 10:41:51 2008 From: cyberf at cyberf.org (=?UTF-8?B?RnJhbiBQZcOxYQ==?=) Date: Fri, 08 Aug 2008 16:41:51 +0200 Subject: [gettext-u-en] gettext and Rails Cells error In-Reply-To: <20080808221345.a54d870f.mutoh@highway.ne.jp> References: <489C2A36.6050309@cyberf.org> <20080808221345.a54d870f.mutoh@highway.ne.jp> Message-ID: <489C5B2F.5010507@cyberf.org> Hello Masao. I'm sorry, I'm a newbie and I can't figure out how to use this information. If you could please explain that to me a little more that'd be nice. Masao Mutoh wrote: > Hi, > > How about to use config.gem, unless 'require' ? > > On Fri, 08 Aug 2008 13:12:54 +0200 > Fran Pe?a wrote: > > >> Hello there! Happy Olympics Day! >> It seems that gettext breaks Rails Cells (http://cells.rubyforge.org/) >> somehow >> My setup is Rails 2.1, latest Cells from git, and gettext 1.92.0 >> When I add the require 'gettext/rails' line to my environment.rb file I >> get this when trying to render a cell view: >> >> |undefined method `file_exists?' for # >> >> Any clues on how to fix this? >> Thanks in advance >> | >> >> >> _______________________________________________ >> gettext-users-en mailing list >> gettext-users-en at rubyforge.org >> http://rubyforge.org/mailman/listinfo/gettext-users-en >> >> > > > From mharvey at intraware.com Fri Aug 8 12:00:33 2008 From: mharvey at intraware.com (Matt Harvey) Date: Fri, 8 Aug 2008 09:00:33 -0700 Subject: [gettext-u-en] gettext and Rails Cells error References: <489C2A36.6050309@cyberf.org><20080808221345.a54d870f.mutoh@highway.ne.jp> <489C5B2F.5010507@cyberf.org> Message-ID: <0F87239BE4CED74A9F45871B120FC96CED817D@WinExc01.corp.intraware.com> I think he means to make sure you don't "require 'gettext'" in your environment.rb or initializers. Instead, add "config.gem 'gettext'" to your "Rails::Initializer.run do |config|" block. I am definitely not clear on why that would fix this problem. Maybe the following will help as well: http://zargony.com/2008/02/12/edge-rails-and-gettext-undefined-method-file_exists-nomethoderror -----Original Message----- From: gettext-users-en-bounces at rubyforge.org on behalf of Fran Pe?a Sent: Fri 8/8/2008 7:41 AM To: Masao Mutoh Cc: gettext-users-en at rubyforge.org Subject: Re: [gettext-u-en] gettext and Rails Cells error Hello Masao. I'm sorry, I'm a newbie and I can't figure out how to use this information. If you could please explain that to me a little more that'd be nice. Masao Mutoh wrote: > Hi, > > How about to use config.gem, unless 'require' ? > > On Fri, 08 Aug 2008 13:12:54 +0200 > Fran Pe?a wrote: > > >> Hello there! Happy Olympics Day! >> It seems that gettext breaks Rails Cells (http://cells.rubyforge.org/) >> somehow >> My setup is Rails 2.1, latest Cells from git, and gettext 1.92.0 >> When I add the require 'gettext/rails' line to my environment.rb file I >> get this when trying to render a cell view: >> >> |undefined method `file_exists?' for # >> >> Any clues on how to fix this? >> Thanks in advance >> | >> >> >> _______________________________________________ >> gettext-users-en mailing list >> gettext-users-en at rubyforge.org >> http://rubyforge.org/mailman/listinfo/gettext-users-en >> >> > > > _______________________________________________ gettext-users-en mailing list gettext-users-en at rubyforge.org http://rubyforge.org/mailman/listinfo/gettext-users-en -------------- next part -------------- An HTML attachment was scrubbed... URL: From mutoh at highway.ne.jp Sat Aug 9 08:59:49 2008 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Sat, 9 Aug 2008 21:59:49 +0900 Subject: [gettext-u-en] gettext and Rails Cells error In-Reply-To: <489C5B2F.5010507@cyberf.org> References: <489C2A36.6050309@cyberf.org> <20080808221345.a54d870f.mutoh@highway.ne.jp> <489C5B2F.5010507@cyberf.org> Message-ID: <20080809215949.df3c984e.mutoh@highway.ne.jp> Hi, See: http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html#config%2Fenvironment.rb On Fri, 08 Aug 2008 16:41:51 +0200 Fran Pe?a wrote: > Hello Masao. > I'm sorry, I'm a newbie and I can't figure out how to use this > information. If you could please explain that to me a little more that'd > be nice. > > Masao Mutoh wrote: > > Hi, > > > > How about to use config.gem, unless 'require' ? > > > > On Fri, 08 Aug 2008 13:12:54 +0200 > > Fran Pe?a wrote: > > > > > >> Hello there! Happy Olympics Day! > >> It seems that gettext breaks Rails Cells (http://cells.rubyforge.org/) > >> somehow > >> My setup is Rails 2.1, latest Cells from git, and gettext 1.92.0 > >> When I add the require 'gettext/rails' line to my environment.rb file I > >> get this when trying to render a cell view: > >> > >> |undefined method `file_exists?' for # > >> > >> Any clues on how to fix this? > >> Thanks in advance > >> | > >> > >> > >> _______________________________________________ > >> gettext-users-en mailing list > >> gettext-users-en at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/gettext-users-en > >> > >> > > > > > > > > -- .:% Masao Mutoh From mutoh at highway.ne.jp Sat Aug 9 09:03:55 2008 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Sat, 9 Aug 2008 22:03:55 +0900 Subject: [gettext-u-en] gettext and Rails Cells error In-Reply-To: <20080809215949.df3c984e.mutoh@highway.ne.jp> References: <489C2A36.6050309@cyberf.org> <20080808221345.a54d870f.mutoh@highway.ne.jp> <489C5B2F.5010507@cyberf.org> <20080809215949.df3c984e.mutoh@highway.ne.jp> Message-ID: <20080809220355.6a7d5978.mutoh@highway.ne.jp> BTW, I don't know Cell well, But what version of Cell do you use? It seems the error is occured by Cell itself. > >> |undefined method `file_exists?' for # On Sat, 9 Aug 2008 21:59:49 +0900 Masao Mutoh wrote: > > > > Hi, > > > > > > How about to use config.gem, unless 'require' ? > > > -- .:% Masao Mutoh From mutoh at highway.ne.jp Sat Aug 9 09:10:31 2008 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Sat, 9 Aug 2008 22:10:31 +0900 Subject: [gettext-u-en] gettext and Rails Cells error In-Reply-To: <0F87239BE4CED74A9F45871B120FC96CED817D@WinExc01.corp.intraware.com> References: <489C2A36.6050309@cyberf.org> <20080808221345.a54d870f.mutoh@highway.ne.jp> <489C5B2F.5010507@cyberf.org> <0F87239BE4CED74A9F45871B120FC96CED817D@WinExc01.corp.intraware.com> Message-ID: <20080809221031.fa0b50d9.mutoh@highway.ne.jp> Hi, I think I fixed file_exist? problem, and my sample blog(under rails-2.1) works unless this error. Is it the problem of gettext? If you have any information, tell me the details. On Fri, 8 Aug 2008 09:00:33 -0700 "Matt Harvey" wrote: > I think he means to make sure you don't "require 'gettext'" in your environment.rb or initializers. Instead, add "config.gem 'gettext'" to your "Rails::Initializer.run do |config|" block. I am definitely not clear on why that would fix this problem. Maybe the following will help as well: > > http://zargony.com/2008/02/12/edge-rails-and-gettext-undefined-method-file_exists-nomethoderror > > > -----Original Message----- > From: gettext-users-en-bounces at rubyforge.org on behalf of Fran Pe?a > Sent: Fri 8/8/2008 7:41 AM > To: Masao Mutoh > Cc: gettext-users-en at rubyforge.org > Subject: Re: [gettext-u-en] gettext and Rails Cells error > > Hello Masao. > I'm sorry, I'm a newbie and I can't figure out how to use this > information. If you could please explain that to me a little more that'd > be nice. > > Masao Mutoh wrote: > > Hi, > > > > How about to use config.gem, unless 'require' ? > > > > On Fri, 08 Aug 2008 13:12:54 +0200 > > Fran Pe?a wrote: > > > > > >> Hello there! Happy Olympics Day! > >> It seems that gettext breaks Rails Cells (http://cells.rubyforge.org/) > >> somehow > >> My setup is Rails 2.1, latest Cells from git, and gettext 1.92.0 > >> When I add the require 'gettext/rails' line to my environment.rb file I > >> get this when trying to render a cell view: > >> > >> |undefined method `file_exists?' for # > >> > >> Any clues on how to fix this? > >> Thanks in advance > >> | > >> > >> > >> _______________________________________________ > >> gettext-users-en mailing list > >> gettext-users-en at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/gettext-users-en > >> > >> > > > > > > > > _______________________________________________ > gettext-users-en mailing list > gettext-users-en at rubyforge.org > http://rubyforge.org/mailman/listinfo/gettext-users-en > > > -- .:% Masao Mutoh From cyberf at cyberf.org Sat Aug 9 10:11:32 2008 From: cyberf at cyberf.org (Fran Pena) Date: Sat, 09 Aug 2008 16:11:32 +0200 Subject: [gettext-u-en] gettext and Rails Cells error In-Reply-To: <0F87239BE4CED74A9F45871B120FC96CED817D@WinExc01.corp.intraware.com> References: <489C2A36.6050309@cyberf.org><20080808221345.a54d870f.mutoh@highway.ne.jp> <489C5B2F.5010507@cyberf.org> <0F87239BE4CED74A9F45871B120FC96CED817D@WinExc01.corp.intraware.com> Message-ID: <489DA594.3000803@cyberf.org> Thanks Matt. I tried this config.gem and the problem persists. Matt Harvey wrote: > > I think he means to make sure you don't "require 'gettext'" in your > environment.rb or initializers. Instead, add "config.gem 'gettext'" to > your "Rails::Initializer.run do |config|" block. I am definitely not > clear on why that would fix this problem. Maybe the following will > help as well: > > http://zargony.com/2008/02/12/edge-rails-and-gettext-undefined-method-file_exists-nomethoderror > > > -----Original Message----- > From: gettext-users-en-bounces at rubyforge.org on behalf of Fran Pe?a > Sent: Fri 8/8/2008 7:41 AM > To: Masao Mutoh > Cc: gettext-users-en at rubyforge.org > Subject: Re: [gettext-u-en] gettext and Rails Cells error > > Hello Masao. > I'm sorry, I'm a newbie and I can't figure out how to use this > information. If you could please explain that to me a little more that'd > be nice. > > Masao Mutoh wrote: > > Hi, > > > > How about to use config.gem, unless 'require' ? > > > > On Fri, 08 Aug 2008 13:12:54 +0200 > > Fran Pe?a wrote: > > > > > >> Hello there! Happy Olympics Day! > >> It seems that gettext breaks Rails Cells (http://cells.rubyforge.org/) > >> somehow > >> My setup is Rails 2.1, latest Cells from git, and gettext 1.92.0 > >> When I add the require 'gettext/rails' line to my environment.rb file I > >> get this when trying to render a cell view: > >> > >> |undefined method `file_exists?' for # > >> > >> Any clues on how to fix this? > >> Thanks in advance > >> | > >> > >> > >> _______________________________________________ > >> gettext-users-en mailing list > >> gettext-users-en at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/gettext-users-en > >> > >> > > > > > > > > _______________________________________________ > gettext-users-en mailing list > gettext-users-en at rubyforge.org > http://rubyforge.org/mailman/listinfo/gettext-users-en > > From cyberf at cyberf.org Sat Aug 9 10:12:28 2008 From: cyberf at cyberf.org (Fran Pena) Date: Sat, 09 Aug 2008 16:12:28 +0200 Subject: [gettext-u-en] gettext and Rails Cells error In-Reply-To: <20080809220355.6a7d5978.mutoh@highway.ne.jp> References: <489C2A36.6050309@cyberf.org> <20080808221345.a54d870f.mutoh@highway.ne.jp> <489C5B2F.5010507@cyberf.org> <20080809215949.df3c984e.mutoh@highway.ne.jp> <20080809220355.6a7d5978.mutoh@highway.ne.jp> Message-ID: <489DA5CC.10802@cyberf.org> Hello Massao. I use the latest version available on github: http://cells.rubyforge.org/download.html Masao Mutoh wrote: > BTW, I don't know Cell well, > But what version of Cell do you use? > > It seems the error is occured by Cell itself. > > >>>> |undefined method `file_exists?' for # >>>> > > On Sat, 9 Aug 2008 21:59:49 +0900 > Masao Mutoh wrote: > > >>>> Hi, >>>> >>>> How about to use config.gem, unless 'require' ? >>>> >>>> > > From mutoh at highway.ne.jp Sat Aug 9 11:47:40 2008 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Sun, 10 Aug 2008 00:47:40 +0900 Subject: [gettext-u-en] gettext and Rails Cells error In-Reply-To: <489DA5CC.10802@cyberf.org> References: <489C2A36.6050309@cyberf.org> <20080808221345.a54d870f.mutoh@highway.ne.jp> <489C5B2F.5010507@cyberf.org> <20080809215949.df3c984e.mutoh@highway.ne.jp> <20080809220355.6a7d5978.mutoh@highway.ne.jp> <489DA5CC.10802@cyberf.org> Message-ID: <20080810004740.914c0e8c.mutoh@highway.ne.jp> Hi, You say you use Rails-2.1.0 and gettext-1.92.0 and Cell for Rails-2.1.0. Hmm. I don't have the time to study about Cell. If you send a sample application which reproduce this problem, I'll try to fix it. On Sat, 09 Aug 2008 16:12:28 +0200 Fran Pena wrote: > Hello Massao. > I use the latest version available on github: > http://cells.rubyforge.org/download.html > > Masao Mutoh wrote: > > BTW, I don't know Cell well, > > But what version of Cell do you use? > > > > It seems the error is occured by Cell itself. > > > > > >>>> |undefined method `file_exists?' for # > >>>> > > > > On Sat, 9 Aug 2008 21:59:49 +0900 > > Masao Mutoh wrote: > > > > > >>>> Hi, > >>>> > >>>> How about to use config.gem, unless 'require' ? > >>>> > >>>> > > > > > > -- .:% Masao Mutoh From mharvey at intraware.com Sat Aug 9 15:50:25 2008 From: mharvey at intraware.com (Matt Harvey) Date: Sat, 9 Aug 2008 12:50:25 -0700 Subject: [gettext-u-en] gettext and Rails Cells error References: <489C2A36.6050309@cyberf.org><20080808221345.a54d870f.mutoh@highway.ne.jp><489C5B2F.5010507@cyberf.org><0F87239BE4CED74A9F45871B120FC96CED817D@WinExc01.corp.intraware.com> <20080809221031.fa0b50d9.mutoh@highway.ne.jp> Message-ID: <0F87239BE4CED74A9F45871B120FC96CED8182@WinExc01.corp.intraware.com> No, it's not gettext; it is a problem with Cells. This is the last I will post about this on this mailing list, but I'll put it here for the archives. I reproduced the error by installing Cells and gettext into a fresh Rails 2.1 application, creating a simple "Hello world" cell, and calling render_cell from a controller. Cells has decided that they cannot use ActionView::TemplateFinder, so they define their own. The source of problems is that the file_exists? method moved from ActionView::Base into TemplateFinder with Rails 2.1. gettext has been fixed to handle the method in either place, and it even uses duck typing properly which should handle the case where finder refers to something that only acts like the Rails TemplateFinder. Well, ActionView::Base as extended by Cells does not respond to file_exists?, and neither does Cell::TemplateFinder. That's a problem. Apply this to vendor/plugins/cells/lib/cell/template_finder.rb 75a76,89 > alias_method :template_exists?, :pick_template > > def file_exists?(template_path) > # Clear the forward slash in the beginning if exists > template_path = template_path.sub(/^\//, '') > > template_file_name, template_file_extension = path_and_extension(template_path) > > if template_file_extension > template_exists?(template_file_name, template_file_extension) > else > template_exists?(template_file_name, pick_template_extension(template_path)) > end > end This is just copied verbatim from the template_finder.rb included with Rails. Someone should file a bug for Cells: "Template finder should respond to file_exists?". It seems to me that if Cell::TemplateFinder were to inherit from ActionView::TemplateFinder then it might be less susceptible to breaking as Rails evolves. It also would not be necessary to copy this method (and maybe others) since they would live in the superclass. -----Original Message----- From: gettext-users-en-bounces at rubyforge.org on behalf of Masao Mutoh Sent: Sat 8/9/2008 6:10 AM To: gettext-users-en at rubyforge.org Subject: Re: [gettext-u-en] gettext and Rails Cells error Hi, I think I fixed file_exist? problem, and my sample blog(under rails-2.1) works unless this error. Is it the problem of gettext? If you have any information, tell me the details. On Fri, 8 Aug 2008 09:00:33 -0700 "Matt Harvey" wrote: > I think he means to make sure you don't "require 'gettext'" in your environment.rb or initializers. Instead, add "config.gem 'gettext'" to your "Rails::Initializer.run do |config|" block. I am definitely not clear on why that would fix this problem. Maybe the following will help as well: > > http://zargony.com/2008/02/12/edge-rails-and-gettext-undefined-method-file_exists-nomethoderror > > > -----Original Message----- > From: gettext-users-en-bounces at rubyforge.org on behalf of Fran Pe?a > Sent: Fri 8/8/2008 7:41 AM > To: Masao Mutoh > Cc: gettext-users-en at rubyforge.org > Subject: Re: [gettext-u-en] gettext and Rails Cells error > > Hello Masao. > I'm sorry, I'm a newbie and I can't figure out how to use this > information. If you could please explain that to me a little more that'd > be nice. > > Masao Mutoh wrote: > > Hi, > > > > How about to use config.gem, unless 'require' ? > > > > On Fri, 08 Aug 2008 13:12:54 +0200 > > Fran Pe?a wrote: > > > > > >> Hello there! Happy Olympics Day! > >> It seems that gettext breaks Rails Cells (http://cells.rubyforge.org/) > >> somehow > >> My setup is Rails 2.1, latest Cells from git, and gettext 1.92.0 > >> When I add the require 'gettext/rails' line to my environment.rb file I > >> get this when trying to render a cell view: > >> > >> |undefined method `file_exists?' for # > >> > >> Any clues on how to fix this? > >> Thanks in advance > >> | > >> > >> > >> _______________________________________________ > >> gettext-users-en mailing list > >> gettext-users-en at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/gettext-users-en > >> > >> > > > > > > > > _______________________________________________ > gettext-users-en mailing list > gettext-users-en at rubyforge.org > http://rubyforge.org/mailman/listinfo/gettext-users-en > > > -- .:% Masao Mutoh _______________________________________________ gettext-users-en mailing list gettext-users-en at rubyforge.org http://rubyforge.org/mailman/listinfo/gettext-users-en -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyberf at cyberf.org Sat Aug 9 16:07:56 2008 From: cyberf at cyberf.org (Fran Pena) Date: Sat, 09 Aug 2008 22:07:56 +0200 Subject: [gettext-u-en] gettext and Rails Cells error In-Reply-To: <0F87239BE4CED74A9F45871B120FC96CED8182@WinExc01.corp.intraware.com> References: <489C2A36.6050309@cyberf.org><20080808221345.a54d870f.mutoh@highway.ne.jp><489C5B2F.5010507@cyberf.org><0F87239BE4CED74A9F45871B120FC96CED817D@WinExc01.corp.intraware.com> <20080809221031.fa0b50d9.mutoh@highway.ne.jp> <0F87239BE4CED74A9F45871B120FC96CED8182@WinExc01.corp.intraware.com> Message-ID: <489DF91C.1@cyberf.org> Thanks Matt. Masao got to that same conclusion too and he suggested this: Hi, OK, Finally I could reproduce your problem. In Cell plugin, Cell::TemplateFinder replaces ActionView::TemplateFinder. But it doesn't have complete API of ActionView::TemplateFinder. In this case, file_exists? is not implemented, so this error is occured. IMO, Cell:TemplateFinder should have all of API of ActionView::TemplateFinder. The easiest answer is to inherit ActionView::TemplateFinder. Replace the line 2 like as follows: In: vendor/plugins/cells/lib/cell/template_finder.rb. --- template_finder.rb.org 2008-08-10 03:02:12.000000000 +0900 +++ template_finder.rb 2008-08-10 03:02:16.000000000 +0900 @@ -1,5 +1,5 @@ module Cell - class TemplateFinder + class TemplateFinder < ActionView::TemplateFinder attr_accessor :view_paths I am already suggesting your findings to Cells development so they can fix it. Thanks very much, thanks for your time and your trouble, its very appreciated. Matt Harvey wrote: > > No, it's not gettext; it is a problem with Cells. This is the last I > will post about this on this mailing list, but I'll put it here for > the archives. > > I reproduced the error by installing Cells and gettext into a fresh > Rails 2.1 application, creating a simple "Hello world" cell, and > calling render_cell from a controller. Cells has decided that they > cannot use ActionView::TemplateFinder, so they define their own. The > source of problems is that the file_exists? method moved from > ActionView::Base into TemplateFinder with Rails 2.1. > > gettext has been fixed to handle the method in either place, and it > even uses duck typing properly which should handle the case where > finder refers to something that only acts like the Rails TemplateFinder. > > Well, ActionView::Base as extended by Cells does not respond to > file_exists?, and neither does Cell::TemplateFinder. That's a problem. > Apply this to vendor/plugins/cells/lib/cell/template_finder.rb > > 75a76,89 > > alias_method :template_exists?, :pick_template > > > > def file_exists?(template_path) > > # Clear the forward slash in the beginning if exists > > template_path = template_path.sub(/^\//, '') > > > > template_file_name, template_file_extension = > path_and_extension(template_path) > > > > if template_file_extension > > template_exists?(template_file_name, template_file_extension) > > else > > template_exists?(template_file_name, > pick_template_extension(template_path)) > > end > > end > > This is just copied verbatim from the template_finder.rb included with > Rails. Someone should file a bug for Cells: "Template finder should > respond to file_exists?". It seems to me that if Cell::TemplateFinder > were to inherit from ActionView::TemplateFinder then it might be less > susceptible to breaking as Rails evolves. It also would not be > necessary to copy this method (and maybe others) since they would live > in the superclass. > > -----Original Message----- > From: gettext-users-en-bounces at rubyforge.org on behalf of Masao Mutoh > Sent: Sat 8/9/2008 6:10 AM > To: gettext-users-en at rubyforge.org > Subject: Re: [gettext-u-en] gettext and Rails Cells error > > Hi, > > I think I fixed file_exist? problem, > and my sample blog(under rails-2.1) works unless this error. > > Is it the problem of gettext? > If you have any information, tell me the details. > > On Fri, 8 Aug 2008 09:00:33 -0700 > "Matt Harvey" wrote: > > > I think he means to make sure you don't "require 'gettext'" in your > environment.rb or initializers. Instead, add "config.gem 'gettext'" to > your "Rails::Initializer.run do |config|" block. I am definitely not > clear on why that would fix this problem. Maybe the following will > help as well: > > > > > http://zargony.com/2008/02/12/edge-rails-and-gettext-undefined-method-file_exists-nomethoderror > > > > > > -----Original Message----- > > From: gettext-users-en-bounces at rubyforge.org on behalf of Fran Pe?a > > Sent: Fri 8/8/2008 7:41 AM > > To: Masao Mutoh > > Cc: gettext-users-en at rubyforge.org > > Subject: Re: [gettext-u-en] gettext and Rails Cells error > > > > Hello Masao. > > I'm sorry, I'm a newbie and I can't figure out how to use this > > information. If you could please explain that to me a little more that'd > > be nice. > > > > Masao Mutoh wrote: > > > Hi, > > > > > > How about to use config.gem, unless 'require' ? > > > > > > On Fri, 08 Aug 2008 13:12:54 +0200 > > > Fran Pe?a wrote: > > > > > > > > >> Hello there! Happy Olympics Day! > > >> It seems that gettext breaks Rails Cells > (http://cells.rubyforge.org/) > > >> somehow > > >> My setup is Rails 2.1, latest Cells from git, and gettext 1.92.0 > > >> When I add the require 'gettext/rails' line to my environment.rb > file I > > >> get this when trying to render a cell view: > > >> > > >> |undefined method `file_exists?' for > # > > >> > > >> Any clues on how to fix this? > > >> Thanks in advance > > >> | > > >> > > >> > > >> _______________________________________________ > > >> gettext-users-en mailing list > > >> gettext-users-en at rubyforge.org > > >> http://rubyforge.org/mailman/listinfo/gettext-users-en > > >> > > >> > > > > > > > > > > > > > _______________________________________________ > > gettext-users-en mailing list > > gettext-users-en at rubyforge.org > > http://rubyforge.org/mailman/listinfo/gettext-users-en > > > > > > > > > -- > .:% Masao Mutoh > > _______________________________________________ > gettext-users-en mailing list > gettext-users-en at rubyforge.org > http://rubyforge.org/mailman/listinfo/gettext-users-en > From oleguer.huguet at woices.com Wed Aug 27 12:01:08 2008 From: oleguer.huguet at woices.com (Oleguer Huguet) Date: Wed, 27 Aug 2008 18:01:08 +0200 Subject: [gettext-u-en] Spanish (es) rails.mo not accurate Message-ID: With the gettext-1.92.0 gem there is a problem with the translation of the rails msgid "about 1 month": it should be "cerca de 1 mes" but it is "cerca de 1 minuto". I've investigated this a bit and it seems to be related to the file rails.mo provided with the gem (data/locale/es/LC_MESSAGES/rails.mo). Decompiling it with msgunfmt reveals it has this incorrect translation. Strangely, the file po/es/rails.po in the gem (that I suppose is from is compiled the mo) contains the correct translation. Maybe this was a problem when creating the .mo file or perhaps when packaging the gem? Should I fill a bug report for this? -------------- next part -------------- An HTML attachment was scrubbed... URL: