From mutoh at highway.ne.jp Fri Sep 1 22:27:36 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Sat, 2 Sep 2006 11:27:36 +0900 Subject: [gettext-u-en] Engine Localization In-Reply-To: References: Message-ID: <20060902112736.47f2336f.mutoh@highway.ne.jp> Hi, I think your updatepo task can't read user.rb correctly. Don't the logs of rake show any messages? For example, rake may be not able to find LoginEngine::AuthenticatedUser. If so, you need to require 'login_engin(I don't know what is correct)' in Rakefile. BTW, There are a lot of the request of supporting RailsEngines such as UserEngines with GetText. So, I changed Ruby-GetText to support Engines. It will be included into the next release of Ruby-GetText. On Thu, 31 Aug 2006 17:33:58 +0200 kerforn56 wrote: > I am trying to localize the Login engine, almost done for messages... > but as I cannot get the 'user' model fields localized > > I performed correctly the rake processes in the vendor/plugins/ > login_engine, got the .pot/.po files and the locale/fr_FR/LC_MESSAGES > > complex trick comes from the login_engine/app/models/user.rb stating > > -----user.rb > class User < ActiveRecord::Base > include LoginEngine::AuthenticatedUser > # all logic has been moved into login_engine/lib/login_engine/ > authenticated_user.rb > end > -------------- > > ------login_engine/lib/login_engine/authenticated_user.rb > require 'digest/sha1' > > # this model expects a certain database layout and its based on the > name/login pattern. > module LoginEngine > module AuthenticatedUser > > def self.included(base) > base.class_eval do > > # use the table name given > set_table_name LoginEngine.config(:user_table) > ........ > attr_accessor :password, :password_confirmation > > N_("User|Password") # => the rake > update.po got it > N_("User|Password confirmation") # => the rake update.po > got it > ..... > ------------------- > > why the rake update.po did not get the 'user' fields ? how can I make > it right ? > > hereafter is the localized error panel : > > 5 erreurs ont empech$(D+1(B l'enregistrement 'user' d'$(D+4(Btre sauv$(D+1(B > > Il y a eu des probl$(D+2(Bmes avec les champs suivants: > > * Mot de passe ne peut $(D+4(Btre blanc > * Login ne peut $(D+4(Btre blanc > * Email est invalide > > so the class name 'user' is not translated > Login is not translated > Email is not translated -- .:% Masao Mutoh From beattie.mark at gmail.com Mon Sep 4 02:54:58 2006 From: beattie.mark at gmail.com (Mark Beattie) Date: Mon, 4 Sep 2006 15:54:58 +0900 Subject: [gettext-u-en] unknown type of %string on rake updatepo Message-ID: <200609041554.58534.beattie.mark@gmail.com> Hi, I've used ruby gettext to localise one Rails application successfully, but then applying the exact same techniques to a second application it fails to complete the first rake updatepo with the message "unknown type of %string". I've checked that none of the models are requiring strange libraries, and am using ruby gettext 1.7.0 with ruby 1.8.4. Anyone have any suggestions as to what might be causing it? thanks ** Invoke updatepo (first_time) ** Execute updatepo unknown type of %string rake aborted! exit /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:118:in `exit' /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:118:in `parse' /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:108:in `parse' /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:174:in `run' /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:172:in `run' /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:198:in `rgettext' /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/utils.rb:107:in `update_pofiles' ./lib/tasks/gettext.rake:5 /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 /usr/bin/rake:18 From edgargonzalez at gmail.com Thu Sep 7 16:23:28 2006 From: edgargonzalez at gmail.com (Edgar Gonzalez) Date: Thu, 7 Sep 2006 16:23:28 -0400 Subject: [gettext-u-en] Problem using gettext in a shared hosting Message-ID: Hi, My application is in a shared hosting. My first deploy (a few months ago) was based on gettext 1.1.1. I asked to my hosting support to install gettext gem 1.1.1 and the application works fine. Recently I have several changes with require gettext 1.7.0. I asked to my hosting support to install gettext gem 1.7.0, and they did it. So I got installed both gems 1.1.1 and 1.7.0. When I try to run my rails application, the gem loaded was 1.1.1 and not 1.7.0. The technical support said that they can't uninstall the previous version of gettext because maybe some other applications required. I solved that unpacking the gettext 1.7.0 gem in my account home and making a symbolic link to application's lib directory. That works. However I detect that seems the .mo used by the gem is the 1.1.1 and not the 1.7.0, I said that because the "time_ago_in_words" method not return the appropiate translated text, always return the english text (I was using a unique locale for the entire application setted in the application.rb) Any clue? Thanks -- Edgar Gonz?lez Gonz?lez E-mail: edgargonzalez at gmail.com http://vp.com.ve http://lacaraoscura.com http://rubycorner.com -- From beattie.mark at gmail.com Thu Sep 7 19:56:32 2006 From: beattie.mark at gmail.com (Mark Beattie) Date: Fri, 8 Sep 2006 08:56:32 +0900 Subject: [gettext-u-en] Problem using gettext in a shared hosting In-Reply-To: References: Message-ID: <200609080856.32186.beattie.mark@gmail.com> Hey, You can't really run Rails apps in a shared hosting environment. I'd recommend grabbing a VPS for $30/month, and then on top of having full control of all your installed gems you get 4Gb of disk space you can use as remote storage and stuff. Rimu Hosting have allways been very good to me: http://rimuhosting.com For a turn-key deployment solution the Engine Yard looks to be promising when they go live: http://www.engineyard.com/ I'm not too sure about translating the time_ago_in_words function, but generally gettext doesn't come with any translation libraries, just built in methods to extract the strings from your app so you can translate them. It automatically extracts ActiveRecord stuff into the .pot file, like column names and validation errors, but you still need to translate them in your .po files and run "rake makemo" to compile them into your .mo file. I'd imagine the same is true for time_ago_in_words. mark On Friday 08 September 2006 05:23, Edgar Gonzalez wrote: > Hi, > > My application is in a shared hosting. > > My first deploy (a few months ago) was based on gettext 1.1.1. I asked > to my hosting support to install gettext gem 1.1.1 and the application > works fine. > > Recently I have several changes with require gettext 1.7.0. I asked to > my hosting support to install gettext gem 1.7.0, and they did it. So I > got installed both gems 1.1.1 and 1.7.0. > > When I try to run my rails application, the gem loaded was 1.1.1 and > not 1.7.0. The technical support said that they can't uninstall the > previous version of gettext because maybe some other applications > required. > > I solved that unpacking the gettext 1.7.0 gem in my account home and > making a symbolic link to application's lib directory. That works. > > However I detect that seems the .mo used by the gem is the 1.1.1 and > not the 1.7.0, I said that because the "time_ago_in_words" method not > return the appropiate translated text, always return the english text > (I was using a unique locale for the entire application setted in the > application.rb) > > Any clue? > > Thanks From mutoh at highway.ne.jp Sun Sep 10 08:11:21 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Sun, 10 Sep 2006 21:11:21 +0900 Subject: [gettext-u-en] unknown type of %string on rake updatepo In-Reply-To: <200609041554.58534.beattie.mark@gmail.com> References: <200609041554.58534.beattie.mark@gmail.com> Message-ID: <20060910211121.3abbd62b.mutoh@highway.ne.jp> Hi, Same problem was reported by others. In that case, _("#{...}") style was used. "#{...}" style is not supported by Ruby-GetText. http://www.yotabanana.com/hiki/ruby-gettext-faq.html#Doesn%27t+extract+%22%23%7Bname%7D%22+strings. On Mon, 4 Sep 2006 15:54:58 +0900 Mark Beattie wrote: > Hi, > > I've used ruby gettext to localise one Rails application successfully, but > then applying the exact same techniques to a second application it fails to > complete the first rake updatepo with the message "unknown type of %string". > > I've checked that none of the models are requiring strange libraries, and am > using ruby gettext 1.7.0 with ruby 1.8.4. Anyone have any suggestions as to > what might be causing it? > > thanks > > ** Invoke updatepo (first_time) > ** Execute updatepo > unknown type of %string > rake aborted! > exit > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:118:in > `exit' > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:118:in > `parse' > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:108:in > `parse' > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:174:in `run' > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:172:in `run' > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:198:in > `rgettext' > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/utils.rb:107:in > `update_pofiles' > ./lib/tasks/gettext.rake:5 > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute' > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute' > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke' > /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke' > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run' > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run' > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 > /usr/bin/rake:18 > _______________________________________________ > gettext-users-en mailing list > gettext-users-en at rubyforge.org > http://rubyforge.org/mailman/listinfo/gettext-users-en > -- -- .:% Masao Mutoh From donald.piret at synergetek.be Sun Sep 10 08:51:22 2006 From: donald.piret at synergetek.be (Donald Piret) Date: Sun, 10 Sep 2006 14:51:22 +0200 Subject: [gettext-u-en] Gettext 1.7 and rails edge Message-ID: <45040A4A.7070301@synergetek.be> Hello Masao (and the rest of the mailing list), Just wanted to report an incompatibility as I haven't seen it come through on the list yet and don't know if it's been discussed before. Basically gettext 1.7 doesn't work with the current rails edge. Details are available here: http://dev.rubyonrails.org/ticket/5810 with also a link to the changeset that introduced the breakage. So if you're suddenly getting "stack error too deep" messages while on trunk, read this first. Thanks, Donald -------------- next part -------------- A non-text attachment was scrubbed... Name: donald.piret.vcf Type: text/x-vcard Size: 329 bytes Desc: not available Url : http://rubyforge.org/pipermail/gettext-users-en/attachments/20060910/a88b4400/attachment.vcf -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3319 bytes Desc: S/MIME Cryptographic Signature Url : http://rubyforge.org/pipermail/gettext-users-en/attachments/20060910/a88b4400/attachment.bin From mutoh at highway.ne.jp Sun Sep 10 09:54:42 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Sun, 10 Sep 2006 22:54:42 +0900 Subject: [gettext-u-en] Gettext 1.7 and rails edge In-Reply-To: <45040A4A.7070301@synergetek.be> References: <45040A4A.7070301@synergetek.be> Message-ID: <20060910225442.39673651.mutoh@highway.ne.jp> Hi Donald, Wow, thanks. I'll apply your patch. On Sun, 10 Sep 2006 14:51:22 +0200 Donald Piret wrote: > Hello Masao (and the rest of the mailing list), > > Just wanted to report an incompatibility as I haven't seen it come > through on the list yet and don't know if it's been discussed before. > Basically gettext 1.7 doesn't work with the current rails edge. > Details are available here: http://dev.rubyonrails.org/ticket/5810 with > also a link to the changeset that introduced the breakage. > So if you're suddenly getting "stack error too deep" messages while on > trunk, read this first. > > Thanks, > > Donald > -- -- .:% Masao Mutoh From isak.hansen at gmail.com Tue Sep 12 06:31:45 2006 From: isak.hansen at gmail.com (Isak Hansen) Date: Tue, 12 Sep 2006 12:31:45 +0200 Subject: [gettext-u-en] GetText 1.8.0 on edge rails Message-ID: <6b9e1eb20609120331n4cd4ff6bu6ddbcce735e50d13@mail.gmail.com> Hi all, I just upgraded to 1.8.0, and still have issues with edge rails. The "stack level too deep" error when trying to save a model didn't go away. I've verified by creating a new project with a single model. It only happens if i both upgrade to edge and require 'gettext/rails'. Didn't try to bind/use gettext from this test, but that shouldn't be neccessary? (also have the error in my real app, which does that). My ruby/rails isn't strong enough to be of much help, but if there's anything i can do, please let me know. Isak From mutoh at highway.ne.jp Tue Sep 12 10:34:29 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Tue, 12 Sep 2006 23:34:29 +0900 Subject: [gettext-u-en] [ANN] Ruby-GetText-Package-1.8.0 Message-ID: <20060912233429.7ffe7a21.mutoh@highway.ne.jp> Hi, Ruby-GetText-Package-1.8.0 is now available. Changes ------- * Support Chinese(Taiwan: zh_TW), Estonian(et: rails.po only) * Enhance to support Ruby on Rails. * Add GetText.bindtextdomain_to(klass, domainname), .textdomain_to(klass, domainname) * rgettext supports -r, -d options. -r is to set an option parser. -d is for debugging mode. (e.g.) $ rgettext -r fooparser test.foo * Update translations: pt_BR, de, zh_TW, * Code cleanup, fixed bugs. Thanks to: Translators: Joao Pedrosa(pt_BR), Partick Lenz(de), Erkki Eilonen(et), LIN CHUNG-YI(zh_TW) Bug reports and suggestions: Kobayashi Noritada, Andreas Neuhaus, steve dp, Tsutomu Kuroda, Donald Piret Regards, Masao -- .:% Masao Mutoh From mutoh at highway.ne.jp Tue Sep 12 10:36:33 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Tue, 12 Sep 2006 23:36:33 +0900 Subject: [gettext-u-en] [ANN] Ruby-GetText-Package-1.8.0 In-Reply-To: <20060912233429.7ffe7a21.mutoh@highway.ne.jp> References: <20060912233429.7ffe7a21.mutoh@highway.ne.jp> Message-ID: <20060912233633.61c22de6.mutoh@highway.ne.jp> Hi, Takahashi-san[1] starts GettextScaffold plugin project on rubyforge[2]. It's great scaffold plugin for helping rails with GetText. Check it out! [1] Masayoshi Takahashi is well known as the chairman of Japan Ruby no Kai (Japanese Ruby User Group) and "Takahashi Method". [2] http://rubyforge.org/projects/gettextscaffold/ -- .:% Masao Mutoh From mutoh at highway.ne.jp Tue Sep 12 11:30:07 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Wed, 13 Sep 2006 00:30:07 +0900 Subject: [gettext-u-en] GetText 1.8.0 on edge rails In-Reply-To: <6b9e1eb20609120331n4cd4ff6bu6ddbcce735e50d13@mail.gmail.com> References: <6b9e1eb20609120331n4cd4ff6bu6ddbcce735e50d13@mail.gmail.com> Message-ID: <20060913003007.4c9f691b.mutoh@highway.ne.jp> Hi, On Tue, 12 Sep 2006 12:31:45 +0200 "Isak Hansen" wrote: > Hi all, > > I just upgraded to 1.8.0, and still have issues with edge rails. The > "stack level too deep" error when trying to save a model didn't go > away. > > I've verified by creating a new project with a single model. It only > happens if i both upgrade to edge and require 'gettext/rails'. Didn't > try to bind/use gettext from this test, but that shouldn't be > neccessary? (also have the error in my real app, which does that). Could you remove all gettext on your environment and retry it? > My ruby/rails isn't strong enough to be of much help, but if there's > anything i can do, please let me know. At least, rails edge #4819 works with gettext-1.8.0. But I can't try #5093 because of Application error(It doesn't depend on GetText). The error message is on my browser: ---------------------- Application error Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html ---------------------- How can I test it? -- .:% Masao Mutoh From isak.hansen at gmail.com Tue Sep 12 12:49:26 2006 From: isak.hansen at gmail.com (Isak Hansen) Date: Tue, 12 Sep 2006 18:49:26 +0200 Subject: [gettext-u-en] GetText 1.8.0 on edge rails In-Reply-To: <20060913003007.4c9f691b.mutoh@highway.ne.jp> References: <6b9e1eb20609120331n4cd4ff6bu6ddbcce735e50d13@mail.gmail.com> <20060913003007.4c9f691b.mutoh@highway.ne.jp> Message-ID: <6b9e1eb20609120949j5a789539vfe82ad9e444f016d@mail.gmail.com> On 9/12/06, Masao Mutoh wrote: > Hi, > > On Tue, 12 Sep 2006 12:31:45 +0200 > "Isak Hansen" wrote: > > > Hi all, > > > > I just upgraded to 1.8.0, and still have issues with edge rails. The > > "stack level too deep" error when trying to save a model didn't go > > away. > > > > I've verified by creating a new project with a single model. It only > > happens if i both upgrade to edge and require 'gettext/rails'. Didn't > > try to bind/use gettext from this test, but that shouldn't be > > neccessary? (also have the error in my real app, which does that). > > Could you remove all gettext on your environment and retry it? > > > My ruby/rails isn't strong enough to be of much help, but if there's > > anything i can do, please let me know. > > At least, rails edge #4819 works with gettext-1.8.0. > But I can't try #5093 because of Application error(It doesn't depend > on GetText). > > The error message is on my browser: > ---------------------- > Application error > > Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html > ---------------------- > > How can I test it? > I'm now repeating the test on a different computer (win xp, I use os x at work), using the following procedure: # create a new project E:\projects>rails mytest -d sqlite3 E:\projects>cd mytest # create a simple model. E:\projects\mytest>ruby script\generate model Apple # comment out the '#', so my model has a name column E:\projects\mytest>vim db\migrate\001_create_apples.rb # run the migration E:\projects\mytest>rake db:migrate (in E:/projects/mytest) == CreateApples: migrating ===================== -- create_table(:apples) -> 0.0000s == CreateApples: migrated (0.0000s) ============ # edit config/environment.rb, add require 'gettext/rails' to the bottom E:\projects\mytest>vim config\environment.rb #time to test (gettext + rails 1.1.6) E:\projects\mytest>ruby script\console Loading development environment. >> a = Apple.new(:name => "test") => #"test"}> >> a.save! => true >> #upgrade to edge E:\projects\mytest>rake rails:freeze:edge *snip* Exported revision 5093. #test again (gettext + edge) E:\projects\mytest>ruby script\console Loading development environment. >> a = Apple.new(:name => "test") => #"test"}, @new_record=true> >> a.save! SystemStackError: stack level too deep from ./script/../config/../config/../vendor/rails/activerecord/lib/activ e_record/callbacks.rb:330:in `callback' from ./script/../config/../config/../vendor/rails/activerecord/lib/activ e_record/callbacks.rb:301:in `valid?' from ./script/../config/../config/../vendor/rails/activerecord/lib/activ e_record/validations.rb:757:in `save_without_validation!' from ./script/../config/../config/../vendor/rails/activerecord/lib/activ e_record/validations.rb:758:in `save!' from (irb):2 >> # edit config/environment.rb again, remove gettext E:\projects\mytest>vim config\environment.rb #test again - edge without gettext E:\projects\mytest>ruby script\console Loading development environment. >> a = Apple.new(:name => "test") => #"test"}, @new_record=true> >> a.save! => true >> #check gettext gem version, just in case E:\projects\mytest>gem list ... gettext (1.8.0) Ruby-GetText-Package is a libary and tools to localize messages. ... The error may of course be caused by something else, but it seems gettext is at least involved somehow. Or maybe it's just some silly thing i'm doing wrong. Hope this helps, and thanks for a very nice library, Isak > -- > .:% Masao Mutoh > _______________________________________________ > gettext-users-en mailing list > gettext-users-en at rubyforge.org > http://rubyforge.org/mailman/listinfo/gettext-users-en > From mutoh at highway.ne.jp Wed Sep 13 11:27:45 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Thu, 14 Sep 2006 00:27:45 +0900 Subject: [gettext-u-en] GetText 1.8.0 on edge rails In-Reply-To: <6b9e1eb20609120949j5a789539vfe82ad9e444f016d@mail.gmail.com> References: <6b9e1eb20609120331n4cd4ff6bu6ddbcce735e50d13@mail.gmail.com> <20060913003007.4c9f691b.mutoh@highway.ne.jp> <6b9e1eb20609120949j5a789539vfe82ad9e444f016d@mail.gmail.com> Message-ID: <20060914002745.36d9890b.mutoh@highway.ne.jp> Hi, Thanks. I could reproduce it. I'll try fix it. On Tue, 12 Sep 2006 18:49:26 +0200 "Isak Hansen" wrote: > On 9/12/06, Masao Mutoh wrote: > > Hi, > > > > On Tue, 12 Sep 2006 12:31:45 +0200 > > "Isak Hansen" wrote: > > > > > Hi all, > > > > > > I just upgraded to 1.8.0, and still have issues with edge rails. The > > > "stack level too deep" error when trying to save a model didn't go > > > away. > > > > > > I've verified by creating a new project with a single model. It only > > > happens if i both upgrade to edge and require 'gettext/rails'. Didn't > > > try to bind/use gettext from this test, but that shouldn't be > > > neccessary? (also have the error in my real app, which does that). > > > > Could you remove all gettext on your environment and retry it? > > > > > My ruby/rails isn't strong enough to be of much help, but if there's > > > anything i can do, please let me know. > > > > At least, rails edge #4819 works with gettext-1.8.0. > > But I can't try #5093 because of Application error(It doesn't depend > > on GetText). > > > > The error message is on my browser: > > ---------------------- > > Application error > > > > Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html > > ---------------------- > > > > How can I test it? > > > > I'm now repeating the test on a different computer (win xp, I use os x > at work), using the following procedure: > > > # create a new project > E:\projects>rails mytest -d sqlite3 > E:\projects>cd mytest > > > # create a simple model. > E:\projects\mytest>ruby script\generate model Apple > > > # comment out the '#', so my model has a name column > E:\projects\mytest>vim db\migrate\001_create_apples.rb > > > # run the migration > E:\projects\mytest>rake db:migrate > (in E:/projects/mytest) > == CreateApples: migrating ===================== > -- create_table(:apples) > -> 0.0000s > == CreateApples: migrated (0.0000s) ============ > > > # edit config/environment.rb, add require 'gettext/rails' to the bottom > E:\projects\mytest>vim config\environment.rb > > > #time to test (gettext + rails 1.1.6) > E:\projects\mytest>ruby script\console > Loading development environment. > >> a = Apple.new(:name => "test") > => #"test"}> > >> a.save! > => true > >> > > > #upgrade to edge > E:\projects\mytest>rake rails:freeze:edge > *snip* > Exported revision 5093. > > > #test again (gettext + edge) > E:\projects\mytest>ruby script\console > Loading development environment. > >> a = Apple.new(:name => "test") > => #"test"}, @new_record=true> > >> a.save! > SystemStackError: stack level too deep > from ./script/../config/../config/../vendor/rails/activerecord/lib/activ > e_record/callbacks.rb:330:in `callback' > from ./script/../config/../config/../vendor/rails/activerecord/lib/activ > e_record/callbacks.rb:301:in `valid?' > from ./script/../config/../config/../vendor/rails/activerecord/lib/activ > e_record/validations.rb:757:in `save_without_validation!' > from ./script/../config/../config/../vendor/rails/activerecord/lib/activ > e_record/validations.rb:758:in `save!' > from (irb):2 > >> > > > # edit config/environment.rb again, remove gettext > E:\projects\mytest>vim config\environment.rb > > > #test again - edge without gettext > E:\projects\mytest>ruby script\console > Loading development environment. > >> a = Apple.new(:name => "test") > => #"test"}, @new_record=true> > >> a.save! > => true > >> > > > #check gettext gem version, just in case > E:\projects\mytest>gem list > ... > gettext (1.8.0) > Ruby-GetText-Package is a libary and tools to localize messages. > ... > > > > The error may of course be caused by something else, but it seems > gettext is at least involved somehow. Or maybe it's just some silly > thing i'm doing wrong. > > Hope this helps, and thanks for a very nice library, > Isak > > > > > > -- > > .:% Masao Mutoh > > _______________________________________________ > > gettext-users-en mailing list > > gettext-users-en at rubyforge.org > > http://rubyforge.org/mailman/listinfo/gettext-users-en > > > -- -- .:% Masao Mutoh From reynard.list at gmail.com Wed Sep 13 17:22:13 2006 From: reynard.list at gmail.com (Reynard Hilman) Date: Wed, 13 Sep 2006 17:22:13 -0400 Subject: [gettext-u-en] unknown type of %string on rake updatepo In-Reply-To: <20060910211121.3abbd62b.mutoh@highway.ne.jp> References: <200609041554.58534.beattie.mark@gmail.com> <20060910211121.3abbd62b.mutoh@highway.ne.jp> Message-ID: <26e148920609131422y5570a9doec768154533b69a6@mail.gmail.com> Hi, Is there a way to find where gettext find this occurence when running updatepo? I have search all my codes and didn't seem to find the use of #{} style, but it still report sthe same error when running updatepo. thanks, - reynard On 9/10/06, Masao Mutoh wrote: > > Hi, > > Same problem was reported by others. > In that case, _("#{...}") style was used. > > "#{...}" style is not supported by Ruby-GetText. > > http://www.yotabanana.com/hiki/ruby-gettext-faq.html#Doesn%27t+extract+%22%23%7Bname%7D%22+strings > . > > On Mon, 4 Sep 2006 15:54:58 +0900 > Mark Beattie wrote: > > > Hi, > > > > I've used ruby gettext to localise one Rails application successfully, > but > > then applying the exact same techniques to a second application it fails > to > > complete the first rake updatepo with the message "unknown type of > %string". > > > > I've checked that none of the models are requiring strange libraries, > and am > > using ruby gettext 1.7.0 with ruby 1.8.4. Anyone have any suggestions as > to > > what might be causing it? > > > > thanks > > > > ** Invoke updatepo (first_time) > > ** Execute updatepo > > unknown type of %string > > rake aborted! > > exit > > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:118:in > > `exit' > > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:118:in > > `parse' > > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:108:in > > `parse' > > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:174:in > `run' > > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:172:in > `run' > > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:198:in > > `rgettext' > > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/utils.rb:107:in > > `update_pofiles' > > ./lib/tasks/gettext.rake:5 > > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute' > > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute' > > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke' > > /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' > > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke' > > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run' > > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run' > > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 > > /usr/bin/rake:18 > > _______________________________________________ > > 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: http://rubyforge.org/pipermail/gettext-users-en/attachments/20060913/724bec55/attachment.html From mutoh at highway.ne.jp Wed Sep 13 19:00:05 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Thu, 14 Sep 2006 08:00:05 +0900 Subject: [gettext-u-en] unknown type of %string on rake updatepo In-Reply-To: <26e148920609131422y5570a9doec768154533b69a6@mail.gmail.com> References: <200609041554.58534.beattie.mark@gmail.com> <20060910211121.3abbd62b.mutoh@highway.ne.jp> <26e148920609131422y5570a9doec768154533b69a6@mail.gmail.com> Message-ID: <20060914080005.09da178e.mutoh@highway.ne.jp> Hi, Could you try Ruby-GetText-1.8.0 ? updatepo may output the line of the wrong string. On Wed, 13 Sep 2006 17:22:13 -0400 "Reynard Hilman" wrote: > Hi, > Is there a way to find where gettext find this occurence when running > updatepo? I have search all my codes and didn't seem to find the use of #{} > style, but it still report sthe same error when running updatepo. > > thanks, > - reynard > > > On 9/10/06, Masao Mutoh wrote: > > > > Hi, > > > > Same problem was reported by others. > > In that case, _("#{...}") style was used. > > > > "#{...}" style is not supported by Ruby-GetText. > > > > http://www.yotabanana.com/hiki/ruby-gettext-faq.html#Doesn%27t+extract+%22%23%7Bname%7D%22+strings > > . > > > > On Mon, 4 Sep 2006 15:54:58 +0900 > > Mark Beattie wrote: > > > > > Hi, > > > > > > I've used ruby gettext to localise one Rails application successfully, > > but > > > then applying the exact same techniques to a second application it fails > > to > > > complete the first rake updatepo with the message "unknown type of > > %string". > > > > > > I've checked that none of the models are requiring strange libraries, > > and am > > > using ruby gettext 1.7.0 with ruby 1.8.4. Anyone have any suggestions as > > to > > > what might be causing it? > > > > > > thanks > > > > > > ** Invoke updatepo (first_time) > > > ** Execute updatepo > > > unknown type of %string > > > rake aborted! > > > exit > > > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:118:in > > > `exit' > > > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:118:in > > > `parse' > > > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:108:in > > > `parse' > > > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:174:in > > `run' > > > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:172:in > > `run' > > > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rgettext.rb:198:in > > > `rgettext' > > > /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/utils.rb:107:in > > > `update_pofiles' > > > ./lib/tasks/gettext.rake:5 > > > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute' > > > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute' > > > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke' > > > /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' > > > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke' > > > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run' > > > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run' > > > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 > > > /usr/bin/rake:18 > > > _______________________________________________ > > > 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 > > > -- -- .:% Masao Mutoh From edgargonzalez at gmail.com Thu Sep 14 10:14:13 2006 From: edgargonzalez at gmail.com (Edgar Gonzalez) Date: Thu, 14 Sep 2006 10:14:13 -0400 Subject: [gettext-u-en] Locale::Object uninitialized constant Object Message-ID: I got an application running with gettext 1.7.0 The application runs fine, but when I try to run a migration in my production host, I got this error: (in /home/****/apps/*****/releases/20060913211528) ** Invoke migrate (first_time) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment rake aborted! uninitialized constant Object /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:123:in `const_missing' /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/locale_cgi.rb:17 /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require' /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/cgi.rb:14 /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require' /usr/lib/ruby/gems/1.8/gems/gettext-1.7.0/lib/gettext/rails.rb:12 /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require' /home/to2blogs/apps/to2blogs/releases/20060913211528/config/../vendor/plugins/lang_options_helper/lib/lang_options_helper.rb:2 /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require' /home/to2blogs/apps/to2blogs/releases/20060913211528/config/../vendor/plugins/lang_options_helper/init.rb:1:in `load_plugin' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:348:in `load_plugin' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:348:in `load_plugin' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:158:in `load_plugins' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:158:in `load_plugins' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:102:in `process' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:42:in `run' /home/to2blogs/apps/to2blogs/releases/20060913211528/config/../config/environment.rb:14 /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/tasks/misc.rake:3 /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:364:in `invoke_prerequisites' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:999:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:363:in `invoke_prerequisites' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:356:in `invoke' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:364:in `invoke_prerequisites' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:999:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:363:in `invoke_prerequisites' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:356:in `invoke' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 /usr/bin/rake:18 -- Edgar Gonz?lez Gonz?lez E-mail: edgargonzalez at gmail.com http://vp.com.ve http://lacaraoscura.com http://rubycorner.com http://to2blogs.com -- From mihnea_capraru at fastmail.fm Sat Sep 16 18:56:53 2006 From: mihnea_capraru at fastmail.fm (Mihnea Capraru) Date: Sat, 16 Sep 2006 22:56:53 +0000 Subject: [gettext-u-en] wrong constant name GetText::ActiveRecordParser::*****AssociationExtension Message-ID: <200609162256.54330.mihnea_capraru@fastmail.fm> rake updatepo seems to conflict with (some) has_many and has_and_belongs_to_many associations. activerecord-1.14.4/lib/active_record/associations.rb says starting from line 1242: extension_module_name = "#{self.to_s}#{association_id.to_s.camelize}AssociationExtension" silence_warnings do Object.const_set(extension_module_name, Module.new(&extension)) end , whereby self is a model class. The model class has been loaded by ActiveRecordParser: eval(open(file).read) and thereby self.to_s returns something like GetText::ActiveRecordParser::"ModelName" instead of returning just "ModelName", which is seemingly expected by ActiveRecord. Subsequently I cannot run rake updatepo at all. Any idea how to fix/circumvent this? From mutoh at highway.ne.jp Sat Sep 16 21:37:20 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Sun, 17 Sep 2006 10:37:20 +0900 Subject: [gettext-u-en] wrong constant name GetText::ActiveRecordParser::*****AssociationExtension In-Reply-To: <200609162256.54330.mihnea_capraru@fastmail.fm> References: <200609162256.54330.mihnea_capraru@fastmail.fm> Message-ID: <20060917103720.45d5bc8d.mutoh@highway.ne.jp> Hi, I would like to investigate your report. Could you send me a sample application? Small one is preferrable. On Sat, 16 Sep 2006 22:56:53 +0000 Mihnea Capraru wrote: > rake updatepo seems to conflict with (some) has_many and > has_and_belongs_to_many associations. > > activerecord-1.14.4/lib/active_record/associations.rb says starting from line > 1242: > > extension_module_name > = "#{self.to_s}#{association_id.to_s.camelize}AssociationExtension" > > silence_warnings do > Object.const_set(extension_module_name, Module.new(&extension)) > end > > , whereby self is a model class. The model class has been loaded by > ActiveRecordParser: > > eval(open(file).read) > > and thereby self.to_s returns something like > GetText::ActiveRecordParser::"ModelName" > instead of returning just "ModelName", which is seemingly expected by > ActiveRecord. Subsequently I cannot run rake updatepo at all. > > Any idea how to fix/circumvent this? > _______________________________________________ > gettext-users-en mailing list > gettext-users-en at rubyforge.org > http://rubyforge.org/mailman/listinfo/gettext-users-en > -- -- .:% Masao Mutoh From mihnea_capraru at fastmail.fm Sun Sep 17 04:20:54 2006 From: mihnea_capraru at fastmail.fm (Mihnea Capraru) Date: Sun, 17 Sep 2006 08:20:54 +0000 Subject: [gettext-u-en] wrong constant name GetText::ActiveRecordParser::*****AssociationExtension In-Reply-To: <20060917103720.45d5bc8d.mutoh@highway.ne.jp> References: <200609162256.54330.mihnea_capraru@fastmail.fm> <20060917103720.45d5bc8d.mutoh@highway.ne.jp> Message-ID: <200609170820.55257.mihnea_capraru@fastmail.fm> On Sunday 17 September 2006 01:37, Masao Mutoh wrote: > Hi, > > I would like to investigate your report. > > Could you send me a sample application? > Small one is preferrable. OK, I found a way to reproduce the behavior. I'm attaching a sample, but the bottomline is that it will occur when has_many or has_and_belongs_to_many receive a block, such as: class Book < ActiveRecord::Base has_and_belongs_to_many :readers do def square_five 25 end end end This will trigger the error: /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/associations.rb:1245:in `const_set': wrong constant name GetText::ActiveRecordParser::BookReadersAssociationExtension. One attachment is a rails project, the other one is an sql dump of the db (two empty tables). Mihnea Capraru -------------- next part -------------- A non-text attachment was scrubbed... Name: test.tar.bz2 Type: application/x-tbz Size: 43525 bytes Desc: not available Url : http://rubyforge.org/pipermail/gettext-users-en/attachments/20060917/b6c2072e/attachment-0001.bin -------------- next part -------------- -- MySQL dump 10.10 -- -- Host: localhost Database: test -- ------------------------------------------------------ -- Server version 5.0.24a /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; From mutoh at highway.ne.jp Sun Sep 24 10:30:05 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Sun, 24 Sep 2006 23:30:05 +0900 Subject: [gettext-u-en] GetText 1.8.0 on edge rails In-Reply-To: <20060914002745.36d9890b.mutoh@highway.ne.jp> References: <6b9e1eb20609120331n4cd4ff6bu6ddbcce735e50d13@mail.gmail.com> <20060913003007.4c9f691b.mutoh@highway.ne.jp> <6b9e1eb20609120949j5a789539vfe82ad9e444f016d@mail.gmail.com> <20060914002745.36d9890b.mutoh@highway.ne.jp> Message-ID: <20060924233005.38ca4e70.mutoh@highway.ne.jp> Hi, I fixed this on CVS. Thanks. On Thu, 14 Sep 2006 00:27:45 +0900 Masao Mutoh wrote: > Hi, > > Thanks. I could reproduce it. > I'll try fix it. > > On Tue, 12 Sep 2006 18:49:26 +0200 > "Isak Hansen" wrote: > > > On 9/12/06, Masao Mutoh wrote: > > > Hi, > > > > > > On Tue, 12 Sep 2006 12:31:45 +0200 > > > "Isak Hansen" wrote: > > > > > > > Hi all, > > > > > > > > I just upgraded to 1.8.0, and still have issues with edge rails. The > > > > "stack level too deep" error when trying to save a model didn't go > > > > away. > > > > > > > > I've verified by creating a new project with a single model. It only > > > > happens if i both upgrade to edge and require 'gettext/rails'. Didn't > > > > try to bind/use gettext from this test, but that shouldn't be > > > > neccessary? (also have the error in my real app, which does that). > > > > > > Could you remove all gettext on your environment and retry it? > > > > > > > My ruby/rails isn't strong enough to be of much help, but if there's > > > > anything i can do, please let me know. > > > > > > At least, rails edge #4819 works with gettext-1.8.0. > > > But I can't try #5093 because of Application error(It doesn't depend > > > on GetText). > > > > > > The error message is on my browser: > > > ---------------------- > > > Application error > > > > > > Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html > > > ---------------------- > > > > > > How can I test it? > > > > > > > I'm now repeating the test on a different computer (win xp, I use os x > > at work), using the following procedure: > > > > > > # create a new project > > E:\projects>rails mytest -d sqlite3 > > E:\projects>cd mytest > > > > > > # create a simple model. > > E:\projects\mytest>ruby script\generate model Apple > > > > > > # comment out the '#', so my model has a name column > > E:\projects\mytest>vim db\migrate\001_create_apples.rb > > > > > > # run the migration > > E:\projects\mytest>rake db:migrate > > (in E:/projects/mytest) > > == CreateApples: migrating ===================== > > -- create_table(:apples) > > -> 0.0000s > > == CreateApples: migrated (0.0000s) ============ > > > > > > # edit config/environment.rb, add require 'gettext/rails' to the bottom > > E:\projects\mytest>vim config\environment.rb > > > > > > #time to test (gettext + rails 1.1.6) > > E:\projects\mytest>ruby script\console > > Loading development environment. > > >> a = Apple.new(:name => "test") > > => #"test"}> > > >> a.save! > > => true > > >> > > > > > > #upgrade to edge > > E:\projects\mytest>rake rails:freeze:edge > > *snip* > > Exported revision 5093. > > > > > > #test again (gettext + edge) > > E:\projects\mytest>ruby script\console > > Loading development environment. > > >> a = Apple.new(:name => "test") > > => #"test"}, @new_record=true> > > >> a.save! > > SystemStackError: stack level too deep > > from ./script/../config/../config/../vendor/rails/activerecord/lib/activ > > e_record/callbacks.rb:330:in `callback' > > from ./script/../config/../config/../vendor/rails/activerecord/lib/activ > > e_record/callbacks.rb:301:in `valid?' > > from ./script/../config/../config/../vendor/rails/activerecord/lib/activ > > e_record/validations.rb:757:in `save_without_validation!' > > from ./script/../config/../config/../vendor/rails/activerecord/lib/activ > > e_record/validations.rb:758:in `save!' > > from (irb):2 > > >> > > > > > > # edit config/environment.rb again, remove gettext > > E:\projects\mytest>vim config\environment.rb > > > > > > #test again - edge without gettext > > E:\projects\mytest>ruby script\console > > Loading development environment. > > >> a = Apple.new(:name => "test") > > => #"test"}, @new_record=true> > > >> a.save! > > => true > > >> > > > > > > #check gettext gem version, just in case > > E:\projects\mytest>gem list > > ... > > gettext (1.8.0) > > Ruby-GetText-Package is a libary and tools to localize messages. > > ... > > > > > > > > The error may of course be caused by something else, but it seems > > gettext is at least involved somehow. Or maybe it's just some silly > > thing i'm doing wrong. > > > > Hope this helps, and thanks for a very nice library, > > Isak > > > > > > > > > > > -- > > > .:% Masao Mutoh > > > _______________________________________________ > > > 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 > -- -- .:% Masao Mutoh From mutoh at highway.ne.jp Sun Sep 24 19:46:04 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Mon, 25 Sep 2006 08:46:04 +0900 Subject: [gettext-u-en] wrong constant name GetText::ActiveRecordParser::*****AssociationExtension In-Reply-To: <200609170820.55257.mihnea_capraru@fastmail.fm> References: <200609162256.54330.mihnea_capraru@fastmail.fm> <20060917103720.45d5bc8d.mutoh@highway.ne.jp> <200609170820.55257.mihnea_capraru@fastmail.fm> Message-ID: <20060925084604.34fdb6b0.mutoh@highway.ne.jp> Hi, Sorry for replying. But there wasn't SQL for creating DB. Could you send me your schema.rb or SQL to create DB? And explain the procedure to reproduce your problem. On Sun, 17 Sep 2006 08:20:54 +0000 Mihnea Capraru wrote: > On Sunday 17 September 2006 01:37, Masao Mutoh wrote: > > Hi, > > > > I would like to investigate your report. > > > > Could you send me a sample application? > > Small one is preferrable. > > OK, I found a way to reproduce the behavior. I'm attaching a sample, but the > bottomline is that it will occur when has_many or has_and_belongs_to_many > receive a block, such as: > > class Book < ActiveRecord::Base > > has_and_belongs_to_many :readers do > def square_five > 25 > end > end > > end > > This will trigger the error: > > /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/associations.rb:1245:in > `const_set': wrong constant name > GetText::ActiveRecordParser::BookReadersAssociationExtension. > > One attachment is a rails project, the other one is an sql dump of the db (two > empty tables). > > Mihnea Capraru > -- -- .:% Masao Mutoh