Thanks but that's not my goal..

I wanted to get the format string "%d %m %Y" , to reuse it with some
js..

it's possible , using  I18n.t, but not for a string including  %d...
in this case I18n assumes you want to localize your date....
so using %e is fine...

On Jan 11, 8:03 pm, Sébastien Grosjean - ZenCocoon
<[email protected]> wrote:
> 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