From saimonmoore at gmail.com Fri Dec 1 11:14:24 2006 From: saimonmoore at gmail.com (Saimon Moore) Date: Fri, 1 Dec 2006 17:14:24 +0100 Subject: [Rails I18n] Alternative implementation of Globalize Model Translations Message-ID: This may be floating around already (or be in a globalize branch somewhere) but if not I think people may find this interesting: http://www.saimonmoore.net/2006/12/1/alternative-implementation-of-globalize-model-translations -- Posted via http://www.ruby-forum.com/. From malte at gmx-topmail.de Sun Dec 3 05:45:40 2006 From: malte at gmx-topmail.de (Malte M.) Date: Sun, 3 Dec 2006 11:45:40 +0100 Subject: [Rails I18n] ruby-gettext rails.mo issue Message-ID: <125a2e2ea5e1138737a7dcdac803931b@ruby-forum.com> I'm glad that I found this list. Trying my first steps with Rails, I found out that ruby-gettext is best suited for my i18n needs. There's one problem, though: I've done a first rough custom translation of rails.po. (The language I need is not shipped with ruby-gettext). It works fine if I install the corresponding rails.mo file into a system locale directory, i.e., into /usr/lib/ruby/gems/1.8/gems/gettext-1.8.0/data/locale/eo. However, I suppose that my webspace provider won't put a file into a system directory only for me. So I tried to put the file into RAILS_ROOT/locale/eo. But as it turns out, ruby-gettext is not interested in the file if I put it there. Any hints? -- Posted via http://www.ruby-forum.com/. From thomas.baustert at b-simple.de Sun Dec 3 06:48:07 2006 From: thomas.baustert at b-simple.de (Thomas Baustert) Date: Sun, 3 Dec 2006 12:48:07 +0100 Subject: [Rails I18n] ruby-gettext rails.mo issue In-Reply-To: <125a2e2ea5e1138737a7dcdac803931b@ruby-forum.com> References: <125a2e2ea5e1138737a7dcdac803931b@ruby-forum.com> Message-ID: Hi Malte, the directory in which ruby-gettext creates the .mo files should be the right directory. If I convert the po-file from APP_ROOT/po/xxx.pot APP_ROOT/po//xxx.po ruby-gettext creates an mo-file in APP_ROOT/locale//LC_MESSAGES/rails.mo (where tag is like de_DE or en_GB). And it works fine. Here is my rakefile: require 'gettext/utils' namespace:gettext do desc "Update pot/po files to match new version." task :updatepo do GetText.update_pofiles("de", Dir.glob("app/**/*.{rb,rhtml}"), "xxx 1.0") end desc "Create mo-files for L10n" task :makemo do GetText.create_mofiles(true, "po", "locale", "%s/LC_MESSAGES") end end rake gettext:updatepo rake gettext:makemo Don't forget to insert init_gettext "rails" into your ApplicationController. You can also add a path using: add_default_local_path(".../locale/%{tag}/LC_MESSAGES/%{name}.mo") May that helps. Am 03.12.2006 um 11:45 schrieb Malte M.: > I'm glad that I found this list. Trying my first steps > with Rails, I found out that ruby-gettext is best suited > for my i18n needs. There's one problem, though: > > I've done a first rough custom translation of rails.po. > (The language I need is not shipped with ruby-gettext). > It works fine if I install the corresponding rails.mo > file into a system locale directory, i.e., into > /usr/lib/ruby/gems/1.8/gems/gettext-1.8.0/data/locale/eo. > > However, I suppose that my webspace provider won't put > a file into a system directory only for me. So I tried > to put the file into RAILS_ROOT/locale/eo. But as it turns > out, ruby-gettext is not interested in the file if I put > it there. > > Any hints? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Railsi18n-discussion mailing list > Railsi18n-discussion at rubyforge.org > http://rubyforge.org/mailman/listinfo/railsi18n-discussion > --- Thomas Baustert b-simple.de - Ruby on Rails, Java EE, Entwicklung, Coaching fon: +49(40)411 622 35 mobil: +49(173)23 911 43 fax: +49(40)411 622 36 email: thomas.baustert(at)b-simple.de From malte at gmx-topmail.de Sun Dec 3 09:15:00 2006 From: malte at gmx-topmail.de (Malte M.) Date: Sun, 3 Dec 2006 15:15:00 +0100 Subject: [Rails I18n] ruby-gettext rails.mo issue In-Reply-To: References: <125a2e2ea5e1138737a7dcdac803931b@ruby-forum.com> Message-ID: Moin Thomas, thanks for your reply. I'm afraid your advice did not really help me. Maybe I should try and state the point of my problem clearer. Thomas Baustert wrote: > Don't forget to insert > > init_gettext "rails" > > into your ApplicationController. Basically, Gettext is working for me (translating e.g. table names), which means that I have done this already. The thing which does not work is only related to my rails.mo file, generated from rails.po. This is po/rails.pot in the ruby- gettext source directory. It contains default messages for rails ? la "%{num} errors prohibited this %{record} from being saved". > You can also add a path using: > > add_default_local_path(".../locale/%{tag}/LC_MESSAGES/%{name}.mo") Actually, when the application is running, the path is set right: $ ls locale/eo/LC_MESSAGES/ eventoj.mo rails.mo $ ./script/console Loading development environment. irb> ApplicationController.add_default_locale_path 'foo' => ["foo", "/home/malte/Krakel/eventoj/locale/%{locale}/LC_MESSAGES/%{name}.mo", "/usr/share/locale/%{locale}/LC_MESSAGES/%{name}.mo", "/usr/local/share/locale/%{locale}/LC_MESSAGES/%{name}.mo"] But it seems that these directories are not searched for rails.mo. (Note that it works for eventoj.mo, the mo file for my application.) Instead, rails.mo is in (for me) /usr/lib/ruby/gems/1.8/gems/gettext-1.8.0/data/locale/*/LC_MESSAGES, and found therein. My problem is that I do not want to put my custom translation there, but do not understand how to tell Gettext that it is somewhere else. Hope we'll get this done. Malte -- Posted via http://www.ruby-forum.com/. From thomas.baustert at b-simple.de Sun Dec 3 11:15:57 2006 From: thomas.baustert at b-simple.de (Thomas Baustert) Date: Sun, 3 Dec 2006 17:15:57 +0100 Subject: [Rails I18n] ruby-gettext rails.mo issue In-Reply-To: References: <125a2e2ea5e1138737a7dcdac803931b@ruby-forum.com> Message-ID: Hi Malte, ok, I misunderstood your problem :) I puts rails.mo into: RAILS_ROOT/locale/de_DE/ for example and it's found. The following dirs of your apps seems to be searched: data/locale/de-de/LC_MESSAGES/rails.mo data/locale/de_DE/LC_MESSAGES/rails.mo data/locale/de/LC_MESSAGES/rails.mo data/locale/de-de/rails.mo data/locale/de_DE/rails.mo data/locale/de/rails.mo locale/de-de/rails.mo locale/de_DE/rails.mo Don't know why locale//LC_MESSAGES is not in the path, but data/locale/... Maybe Masao can give us a hint :) Does is work for you? Am 03.12.2006 um 15:15 schrieb Malte M.: > Moin Thomas, thanks for your reply. I'm afraid your advice did > not really help me. Maybe I should try and state the point of > my problem clearer. > > Thomas Baustert wrote: >> Don't forget to insert >> >> init_gettext "rails" >> >> into your ApplicationController. > > Basically, Gettext is working for me (translating e.g. table > names), which means that I have done this already. The thing > which does not work is only related to my rails.mo file, > generated from rails.po. This is po/rails.pot in the ruby- > gettext source directory. It contains default messages for > rails ? la "%{num} errors prohibited this %{record} from being > saved". > >> You can also add a path using: >> >> add_default_local_path(".../locale/%{tag}/LC_MESSAGES/%{name}.mo") > > Actually, when the application is running, the path is set right: > > $ ls locale/eo/LC_MESSAGES/ > eventoj.mo rails.mo > > $ ./script/console > Loading development environment. > irb> ApplicationController.add_default_locale_path 'foo' > => ["foo", > "/home/malte/Krakel/eventoj/locale/%{locale}/LC_MESSAGES/% > {name}.mo", > "/usr/share/locale/%{locale}/LC_MESSAGES/%{name}.mo", > "/usr/local/share/locale/%{locale}/LC_MESSAGES/%{name}.mo"] > > But it seems that these directories are not searched for rails.mo. > (Note that it works for eventoj.mo, the mo file for my application.) > Instead, rails.mo is in (for me) > /usr/lib/ruby/gems/1.8/gems/gettext-1.8.0/data/locale/*/LC_MESSAGES, > and found therein. My problem is that I do not want to put my custom > translation there, but do not understand how to tell Gettext that it > is somewhere else. > > Hope we'll get this done. > > Malte > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Railsi18n-discussion mailing list > Railsi18n-discussion at rubyforge.org > http://rubyforge.org/mailman/listinfo/railsi18n-discussion --- Thomas Baustert b-simple.de - Ruby on Rails, Java EE, Entwicklung, Coaching fon: +49(40)411 622 35 mobil: +49(173)23 911 43 fax: +49(40)411 622 36 email: thomas.baustert(at)b-simple.de From mutoh at highway.ne.jp Sun Dec 3 11:47:41 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Mon, 4 Dec 2006 01:47:41 +0900 Subject: [Rails I18n] ruby-gettext rails.mo issue In-Reply-To: References: <125a2e2ea5e1138737a7dcdac803931b@ruby-forum.com> Message-ID: <20061204014741.61ecbf5e.mutoh@highway.ne.jp> Hi, On Sun, 3 Dec 2006 15:15:00 +0100 "Malte M." wrote: > Moin Thomas, thanks for your reply. I'm afraid your advice did > not really help me. Maybe I should try and state the point of > my problem clearer. > > Thomas Baustert wrote: > > Don't forget to insert > > > > init_gettext "rails" > > > > into your ApplicationController. > > Basically, Gettext is working for me (translating e.g. table > names), which means that I have done this already. The thing > which does not work is only related to my rails.mo file, > generated from rails.po. This is po/rails.pot in the ruby- > gettext source directory. It contains default messages for > rails ? la "%{num} errors prohibited this %{record} from being > saved". > > > You can also add a path using: > > > > add_default_local_path(".../locale/%{tag}/LC_MESSAGES/%{name}.mo") > > Actually, when the application is running, the path is set right: > > $ ls locale/eo/LC_MESSAGES/ > eventoj.mo rails.mo > > $ ./script/console > Loading development environment. > irb> ApplicationController.add_default_locale_path 'foo' > => ["foo", > "/home/malte/Krakel/eventoj/locale/%{locale}/LC_MESSAGES/%{name}.mo", > "/usr/share/locale/%{locale}/LC_MESSAGES/%{name}.mo", > "/usr/local/share/locale/%{locale}/LC_MESSAGES/%{name}.mo"] > > But it seems that these directories are not searched for rails.mo. > (Note that it works for eventoj.mo, the mo file for my application.) > Instead, rails.mo is in (for me) > /usr/lib/ruby/gems/1.8/gems/gettext-1.8.0/data/locale/*/LC_MESSAGES, > and found therein. My problem is that I do not want to put my custom > translation there, but do not understand how to tell Gettext that it > is somewhere else. > > Hope we'll get this done. The GetText.add_default_locale_path methods should be called before bindtextomain "rails". It means, you need to call it before requiring 'gettext/rails'. How about adding this code to the bottom of environment.rb(though I don't test it) ?: environment.rb: ----- require 'gettext' GetText.add_default_locale_path("/home/malte/Krakel/eventoj/locale/%{locale}/LC_MESSAGES/%{name}.mo") require 'gettext/rails' ----- BTW, I think the best way to support your language is to include your language in Ruby-GetText-Package. If you help me, I can include your language to my official package. #Ask me directly if you are interested in it. Regards, Masao. From malte at gmx-topmail.de Sun Dec 3 13:57:40 2006 From: malte at gmx-topmail.de (Malte M.) Date: Sun, 3 Dec 2006 19:57:40 +0100 Subject: [Rails I18n] ruby-gettext rails.mo issue In-Reply-To: <20061204014741.61ecbf5e.mutoh@highway.ne.jp> References: <125a2e2ea5e1138737a7dcdac803931b@ruby-forum.com> <20061204014741.61ecbf5e.mutoh@highway.ne.jp> Message-ID: <93a1beb5248262aa572e889cf1aa7fc7@ruby-forum.com> Masao Mutoh wrote: > environment.rb: > ----- > require 'gettext' > GetText.add_default_locale_path("/home/malte/Krakel/eventoj/locale/%{locale}/LC_MESSAGES/%{name}.mo") > > require 'gettext/rails' > ----- I changed that to the following: ---- require 'gettext' include GetText add_default_locale_path("/home/malte/Krakel/eventoj/locale/%{locale}/LC_MESSAGES/%{name}.mo") require 'gettext/rails' ---- and it works. It means to include GetText at the toplevel, because ApplicationController does not exist yet when environment.rb is executed, but it works. :) @Thomas: You're right, if I put rails.mo into locale/eo/ instead of locale/eo/LC_MESSAGES/, then it is found. Actually, that is a nice solution, too, and I think I will choose this one. Hm, if this is a bug, then its source seems to be around line 200 of gettext/rails.rb. Maybe the line locale_path = File.join(caller[0].split(/app.controllers/)[0] + "locale") should read locale_path = File.join(caller[0].split(/app.controllers/)[0], "locale", "LC_MESSAGES") instead? Anyway, thank you both for solving my problem! > BTW, I think the best way to support your language is > to include your language in Ruby-GetText-Package. > If you help me, I can include your language to my official package. > #Ask me directly if you are interested in it. I'll send you the po file as soon as I consider it finished. I'll forget this, so please remind me eventually ;-) And keep up the great work you do on your Ruby libraries. Malte -- Posted via http://www.ruby-forum.com/. From mutoh at highway.ne.jp Mon Dec 4 12:34:38 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Tue, 5 Dec 2006 02:34:38 +0900 Subject: [Rails I18n] ruby-gettext rails.mo issue In-Reply-To: <93a1beb5248262aa572e889cf1aa7fc7@ruby-forum.com> References: <125a2e2ea5e1138737a7dcdac803931b@ruby-forum.com> <20061204014741.61ecbf5e.mutoh@highway.ne.jp> <93a1beb5248262aa572e889cf1aa7fc7@ruby-forum.com> Message-ID: <20061205023438.4806ac3b.mutoh@highway.ne.jp> Hi, On Sun, 3 Dec 2006 19:57:40 +0100 "Malte M." wrote: > Masao Mutoh wrote: > > environment.rb: > > ----- > > require 'gettext' > > GetText.add_default_locale_path("/home/malte/Krakel/eventoj/locale/%{locale}/LC_MESSAGES/%{name}.mo") > > > > require 'gettext/rails' > > ----- > > I changed that to the following: > > ---- > require 'gettext' > include GetText > add_default_locale_path("/home/malte/Krakel/eventoj/locale/%{locale}/LC_MESSAGES/%{name}.mo") > require 'gettext/rails' > ---- > > and it works. It means to include GetText at the toplevel, because > ApplicationController does not exist yet when environment.rb is > executed, but it works. :) > > @Thomas: You're right, if I put rails.mo into locale/eo/ instead of > locale/eo/LC_MESSAGES/, then it is found. Actually, that is a nice > solution, too, and I think I will choose this one. Hm, if this is > a bug, then its source seems to be around line 200 of gettext/rails.rb. > Maybe the line > > locale_path = File.join(caller[0].split(/app.controllers/)[0] + > "locale") > should read > > locale_path = File.join(caller[0].split(/app.controllers/)[0], > "locale", "LC_MESSAGES") > > instead? Anyway, thank you both for solving my problem! No. the locale_path is the topdir of the locale path. So, it becomes both of topdir/#{lang}/locale/foo.mo, topdir/#{lang}/locale/LC_MESSAGES/foo.mo. #See gettext/textdomain.rb for more details. > > BTW, I think the best way to support your language is > > to include your language in Ruby-GetText-Package. > > If you help me, I can include your language to my official package. > > #Ask me directly if you are interested in it. > > I'll send you the po file as soon as I consider it finished. I'll forget > this, so please remind me eventually ;-) And keep up the great work > you do on your Ruby libraries. I'll send you the newest version of po files. Thanks in advance. Masao. From japgolly at gmail.com Wed Dec 6 22:29:16 2006 From: japgolly at gmail.com (David Barri) Date: Thu, 7 Dec 2006 14:29:16 +1100 Subject: [Rails I18n] Gloc bug? In-Reply-To: References: <4af7da08cfb8ba0470bc0ee3a563ad8c@ruby-forum.com> Message-ID: Hmm, it's really wierd that other plugins are loading but GLoc isn't.. ok, try just adding the gloc paths to the load path and manually require it then. Again it's very odd that that's happening. And also u can u can just use puts to see if the init file is being loaded but you can output text to a file and check that instead. good luck :) Golly On 30/11/06, Maarten Porters wrote: > I'm happy that you replied so quick :). I'm absolutely sure it's in > vendor/plugins/gloc . I'm a rails newbie so I'm not sure how I can > output > something from the init.rb. I can't do puts 'blablabla' because I won't > be able > to see server output with my dreamhost account. So then I tried to to > add this in my environment.rb : > > config.load_paths += %W( > {RAILS_ROOT}/vendor/plugins/gloc > {RAILS_ROOT}/vendor/plugins/gloc/lib > ) > > this didn't work :(. I also tried other plugins and they work so I'm not > sure > it's a problem with my host. Any suggestions? > > > Temesta > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Railsi18n-discussion mailing list > Railsi18n-discussion at rubyforge.org > http://rubyforge.org/mailman/listinfo/railsi18n-discussion > From rf.10.cbit at spamgourmet.com Fri Dec 8 14:42:42 2006 From: rf.10.cbit at spamgourmet.com (Bitbutter) Date: Fri, 8 Dec 2006 20:42:42 +0100 Subject: [Rails I18n] Functional testing In-Reply-To: <200608041627.32392.bonnee@csgsolar.com.au> References: <200608041627.32392.bonnee@csgsolar.com.au> Message-ID: Bonne Eggleston wrote: > Hi there, > I'm implementing the Globalize plugin on my application, and so far it's > working quite well. > One problem I'm having is that I can't do any functional tests. > It appears as though the locale is not set for the tests. Having the same problem. I've had to comment out all my functional tests for the moment because of locale not being set. Anyone know of a solution? -- Posted via http://www.ruby-forum.com/. From flippie124 at hotmail.com Sat Dec 9 08:15:11 2006 From: flippie124 at hotmail.com (Maarten Porters) Date: Sat, 9 Dec 2006 14:15:11 +0100 Subject: [Rails I18n] Gloc bug? In-Reply-To: References: <4af7da08cfb8ba0470bc0ee3a563ad8c@ruby-forum.com> Message-ID: <013578d91be860d7ebc671dd46ceed85@ruby-forum.com> David Barri wrote: > Hmm, it's really wierd that other plugins are loading but GLoc isn't.. > ok, try just adding the gloc paths to the load path and manually > require it then. Again it's very odd that that's happening. > > And also u can u can just use puts to see if the init file is being > loaded but you can output text to a file and check that instead. good > luck :) > > Golly I tried everything you said but it still doesn't work :(. I could give you temporary acces to my files so you could take a quick look at it. I would really appreciate it if you want to do this. Let me know something and I'll e-mail you a login and passw. I'll create simple gloc test controller & view so you can see it doesn't work. greetings, Temesta -- Posted via http://www.ruby-forum.com/. From japgolly at gmail.com Sat Dec 9 10:01:14 2006 From: japgolly at gmail.com (David Barri) Date: Sun, 10 Dec 2006 02:01:14 +1100 Subject: [Rails I18n] Gloc bug? In-Reply-To: <013578d91be860d7ebc671dd46ceed85@ruby-forum.com> References: <4af7da08cfb8ba0470bc0ee3a563ad8c@ruby-forum.com> <013578d91be860d7ebc671dd46ceed85@ruby-forum.com> Message-ID: yeah ok thats cool, just email me then at japgolly at_ gmail.com I'll take a look when I get time. ;) Golly On 10/12/06, Maarten Porters wrote: > David Barri wrote: > > Hmm, it's really wierd that other plugins are loading but GLoc isn't.. > > ok, try just adding the gloc paths to the load path and manually > > require it then. Again it's very odd that that's happening. > > > > And also u can u can just use puts to see if the init file is being > > loaded but you can output text to a file and check that instead. good > > luck :) > > > > Golly > > > I tried everything you said but it still doesn't work :(. I could give > you temporary acces to my files so you could take a quick look at it. I > would really appreciate it if you want to do this. Let me know something > and I'll e-mail you a login and passw. I'll create simple gloc test > controller & view so you can see it doesn't work. > > greetings, > > Temesta > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Railsi18n-discussion mailing list > Railsi18n-discussion at rubyforge.org > http://rubyforge.org/mailman/listinfo/railsi18n-discussion > From eugenol at gmail.com Sat Dec 9 11:38:27 2006 From: eugenol at gmail.com (Eugenol) Date: Sat, 9 Dec 2006 17:38:27 +0100 Subject: [Rails I18n] Globalize's SQL queries Message-ID: <8a7ce02e0612090838l4002f20cn14d68244f9c6eed0@mail.gmail.com> Hi Does Globalize query a thousand times the database if there's a thousand of translations to get in a view in production mode ? I don't get why there's no single request even in development mode... Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/railsi18n-discussion/attachments/20061209/ca896beb/attachment.html From rf.10.cbit at spamgourmet.com Sat Dec 9 12:33:37 2006 From: rf.10.cbit at spamgourmet.com (Bitbutter) Date: Sat, 9 Dec 2006 18:33:37 +0100 Subject: [Rails I18n] Functional testing In-Reply-To: References: <200608041627.32392.bonnee@csgsolar.com.au> Message-ID: Posted about it here also: http://www.bitbutter.com/5/globalize-did-localebase_language-eat-my-functional-tests/ -- Posted via http://www.ruby-forum.com/. From kallstart at gmail.com Tue Dec 12 08:37:01 2006 From: kallstart at gmail.com (kallstart) Date: Tue, 12 Dec 2006 14:37:01 +0100 Subject: [Rails I18n] Globalize setup problem (locale.rb) Message-ID: Software Gentoo Ruby 1.8.5 Rails 1.1.6 Hey, trying to setup the Globalize plugin for my rails app. This is what I did so far, followed the guide at http://wiki.globalize-rails.org/globalize/show/Example+Application: 1. Created and customized my rails app. App works great. 2. script/plugin install svn://svn.globalize-rails.org/globalize/branches/for-1.1 3. Renamed vendor/plugins/for-1.1 directory to globalize 4. rake globalize:setup 5. Added this to my environment.rb: include Globalize Locale.set_base_language 'en-US' LOCALES = {'sv' => 'sv-SE', 'en' => 'en-US'}.freeze 6. Added this to my application.rb before_filter :set_locale def set_locale if !params[:locale].nil? && LOCALES.keys.include?(params[:locale]) Locale.set LOCALES[params[:locale]] else redirect_to params.merge( 'locale' => Locale.base_language.code ) end end Now when I test my app I get this error message, cant understand why... NameError in MyController#index uninitialized constant Locale RAILS_ROOT: /var/www/localhost/htdocs/../config/.. Application Trace | Framework Trace | Full Trace /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/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in `const_missing' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in `send' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in `const_missing' #{RAILS_ROOT}/app/controllers/application.rb:16:in `set_locale' /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/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in `const_missing' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in `send' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in `const_missing' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:399:in `send' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:399:in `call_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:394:in `each' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:394:in `call_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:383:in `before_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:365:in `perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/rescue.rb:82:in `perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in `send' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in `process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in `process_without_session_management_support' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:in `process' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in `dispatch' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:150:in `process_request' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:54:in `process!' /usr/lib/ruby/site_ruby/1.8/fcgi.rb:600:in `each_cgi' /usr/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each' /usr/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:53:in `process!' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:23:in `process!' /var/www/localhost/htdocs/dispatch.fcgi:24 /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/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in `const_missing' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in `send' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in `const_missing' #{RAILS_ROOT}/app/controllers/application.rb:16:in `set_locale' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:399:in `send' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:399:in `call_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:394:in `each' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:394:in `call_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:383:in `before_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:365:in `perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/rescue.rb:82:in `perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in `send' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in `process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in `process_without_session_management_support' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:in `process' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in `dispatch' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:150:in `process_request' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:54:in `process!' /usr/lib/ruby/site_ruby/1.8/fcgi.rb:600:in `each_cgi' /usr/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each' /usr/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:53:in `process!' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:23:in `process!' /var/www/localhost/htdocs/dispatch.fcgi:24 This error occured while loading the following files: locale.rb Request Parameters: None Show session dump --- flash: !map:ActionController::Flash::FlashHash {} Response Headers: {"cookie"=>[], "Content-Type"=>"text/html; charset=iso-8859-1", "Cache-Control"=>"no-cache"} -- Posted via http://www.ruby-forum.com/. From k.j.wierenga at gmail.com Tue Dec 12 09:21:12 2006 From: k.j.wierenga at gmail.com (KJ Wierenga) Date: Tue, 12 Dec 2006 15:21:12 +0100 Subject: [Rails I18n] Functional testing In-Reply-To: References: <200608041627.32392.bonnee@csgsolar.com.au> Message-ID: <2e2d348392019aaeccccc09ee0783fb0@ruby-forum.com> Bitbutter wrote: > Posted about it here also: > http://www.bitbutter.com/5/globalize-did-localebase_language-eat-my-functional-tests/ I'm experiencing the same problem, but since I've just started learning Rails, I can't seem to fix it. Does anyone have a solution yet? -- Posted via http://www.ruby-forum.com/. From bk at benjaminkrause.com Tue Dec 12 09:44:22 2006 From: bk at benjaminkrause.com (Benjamin Krause) Date: Tue, 12 Dec 2006 15:44:22 +0100 Subject: [Rails I18n] Functional testing In-Reply-To: <2e2d348392019aaeccccc09ee0783fb0@ruby-forum.com> References: <200608041627.32392.bonnee@csgsolar.com.au> <2e2d348392019aaeccccc09ee0783fb0@ruby-forum.com> Message-ID: On Dec 12, 2006, at 15:21, KJ Wierenga wrote: > Bitbutter wrote: >> Posted about it here also: >> http://www.bitbutter.com/5/globalize-did-localebase_language-eat- >> my-functional-tests/ > > I'm experiencing the same problem, but since I've just started > learning > Rails, I can't seem to fix it. Does anyone have a solution yet? try this: Loading test environment. >> Locale => Globalize::Locale >> Locale.set_base_language Language.pick('en') => English >> Locale.base_language => English >> Locale.set_base_language Language.pick('de') => German >> Locale.base_language => German From rf.10.cbit at spamgourmet.com Tue Dec 12 10:23:08 2006 From: rf.10.cbit at spamgourmet.com (Bitbutter) Date: Tue, 12 Dec 2006 16:23:08 +0100 Subject: [Rails I18n] Functional testing In-Reply-To: References: <200608041627.32392.bonnee@csgsolar.com.au> <2e2d348392019aaeccccc09ee0783fb0@ruby-forum.com> Message-ID: <427b1b42ee3b589ec9708dffee62be53@ruby-forum.com> Benjamin Krause wrote: > try this: > > Loading test environment. > >> Locale > => Globalize::Locale > >> Locale.set_base_language Language.pick('en') > => English > >> Locale.base_language > => English > >> Locale.set_base_language Language.pick('de') > => German > >> Locale.base_language > => German Odd, i get an error when i try that: Loading test environment. >> Locale => Globalize::Locale >> Locale.set_base_language Language.pick('en') ArgumentError: bad format for , not rfc-3066 compliant from ./script/../config/../config/../vendor/plugins/globalize/lib/globalize/localization/rfc_3066.rb:6:in `parse' from ./script/../config/../config/../vendor/plugins/globalize/lib/globalize/localization/locale.rb:64:in `set_base_language' from (irb):2 >> (rails 1.1.6.5618) -- Posted via http://www.ruby-forum.com/. From k.j.wierenga at gmail.com Tue Dec 12 10:34:40 2006 From: k.j.wierenga at gmail.com (KJ Wierenga) Date: Tue, 12 Dec 2006 16:34:40 +0100 Subject: [Rails I18n] Functional testing In-Reply-To: References: <200608041627.32392.bonnee@csgsolar.com.au> <2e2d348392019aaeccccc09ee0783fb0@ruby-forum.com> Message-ID: <53c35c84150006e3ff0d002a3e61f7e3@ruby-forum.com> When I use Locale.set_base_language Language.pick('en') function I get: /vendor/plugins/globalize/lib/globalize/localization/rfc_3066.rb:6:in `parse': bad format for , not rfc-3066 compliant (ArgumentError) -- Posted via http://www.ruby-forum.com/. From k.j.wierenga at gmail.com Tue Dec 12 10:36:44 2006 From: k.j.wierenga at gmail.com (KJ Wierenga) Date: Tue, 12 Dec 2006 16:36:44 +0100 Subject: [Rails I18n] Functional testing In-Reply-To: <53c35c84150006e3ff0d002a3e61f7e3@ruby-forum.com> References: <200608041627.32392.bonnee@csgsolar.com.au> <2e2d348392019aaeccccc09ee0783fb0@ruby-forum.com> <53c35c84150006e3ff0d002a3e61f7e3@ruby-forum.com> Message-ID: <8e18dc1fdc003cb61660d3a3c60f4904@ruby-forum.com> KJ Wierenga wrote: > When I use Locale.set_base_language Language.pick('en') function I get: > > /vendor/plugins/globalize/lib/globalize/localization/rfc_3066.rb:6:in > `parse': bad format for , not rfc-3066 compliant (ArgumentError) So same error as Bitbutter. I'm using Rails 1.1.6 on Windows -- Posted via http://www.ruby-forum.com/. From k.j.wierenga at gmail.com Tue Dec 12 10:39:07 2006 From: k.j.wierenga at gmail.com (KJ Wierenga) Date: Tue, 12 Dec 2006 16:39:07 +0100 Subject: [Rails I18n] Functional testing In-Reply-To: <8e18dc1fdc003cb61660d3a3c60f4904@ruby-forum.com> References: <200608041627.32392.bonnee@csgsolar.com.au> <2e2d348392019aaeccccc09ee0783fb0@ruby-forum.com> <53c35c84150006e3ff0d002a3e61f7e3@ruby-forum.com> <8e18dc1fdc003cb61660d3a3c60f4904@ruby-forum.com> Message-ID: <0d28897d2e4c65af704254b08e133fe3@ruby-forum.com> I managed to get rid of the 'base_language' not set error by having the following code in my ApplicationController: class ApplicationController < ActionController::Base model :cart model :line_item before_filter :set_locale after_filter :set_charset def set_locale if !params[:locale].nil? && LOCALES.keys.include?(params[:locale]) Locale.set LOCALES[params[:locale]] else if Locale.base_language redirect_to params.merge( 'locale' => Locale.base_language.code ) else redirect_to params.merge( 'locale' => 'en' ) end return true end end ... end But now I get: Exception: Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and only once per action. Also note that neither redirect nor render terminate execution of the action, so if you want to exit an action after redirecting, you need to do something like "redirect_to(...) and return". Finally, note that to cause a before filter to halt execution of the rest of the filter chain, the filter must return false, explicitly, so "render(...) and return false". d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:840:in `redirect_to' d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:854:in `redirect_to' D:/Projects/Rails/depot/config/../app/controllers/application.rb:43:in `authorize' d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:399:in `send' d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:399:in `call_filters' d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:394:in `each' d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:394:in `call_filters' d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:383:in `before_action' d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:365:in `perform_action_without_benchmark' d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue' d:/Tools/InstantRails/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue' d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/rescue.rb:82:in `perform_action' d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in `send' d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in `process_without_filters' d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in `process_without_session_management_support' d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:in `process_without_test' d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/test_process.rb:16:in `process' d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/test_process.rb:363:in `process' d:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/test_process.rb:336:in `get' D:\Projects\Rails\depot/test/functional/login_controller_test.rb:17:in `test_index' d:/Tools/InstantRails/ruby/lib/ruby/1.8/test/unit/testcase.rb:72:in `__send__' d:/Tools/InstantRails/ruby/lib/ruby/1.8/test/unit/testcase.rb:72:in `run' d:/Tools/InstantRails/ruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run' d:/Tools/InstantRails/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each' d:/Tools/InstantRails/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run' d:/Tools/InstantRails/ruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run' d:/Tools/InstantRails/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each' d:/Tools/InstantRails/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run' d:/Tools/InstantRails/ruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in `run_suite' D:/Tools/RadRails_0_7_2/plugins/org.rubypeople.rdt.testunit_0.8.0.604272100PRD/ruby/RemoteTestRunner.rb:107:in `start_mediator' D:/Tools/RadRails_0_7_2/plugins/org.rubypeople.rdt.testunit_0.8.0.604272100PRD/ruby/RemoteTestRunner.rb:52:in `start' D:/Tools/RadRails_0_7_2/plugins/org.rubypeople.rdt.testunit_0.8.0.604272100PRD/ruby/RemoteTestRunner.rb:272 -- Posted via http://www.ruby-forum.com/. From rf.10.cbit at spamgourmet.com Tue Dec 12 11:02:16 2006 From: rf.10.cbit at spamgourmet.com (Bitbutter) Date: Tue, 12 Dec 2006 17:02:16 +0100 Subject: [Rails I18n] Alternative implementation of Globalize Model Translatio In-Reply-To: References: Message-ID: <64821023d6ff58da6ba2dafcd0789c5c@ruby-forum.com> Saimon Moore wrote: > This may be floating around already (or be in a globalize branch > somewhere) but if not I think people may find this interesting: > > http://www.saimonmoore.net/2006/12/1/alternative-implementation-of-globalize-model-translations smart, thanks very much for the link! -- Posted via http://www.ruby-forum.com/. From rf.10.cbit at spamgourmet.com Tue Dec 12 11:11:13 2006 From: rf.10.cbit at spamgourmet.com (Bitbutter) Date: Tue, 12 Dec 2006 17:11:13 +0100 Subject: [Rails I18n] Functional testing In-Reply-To: <0d28897d2e4c65af704254b08e133fe3@ruby-forum.com> References: <200608041627.32392.bonnee@csgsolar.com.au> <2e2d348392019aaeccccc09ee0783fb0@ruby-forum.com> <53c35c84150006e3ff0d002a3e61f7e3@ruby-forum.com> <8e18dc1fdc003cb61660d3a3c60f4904@ruby-forum.com> <0d28897d2e4c65af704254b08e133fe3@ruby-forum.com> Message-ID: <1e6209d136512bcf2ba7ac4b305e0153@ruby-forum.com> (KJ Wierenga: i initially tried a set up like the one you posted but also ran into similar recursion difficulties. If you like you can mail me at kj.1.cbit AT spamgourmet.com and i'll send you some examples of the sessions based approach i'm using now) -- Posted via http://www.ruby-forum.com/. From me at seebq.com Tue Dec 12 12:21:32 2006 From: me at seebq.com (Charles Brian Quinn) Date: Tue, 12 Dec 2006 12:21:32 -0500 Subject: [Rails I18n] Functional testing In-Reply-To: <1e6209d136512bcf2ba7ac4b305e0153@ruby-forum.com> References: <200608041627.32392.bonnee@csgsolar.com.au> <2e2d348392019aaeccccc09ee0783fb0@ruby-forum.com> <53c35c84150006e3ff0d002a3e61f7e3@ruby-forum.com> <8e18dc1fdc003cb61660d3a3c60f4904@ruby-forum.com> <0d28897d2e4c65af704254b08e133fe3@ruby-forum.com> <1e6209d136512bcf2ba7ac4b305e0153@ruby-forum.com> Message-ID: <3a2de0cd0612120921n2051594cg1e3017e5beeb6086@mail.gmail.com> Perhaps you meant to return false in a filter chain after a redirect? http://weblog.jamisbuck.org/2005/7/8/rails-tip-of-the-day FYI: be careful with the set_charset action: http://www.nabble.com/FIXED-Internet-Explorer-cannot-download-pages-tf2716459s17045.html On 12/12/06, Bitbutter wrote: > (KJ Wierenga: i initially tried a set up like the one you posted but > also ran into similar recursion difficulties. If you like you can mail > me at kj.1.cbit AT spamgourmet.com and i'll send you some examples of > the sessions based approach i'm using now) > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Railsi18n-discussion mailing list > Railsi18n-discussion at rubyforge.org > http://rubyforge.org/mailman/listinfo/railsi18n-discussion > -- Charles Brian Quinn self-promotion: www.seebq.com highgroove studios: www.highgroove.com slingshot hosting: www.slingshothosting.com From christian at cjohansen.no Sun Dec 17 13:11:58 2006 From: christian at cjohansen.no (Christian Johansen) Date: Sun, 17 Dec 2006 19:11:58 +0100 Subject: [Rails I18n] Ruby-Gettext and date/time? Message-ID: <4bb8d814f55c92fff6c261226228ce87@ruby-forum.com> How can I have localized dates and times using Ruby-Gettext? -- Posted via http://www.ruby-forum.com/. From suhaspnehete at gmail.com Thu Dec 28 08:00:15 2006 From: suhaspnehete at gmail.com (Suhas Nehete) Date: Thu, 28 Dec 2006 14:00:15 +0100 Subject: [Rails I18n] Configure database with RoR applications Message-ID: Could you please tell me how to configure database with RoR application on hosting site (site5.com) ? -- Posted via http://www.ruby-forum.com/.