Hello, does any one know why: <%= I18n.l Time.now %> returns an empty string? But it works when I run it on the console: I18n.l Time.now => "Mon, 29 Mar 2010 18:38:32 +0100" I can''t think of anything that could cause that problem and Google didn''t help... any help would be highly appreciated! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No one? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, Mar 29, 2010 at 9:41 AM, Heinz Strunk <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> does any one know why: > <%= I18n.l Time.now %> > returns an empty string?Nope, it works as expected for me on Rails 2.3.5 + ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0] Can you create a reproducible test case? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
How could a test case help me? Output of the console shows already that there''s something messed up:>> I18n.localeI18n.locale => "DE-de">> I18n.l(Time.now, :formats => :default)I18n.l(Time.now, :formats => :default) => "Sun, 04 Apr 2010 12:49:37 +0100">> I18n.l(Time.now, :formats => :short)I18n.l(Time.now, :formats => :short) => "Sun, 04 Apr 2010 12:52:23 +0100">> I18n.l(Date.today, :formats => :default)I18n.l(Date.today, :formats => :default) => "2010-04-04">> I18n.l(Date.today, :formats => :long)I18n.l(Date.today, :formats => :long) => "2010-04-04" Locale is "DE-de" which is German but Time and Date is still being displayed in the English format. Furtermore it doesn''t make a difference if I change the formats argument which is not how it''s meant to be as well. There musst be really something screwed up but I have no idea what that could be.... really frustrating. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
By the way: It doesn''t matter if I use Ruby 1.8.6 or 1.9.1. In the posting above I''m using 1.8.6 and this is 1.9.1: Loading development environment (Rails 2.3.5) D:/ruby19/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement>> I18n.localeI18n.locale => :"en-US">> I18n.l Time.nowI18n.l Time.now => "Sun, 04 Apr 2010 12:55:11 +0100">> I18n.locale = "de-DE"I18n.locale = "de-DE" => "de-DE">> I18n.l Time.nowI18n.l Time.now => "Sun, 04 Apr 2010 12:55:23 +0100">>-- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sun, Apr 4, 2010 at 3:54 AM, Heinz Strunk <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> How could a test case help me? Output of the console shows already that > there''s something messed up:Again, for you -- not for me. So reducing the problem to the smallest possible test case that other people can try is one way to get help. In creating that test case you may discover the cause (some plugin or gem conflict, or who knows what). FWIW, -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
But what exactly would you want to test in that test case? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sun, Apr 4, 2010 at 8:45 AM, Heinz Strunk <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> But what exactly would you want to test in that test case?By "test case" here I mean the smallest possible application that reproduces the "empty string" error you''re describing. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Well, I created a new application - no plugins or anything and it worked. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
By the way I''m using globalize2 for model translation. Could that be the problem? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, Apr 5, 2010 at 2:58 AM, Heinz Strunk <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> By the way I''m using globalize2 for model translation. Could that be the > problem?Presumably it could -- so add it to your new app and see :-) -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I figured out that there''s a problem with the .yml file. When I remove my yml file everything works just fine but when I add my .yml file with my customized language strings like: de-DE: time: formats: default: "%A, %e. %B %Y, %H:%M Uhr" It returns an empty string. I just can''t find anything wrong with that default: ? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Heinz Strunk wrote:> I figured out that there''s a problem with the .yml file. When I remove > my yml file everything works just fine but when I add my .yml file with > my customized language strings like: > de-DE: > time: > formats: > default: "%A, %e. %B %Y, %H:%M Uhr" > > It returns an empty string. I just can''t find anything wrong with that > default: ?Got it! I had an outdated yml file. %e isn''t supported anymore and therefore returns nothing. Just had to replace the %e with a %d. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.