Hello all, I''m trying to translate my application using the I18N feature and it was working fine until I added a couple of new entries to the en.yml files. Now in every action in my application I always get the following error: TypeError in Account#login Showing app/views/account/login.rhtml where line #2 raised: allocator undefined for Proc Extracted source (around line #2): 1: 2: <% @title = I18n.t (''text.login'') %> 3: <div id="mainheader"> 4: <h2><%= I18n.t (''text.login'') %></h2> 5: </div> Stack trace: C:/Dev/Rails/ruby/lib/ruby/1.8/yaml.rb:133:in `transfer'' C:/Dev/Rails/ruby/lib/ruby/1.8/yaml.rb:133:in `node_import'' C:/Dev/Rails/ruby/lib/ruby/1.8/yaml.rb:133:in `load'' C:/Dev/Rails/ruby/lib/ruby/1.8/yaml.rb:133:in `load'' C:/Dev/Rails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:189:in `load_yml'' C:/Dev/Rails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:176:in `send'' C:/Dev/Rails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:176:in `load_file'' C:/Dev/Rails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:13:in `load_translations'' C:/Dev/Rails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:13:in `each'' C:/Dev/Rails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:13:in `load_translations'' C:/Dev/Rails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:85:in `init_translations'' Can anyone help me? Best regards, Migrate -- Posted via http://www.ruby-forum.com/.
On 24 Jun 2009, at 19:18, Hu Ma wrote:> > Hello all, > > I''m trying to translate my application using the I18N feature and it > was > working fine until I added a couple of new entries to the en.yml > files. > Now in every action in my application I always get the following > error: >sounds like there''s something funny in your yml file. Fred> TypeError in Account#login > Showing app/views/account/login.rhtml where line #2 raised: > allocator undefined for Proc > Extracted source (around line #2): > 1: > 2: <% @title = I18n.t (''text.login'') %> > 3: <div id="mainheader"> > 4: <h2><%= I18n.t (''text.login'') %></h2> > 5: </div> > > Stack trace: > > C:/Dev/Rails/ruby/lib/ruby/1.8/yaml.rb:133:in `transfer'' > C:/Dev/Rails/ruby/lib/ruby/1.8/yaml.rb:133:in `node_import'' > C:/Dev/Rails/ruby/lib/ruby/1.8/yaml.rb:133:in `load'' > C:/Dev/Rails/ruby/lib/ruby/1.8/yaml.rb:133:in `load'' > C:/Dev/Rails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ > active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:189:in > `load_yml'' > C:/Dev/Rails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ > active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:176:in > `send'' > C:/Dev/Rails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ > active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:176:in > `load_file'' > C:/Dev/Rails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ > active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:13:in > `load_translations'' > C:/Dev/Rails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ > active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:13:in > `each'' > C:/Dev/Rails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ > active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:13:in > `load_translations'' > C:/Dev/Rails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ > active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:85:in > `init_translations'' > > Can anyone help me? > > Best regards, > Migrate > -- > Posted via http://www.ruby-forum.com/. > > >
Hello Fred, Sorry, beginner question: How can I check what wrong with the file? Note: I''m not editing the files directly, I''m using translator plugin (http://github.com/newsdesk/translate/tree/master) to do this so I don''t know exactly where to look. Thanks. Best regards, Migrate -- Posted via http://www.ruby-forum.com/.
Hello all, I''ve found the problem. Don''t know why but the plugin add two entries similar to the following to the yml file: long_ordinal: !ruby/object:Proc {} Best regards, Migrate -- Posted via http://www.ruby-forum.com/.