From vaughan at cyberdude.com Thu May 1 13:57:05 2008 From: vaughan at cyberdude.com (Vaughan Jackson) Date: Thu, 1 May 2008 19:57:05 +0200 Subject: [Rails I18n] Problems using Gettext 1.90.0 update_pofiles In-Reply-To: References: Message-ID: Hi Max? Yes, that's it! I just need to ignore the error messages generated by the rake updatepo step and create the .po files by hand as you say. Thanks for your help, Vaughan. -- Posted via http://www.ruby-forum.com/. From boblgum at nnms.de Fri May 2 08:31:40 2008 From: boblgum at nnms.de (Vitali Danilow) Date: Fri, 2 May 2008 14:31:40 +0200 Subject: [Rails I18n] GetText on Struct Message-ID: <1908a377ec9e6aae4b700d75e588ce06@ruby-forum.com> hi @ll is it possible to mark whole struct for translation? something like: MyStrct = Struct.new(:code, :msg) SOME_CONSTANT = N_(MyStrct.new("1515", "Message to translate")) ... puts _(SOME_CONSTANT) may be u have a better sollution for this? thnx -- Posted via http://www.ruby-forum.com/. From wpdavenport at gmail.com Fri May 2 12:41:25 2008 From: wpdavenport at gmail.com (Bill Davenport) Date: Fri, 2 May 2008 18:41:25 +0200 Subject: [Rails I18n] Gloc bug? In-Reply-To: <4af7da08cfb8ba0470bc0ee3a563ad8c@ruby-forum.com> References: <4af7da08cfb8ba0470bc0ee3a563ad8c@ruby-forum.com> Message-ID: <249fc948a80e67d1ff8784c6bf3c74e2@ruby-forum.com> > > The error occures when environment.rb is executing this: > > GLoc.set_config :default_language => :nl > GLoc.clear_strings_except :fr, :nl > GLoc.set_kcode > GLoc.load_localized_strings > GLoc.set_config :default_language => :es GLoc.clear_strings_except :en, :es GLoc.set_kcode GLoc.load_localized_strings I am using Rails 2.0.2 and put the initialization in environment.rb. I get an error: /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require': /Users/billdavenport/Projects/gloc/config/environment.rb:13: syntax error, unexpected tCONSTANT, expecting ')' (SyntaxError) GLoc.set_config :default_language => :es Not sure what's going on. I have the block outside of my Initializer.run -- Posted via http://www.ruby-forum.com/. From vriffier at adisem.com Fri May 2 12:56:25 2008 From: vriffier at adisem.com (V. Vincesf) Date: Fri, 2 May 2008 18:56:25 +0200 Subject: [Rails I18n] Gloc bug? In-Reply-To: <249fc948a80e67d1ff8784c6bf3c74e2@ruby-forum.com> References: <4af7da08cfb8ba0470bc0ee3a563ad8c@ruby-forum.com> <249fc948a80e67d1ff8784c6bf3c74e2@ruby-forum.com> Message-ID: Do you have the following in your RAILS_ROOT/vendor/plugins/gloc/init.rb require 'gloc' require 'gloc-ruby' require 'gloc-rails' require 'gloc-rails-text' Bill Davenport wrote: >> >> The error occures when environment.rb is executing this: >> >> GLoc.set_config :default_language => :nl >> GLoc.clear_strings_except :fr, :nl >> GLoc.set_kcode >> GLoc.load_localized_strings >> > > GLoc.set_config :default_language => :es > GLoc.clear_strings_except :en, :es > GLoc.set_kcode > GLoc.load_localized_strings > > I am using Rails 2.0.2 and put the initialization in environment.rb. I > get an error: > > /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in > `gem_original_require': > /Users/billdavenport/Projects/gloc/config/environment.rb:13: syntax > error, unexpected tCONSTANT, expecting ')' (SyntaxError) > GLoc.set_config :default_language => :es > > Not sure what's going on. I have the block outside of my > Initializer.run -- Posted via http://www.ruby-forum.com/. From wpdavenport at gmail.com Fri May 2 14:02:54 2008 From: wpdavenport at gmail.com (Bill Davenport) Date: Fri, 2 May 2008 20:02:54 +0200 Subject: [Rails I18n] Gloc bug? In-Reply-To: References: <4af7da08cfb8ba0470bc0ee3a563ad8c@ruby-forum.com> <249fc948a80e67d1ff8784c6bf3c74e2@ruby-forum.com> Message-ID: <2867bc29af4ba51832d2772bb34ad32c@ruby-forum.com> I have this in my /vendor/plugins/gloc/init.rb # Copyright (c) 2005-2007 David Barri require 'gloc' require 'gloc-ruby' require 'gloc-rails' require 'gloc-rails-text' require 'gloc-dev' if ENV['RAILS_ENV'] == 'development' GLoc.set_language_mode :simple GLoc.load_gloc_default_localized_strings V. Vincesf wrote: > Do you have the following in your > RAILS_ROOT/vendor/plugins/gloc/init.rb > require 'gloc' > require 'gloc-ruby' > require 'gloc-rails' > require 'gloc-rails-text' > > -- Posted via http://www.ruby-forum.com/. From wpdavenport at gmail.com Fri May 2 15:21:50 2008 From: wpdavenport at gmail.com (Bill Davenport) Date: Fri, 2 May 2008 21:21:50 +0200 Subject: [Rails I18n] Gloc bug? In-Reply-To: References: <4af7da08cfb8ba0470bc0ee3a563ad8c@ruby-forum.com> <249fc948a80e67d1ff8784c6bf3c74e2@ruby-forum.com> Message-ID: Seems that I had deleted a ) in my environment.rb file. However, a new error has cropped up when I do a script/server. /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:266:in `load_missing_constant': uninitialized constant GLoc (NameError) bill V. Vincesf wrote: > Do you have the following in your > RAILS_ROOT/vendor/plugins/gloc/init.rb > require 'gloc' > require 'gloc-ruby' > require 'gloc-rails' > require 'gloc-rails-text' > > -- Posted via http://www.ruby-forum.com/. From z4n9ief at gmail.com Mon May 26 17:13:40 2008 From: z4n9ief at gmail.com (Zangief Ief) Date: Mon, 26 May 2008 23:13:40 +0200 Subject: [Rails I18n] Globalize and render_component: infinite loop? In-Reply-To: References: <20e62f8f05943b4fec10caade1f772aa@ruby-forum.com> Message-ID: Franco Sellitto wrote: > I found the problem. > > It was something else in the application.rb. > > Actually the > > map.connect ':locale/:controller/:action/:id' > > works very well. > > Bye > > PS: If you're in the same problem, I'll explain you how to prevent the > loop. Hi, I have the same problem with render_component. Initialy, I jsut need to ad on the right side a list of tag for a weblog. So I would like to display a list of tag on every webpage (using the controller 'tag' and the action 'listing'), even if the main controller of the current page is not 'tag'. I don't know if I can use a other way then render_component to do so, but when I use it, I get a infinite loop... such as: Processing CategoriesController#listing (for 127.0.0.1 at 2008-05-26 21:45:16) [GET] Session ID: BAh7CDoMY3NyZl9pZCIlMTU2MDg2ZmUzZGIzOGRlM2VjZDViMTZhMWI2MDA0%0AZmIiCmFkbWluVCIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6%0AOkZsYXNoSGFzaHsABjoKQHVzZWR7AA%3D%3D--f08000449ccdeecc8ecd1e5c67f49baad76ebbcc Parameters: {"action"=>"listing", "id"=>nil, "controller"=>"categories"} Category Load (0.000652) SELECT * FROM `categories` Rendering template within layouts/application Rendering categories/listing Category Columns (0.002227) SHOW FIELDS FROM `categories` Start rendering component ({:controller=>"categories", :layout=>nil, :action=>"listing"}): Processing CategoriesController#listing (for 127.0.0.1 at 2008-05-26 21:45:16) [GET] Session ID: BAh7CDoMY3NyZl9pZCIlMTU2MDg2ZmUzZGIzOGRlM2VjZDViMTZhMWI2MDA0%0AZmIiCmFkbWluVCIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6%0AOkZsYXNoSGFzaHsABjoKQHVzZWR7AA%3D%3D--f08000449ccdeecc8ecd1e5c67f49baad76ebbcc Parameters: {"action"=>"listing", "id"=>nil, "controller"=>"categories"} CACHE (0.000000) SELECT * FROM `categories` Rendering template within layouts/application Rendering categories/listing Start rendering component ({:controller=>"categories", :layout=>nil, :action=>"listing"}): Processing CategoriesController#listing (for 127.0.0.1 at 2008-05-26 21:45:16) [GET] Session ID: BAh7CDoMY3NyZl9pZCIlMTU2MDg2ZmUzZGIzOGRlM2VjZDViMTZhMWI2MDA0%0AZmIiCmFkbWluVCIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6%0AOkZsYXNoSGFzaHsABjoKQHVzZWR7AA%3D%3D--f08000449ccdeecc8ecd1e5c67f49baad76ebbcc Parameters: {"action"=>"listing", "id"=>nil, "controller"=>"categories"} CACHE (0.000000) SELECT * FROM `categories` Rendering template within layouts/application Rendering categories/listing Start rendering component ({:controller=>"categories", :layout=>nil, :action=>"listing"}): Thanks for any help. -- Posted via http://www.ruby-forum.com/. From emeratius at gmail.com Wed May 28 05:32:18 2008 From: emeratius at gmail.com (Fredrik [:all]) Date: Wed, 28 May 2008 11:32:18 +0200 Subject: [Rails I18n] URL and params with %E4 Message-ID: I got an url I like http://localhost:3000/article?text?n%E4sta When I read the parameter params[:text] I only get n?a. It deletes the two characters after %E4. In my log i can see the parameter: Parameters: {"text"=>"n?sta".... The length of chars is only 3 params[:text].chars().length The length of the parameter is 4 params[:text].length The Chars is: params[:sms].length.times CHAR[n=0](110)=n CHAR[n=1](195)=? CHAR[n=2](164)=? CHAR[n=3](97)=a The chars for chars(): params[:sms].chars().length.times CHAR[n=0](110)=n CHAR[n=1](195)=? CHAR[n=2](164)=? Any suggestions how I should solve this? -- Posted via http://www.ruby-forum.com/. From z4n9ief at gmail.com Fri May 30 18:15:31 2008 From: z4n9ief at gmail.com (Zangief Ief) Date: Sat, 31 May 2008 00:15:31 +0200 Subject: [Rails I18n] About map.inflected_resource Message-ID: Hi, In the routes.rb Typo file (readable at: http://svn.typosphere.org/typo/branches/rails2/config/routes.rb) we can see those line: map.inflected_resource(:authors, :path_prefix => '/articles') map.inflected_resource(:categories, :path_prefix => '/articles') map.inflected_resource(:tags, :path_prefix => '/articles') Do you know the goal of them? Thanks -- Posted via http://www.ruby-forum.com/.