From erkki at itech.ee Thu Mar 2 05:09:32 2006 From: erkki at itech.ee (Erkki Eilonen) Date: Thu, 02 Mar 2006 12:09:32 +0200 Subject: [gettext-u-en] ruby on rails & language/locale override Message-ID: <1141294172.30490.44.camel@erkki> Hello, Previously it was suggested on this list to override the locale in RoR by doing > require 'gettext/rails' > > class ApplicationController < ActionController::Base > GetText.locale = "fr_FR" > init_gettext "blog" > end With the same method, I'm having some problems. The actual change of locale seems to take 2 web requests to propagate. So if I would change the locale according to a page request variable like this: application_controller.rb > init_gettext "webpage", "UTF-8", "text/html" > before_filter {|contra| > GetText.locale = contra.params[:lang] > } If i would request a page where the :lang parameter is 'et' and the old active locale was 'en', the first page serve would show the webpage in the 'en' locale, but the :lang variable & GetText.locale would be 'et'. After a reload, the message strings would be correctly translated. The same would occur if a language switch was to be made (ie a web request, where the :lang parameter would be 'en' again). Could anyone comment the issue and/or help me debug it? Perhaps it is just the way ruby-gettext handles things? Is it possible to change locales on-the-fly, per request, and doing so by not using the usual methods already handled by ruby-gettext (cookies, query strings, etc). -- Erkki Eilonen iTech Solutions From mutoh at highway.ne.jp Sat Mar 11 10:35:54 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Sun, 12 Mar 2006 00:35:54 +0900 Subject: [gettext-u-en] [ANN] Ruby-GetText-Package-1.3.0 Message-ID: <20060312003554.05d18f9e.mutoh@highway.ne.jp> Hi, Ruby-GetText-Package-1.3.0 is now available. Changes ------- * Improve Local::Object * POSIX, C convert to "en". * Enhance supports of Ruby on Rails. * ActionMailer localization support. * Use GetText function(_() N_() etc) in template. * ISO-2022-JP charset is used when language is "ja"(Japanese). * Localization templates support. * ActionController::Base.render_text is overrided to find localized templates such as foo_ja.rhml, foo_ja_JP.rhtml. * @params["lang"] is treated as cgi["lang"] * Use N_() as localized messages of validates_* instead of _(). * Translates ActiveRecord::Column.human_name values automatically. * Fix memory leak, other bugs. Thanks to: Albert Ramstedt, Yugui, drawnboy, Erkki Eilonen, Nickolay Kolev, Kazuhiro NISHIYAMA and others. *Note* Now you need to use N_() as localized messages of validates_* instead of _(). # If you use _(), it works on development mode but doesn't work on production # mode. (e.g.) class Article < ActiveRecord::Base validates_presence_of :title, :message => N_("%{fn} can't be empty") validates_length_of :description, :minimum => 10, :message => N_("is required more than %d characters") end -- .:% Masao Mutoh From donald.piret at synergetek.be Sat Mar 11 11:58:15 2006 From: donald.piret at synergetek.be (Donald Piret) Date: Sat, 11 Mar 2006 17:58:15 +0100 Subject: [gettext-u-en] ruby on rails & language/locale override even worse problem In-Reply-To: <1141294172.30490.44.camel@erkki> References: <1141294172.30490.44.camel@erkki> Message-ID: <441301A7.4010308@synergetek.be> Erkki Eilonen wrote: > Hello, > > Previously it was suggested on this list to override the locale in RoR > by doing > > >> require 'gettext/rails' >> >> class ApplicationController < ActionController::Base >> GetText.locale = "fr_FR" >> init_gettext "blog" >> end >> > > With the same method, I'm having some problems. > The actual change of locale seems to take 2 web requests to propagate. > So if I would change the locale according to a page request variable like this: > > application_controller.rb > >> init_gettext "webpage", "UTF-8", "text/html" >> > > >> before_filter {|contra| >> GetText.locale = contra.params[:lang] >> } >> > > If i would request a page where the :lang parameter is 'et' and the old > active locale was 'en', the first page serve would show the webpage in > the 'en' locale, but the :lang variable & GetText.locale would be 'et'. > After a reload, the message strings would be correctly translated. The > same would occur if a language switch was to be made (ie a web request, > where the :lang parameter would be 'en' again). > > Could anyone comment the issue and/or help me debug it? Perhaps it is > just the way ruby-gettext handles things? Is it possible to change > locales on-the-fly, per request, and doing so by not using the usual > methods already handled by ruby-gettext (cookies, query strings, etc). > > Hello, Actually I'm having an even worse problem, the initially suggested method require 'gettext/rails' class ApplicationController < ActionController::Base GetText.locale = "fr_FR" init_gettext "blog" end does not seem to be working anymore at all for me, overriding the language by using the lang request variable (ex as in http://localhost:3001/products?lang=en) works fine. But setting it in the application controller just doesn't seem to work anymore (while it seemed to work after the suggestion was given) Hope anyone can say what's going on, Thanks a lot in advance, Donald Piret -------------- next part -------------- A non-text attachment was scrubbed... Name: donald.piret.vcf Type: text/x-vcard Size: 299 bytes Desc: not available Url : http://rubyforge.org/pipermail/gettext-users-en/attachments/20060311/23f93b51/attachment.vcf -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3206 bytes Desc: S/MIME Cryptographic Signature Url : http://rubyforge.org/pipermail/gettext-users-en/attachments/20060311/23f93b51/attachment.bin From donald.piret at synergetek.be Sat Mar 11 20:40:29 2006 From: donald.piret at synergetek.be (Donald Piret) Date: Sun, 12 Mar 2006 02:40:29 +0100 Subject: [gettext-u-en] Production app with 1.3 doesn't work anymore Message-ID: <44137C0D.5090400@synergetek.be> Hello, Just mailing because all my apps using GetText stopped working after updating the gem to 1.3, this doesn't occur when using webbrick, only in production environment on apache + fcgi. The error I'm getting is the following: NameError in # uninitialized constant System RAILS_ROOT: /srv/web/portevoltest.synergetek.be/public/../config/.. Application Trace | Framework Trace | Full Trace /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:200:in `const_missing' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/locale_posix.rb:17 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in `require' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/locale.rb:40 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in `require' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext.rb:19 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in `require' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/cgi.rb:13 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in `require' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/rails.rb:12 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in `require' #{RAILS_ROOT}/app/controllers/application.rb:3 /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:200:in `const_missing' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/locale_posix.rb:17 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in `require' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/locale.rb:40 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in `require' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext.rb:19 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in `require' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/cgi.rb:13 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in `require' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/rails.rb:12 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:207:in `load' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:39:in `require_or_load' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:22:in `depend_on' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:178:in `require_dependency' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:134:in `load_file!' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:97:in `const_load!' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:80:in `const_load!' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:71:in `prepare_application' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:37:in `dispatch' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:141:in `process_request' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:53:in `process!' /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:600:in `each_cgi' /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:52:in `process!' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:22:in `process!' /srv/web/portevoltest.synergetek.be/public/dispatch.fcgi:24 /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:200:in `const_missing' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/locale_posix.rb:17 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in `require' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/locale.rb:40 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in `require' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext.rb:19 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in `require' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/cgi.rb:13 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in `require' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/rails.rb:12 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in `require' #{RAILS_ROOT}/app/controllers/application.rb:3 /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:207:in `load' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:39:in `require_or_load' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:22:in `depend_on' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:178:in `require_dependency' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:134:in `load_file!' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:97:in `const_load!' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:80:in `const_load!' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:71:in `prepare_application' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:37:in `dispatch' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:141:in `process_request' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:53:in `process!' /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:600:in `each_cgi' /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:52:in `process!' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:22:in `process!' /srv/web/portevoltest.synergetek.be/public/dispatch.fcgi:24 This error occured while loading the following files: /srv/web/portevoltest.synergetek.be/public/../config/../app/controllers/application.rb gettext/rails gettext/cgi gettext gettext/locale gettext/locale_posix system.rb Any idea how this can be fixed or how the gem can be rolled back to 1.2 would be appreciated. Donald Piret -------------- next part -------------- A non-text attachment was scrubbed... Name: donald.piret.vcf Type: text/x-vcard Size: 299 bytes Desc: not available Url : http://rubyforge.org/pipermail/gettext-users-en/attachments/20060312/b0e96ba6/attachment-0001.vcf -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3206 bytes Desc: S/MIME Cryptographic Signature Url : http://rubyforge.org/pipermail/gettext-users-en/attachments/20060312/b0e96ba6/attachment-0001.bin From donald.piret at synergetek.be Sat Mar 11 20:59:21 2006 From: donald.piret at synergetek.be (Donald Piret) Date: Sun, 12 Mar 2006 02:59:21 +0100 Subject: [gettext-u-en] Production app with 1.3 doesn't work anymore In-Reply-To: <44137C0D.5090400@synergetek.be> References: <44137C0D.5090400@synergetek.be> Message-ID: <44138079.60905@synergetek.be> Please disregard the previous message, I realised it was my mistake. Apparently this error message occurs when you mistakenly install the win32 gem on a unix environment (didn't check carefully when updating the gem), sorry again. Donald Piret Donald Piret wrote: > Hello, > > Just mailing because all my apps using GetText stopped working after > updating the gem to 1.3, this doesn't occur when using webbrick, only in > production environment on apache + fcgi. The error I'm getting is the > following: > > NameError in # > > uninitialized constant System > > RAILS_ROOT: /srv/web/portevoltest.synergetek.be/public/../config/.. > Application Trace | Framework Trace | Full Trace > > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:200:in > `const_missing' > /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/locale_posix.rb:17 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in > `require' > /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/locale.rb:40 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in > `require' > /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext.rb:19 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in > `require' > /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/cgi.rb:13 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in > `require' > /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/rails.rb:12 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in > `require' > #{RAILS_ROOT}/app/controllers/application.rb:3 > > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:200:in > `const_missing' > /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/locale_posix.rb:17 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in > `require' > /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/locale.rb:40 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in > `require' > /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext.rb:19 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in > `require' > /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/cgi.rb:13 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in > `require' > /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/rails.rb:12 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in > `require' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:207:in > `load' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:39:in > `require_or_load' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:22:in > `depend_on' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:178:in > `require_dependency' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:134:in > `load_file!' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:97:in > `const_load!' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:80:in > `const_load!' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:71:in > `prepare_application' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:37:in > `dispatch' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:141:in > `process_request' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:53:in > `process!' > /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:600:in `each_cgi' > /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:52:in > `process!' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:22:in > `process!' > /srv/web/portevoltest.synergetek.be/public/dispatch.fcgi:24 > > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:200:in > `const_missing' > /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/locale_posix.rb:17 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in > `require' > /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/locale.rb:40 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in > `require' > /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext.rb:19 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in > `require' > /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/cgi.rb:13 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in > `require' > /usr/local/lib/ruby/gems/1.8/gems/gettext-1.3.0-mswin32/lib/gettext/rails.rb:12 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in > `require' > #{RAILS_ROOT}/app/controllers/application.rb:3 > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:207:in > `load' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:39:in > `require_or_load' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:22:in > `depend_on' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:178:in > `require_dependency' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:134:in > `load_file!' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:97:in > `const_load!' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:80:in > `const_load!' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:71:in > `prepare_application' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:37:in > `dispatch' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:141:in > `process_request' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:53:in > `process!' > /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:600:in `each_cgi' > /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:52:in > `process!' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:22:in > `process!' > /srv/web/portevoltest.synergetek.be/public/dispatch.fcgi:24 > > This error occured while loading the following files: > > /srv/web/portevoltest.synergetek.be/public/../config/../app/controllers/application.rb > gettext/rails > gettext/cgi > gettext > gettext/locale > gettext/locale_posix > system.rb > > > Any idea how this can be fixed or how the gem can be rolled back to 1.2 > would be appreciated. > > Donald Piret > > _______________________________________________ > gettext-users-en mailing list > gettext-users-en at rubyforge.org > http://rubyforge.org/mailman/listinfo/gettext-users-en -------------- next part -------------- A non-text attachment was scrubbed... Name: donald.piret.vcf Type: text/x-vcard Size: 299 bytes Desc: not available Url : http://rubyforge.org/pipermail/gettext-users-en/attachments/20060312/5d6b7089/attachment.vcf -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3206 bytes Desc: S/MIME Cryptographic Signature Url : http://rubyforge.org/pipermail/gettext-users-en/attachments/20060312/5d6b7089/attachment.bin From mutoh at highway.ne.jp Sun Mar 12 09:49:32 2006 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Sun, 12 Mar 2006 23:49:32 +0900 Subject: [gettext-u-en] ruby on rails & language/locale override even worse problem In-Reply-To: <441301A7.4010308@synergetek.be> References: <1141294172.30490.44.camel@erkki> <441301A7.4010308@synergetek.be> Message-ID: <20060312234932.2fb9f2be.mutoh@highway.ne.jp> Hi, On Sat, 11 Mar 2006 17:58:15 +0100 Donald Piret wrote: > Actually I'm having an even worse problem, the initially suggested method > > require 'gettext/rails' > > class ApplicationController < ActionController::Base > GetText.locale = "fr_FR" > init_gettext "blog" > end > > does not seem to be working anymore at all for me, overriding the language by using the lang request variable > (ex as in http://localhost:3001/products?lang=en) works fine. But setting it in the application controller just doesn't seem to work anymore (while it seemed to work after the suggestion was given) > > Hope anyone can say what's going on, > Thanks a lot in advance, Oops, it's a new bug of Ruby-GetText. Could you try this patch ? Index: lib/gettext.rb =================================================================== RCS file: /var/cvs/gettext/gettext/lib/gettext.rb,v retrieving revision 1.10 diff -u -r1.10 gettext.rb --- lib/gettext.rb 3 Mar 2006 09:22:03 -0000 1.10 +++ lib/gettext.rb 12 Mar 2006 14:35:36 -0000 @@ -199,7 +199,8 @@ else ret = nil end - Locale.set_current(ret) + Locale.clear + Locale.set(ret) textdomain = @@__textdomain[src] textdomain.set_locale(ret, true) if textdomain ------- Or, Locale.set("fr_FR") may be a workarround. Please try it. -- .:% Masao Mutoh