Hi,

You should use I18n.localize or I18n.l the alias:

So you can do something like l(Time.now) or l(Time.now, :format
=> :short)

Hope this helps,
Warm regards,
--
  Sebastien Grosjean - ZenCocoon

On 11 jan, 18:14, Erwin <[email protected]> wrote:
> If I need to get the localized default date string ""%d/%m/
> %Y""  (default..) from my locales  yml files, how do get it ?
>
> fr:
>   date:
>     formats:
>       default: "%d/%m/%Y"
>       short: "%e %b"
>       long: "%e %B %Y"
>       long_ordinal: "%e %B %Y"
>       only_day: "%e"
> ..
>
> I cannot write  fmt = I18n.t("date.formats.default") I get an error
> I18n::MissingInterpolationArgument: interpolation argument count
> missing in "{{count}}/%m/%Y"
>
> but if I write : I18n.t("date.formats.long")  ehnt I get a string
> => "%e %B %Y
>
> why ? is it because of the 'slash' in the string.... ??
> I can I add another .. standard: "%d/%m/%Y"  and get it..
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"rails-i18n" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rails-i18n?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to