Bug found wrt time formats locale in Simon's version of Clemen's app

0 views
Skip to first unread message

Ninh Bui

unread,
Sep 2, 2008, 5:57:20 PM9/2/08
to rails-i18n
Hi guys,

While writing a dutch locale based on the yml/.rb file of en-US the
demo site seems to break on the time format page. It seems the demo
app is unable to read the am/pm translation I've put in the yml file.
When written in the .rb file, the site doesn't break on that anymore.
The german locale seems to break on this as well as we've already
found out on http://i18n-demo.phusion.nl/pages/time_formats . If I had
the time, I'd fix this myself, but hopefully someone else is able to
fix this instead :-)

Cheers,
Ninh

iain

unread,
Sep 3, 2008, 2:23:11 PM9/3/08
to rails-i18n
Hi Ninh,

I can't reproduce it with normal rails code.

>> I18n.localize 7.hours.ago
=> "11:10 's ochtends"
>> I18n.localize 6.hours.ago
=> "12:10 's middags"


with this yaml file:


nl-NL:
date:
day_names: [zondag, maandag, dinsdag, woensdag, etc....]

time:
formats:
default: "%I:%M %p"
am: "'s ochtends"
pm: "'s middags"



When I'm looking at the setup page of the demo application, I see that
the am and pm keys are nested wrong. Is this text an accurate
reflection of the real code? In that case, you should just de-indent
am and pm and the time.datetime is wrong as well, as far as I know.
have a look at the locale files in your vendor/rails dir:

./vendor/rails/actionpack/lib/action_view/locale/en-US.yml
./vendor/rails/activerecord/lib/active_record/locale/en-US.yml
./vendor/rails/activesupport/lib/active_support/locale/en-US.yml



iain

On Sep 2, 11:57 pm, Ninh Bui <ninh....@gmail.com> wrote:
> Hi guys,
>
> While writing a dutch locale based on the yml/.rb file of en-US the
> demo site seems to break on the time format page. It seems the demo
> app is unable to read the am/pm translation I've put in the yml file.
> When written in the .rb file, the site doesn't break on that anymore.
> The german locale seems to break on this as well as we've already
> found out onhttp://i18n-demo.phusion.nl/pages/time_formats. If I had

Ninh Bui

unread,
Sep 3, 2008, 3:29:54 PM9/3/08
to rails-i18n
Hi Iain,

Thanks for your reply and yep, after taking a closer look last night I
came to the same conclusion that the demo file's yml wasn't properly
indented on the am/pm part. De-indenting it a level fixed it but by
the time I came to that conclusion, I already had no use for the yml
file anymore since I threw it out for an .rb file with a Hash instead.

Cheers,
Ninh

Clemens Kofler

unread,
Sep 4, 2008, 5:34:55 AM9/4/08
to rails-i18n
Hi Ninh,

sorry about your inconvenience. I already fixed this issue in the
current version of the demo - see this commit:
http://github.com/clemens/i18n_demo_app/commit/7ab85259a4df3e3020fe853aa0aed52ed7533bb3.

I'll see if I run into the Phusion guys today at RailsConf so I can
get them to update it accordingly.

Thanks,
- Clemens

Karel Minarik

unread,
Sep 4, 2008, 5:47:21 AM9/4/08
to rails-i18n
> (...) I already had no use for the yml
> file anymore since I threw it out for an .rb file with a Hash instead.

I guess this is just one more reason to prefer standard Ruby Hash over
YAML deeply-whitespace-sensitive-nested-structures...

Karel

Ninh Bui

unread,
Sep 4, 2008, 7:37:29 AM9/4/08
to rails-i18n
Agreed.

Also, it seems there was a little error in one of the link labels. On
the date format page: http://i18n-demo.phusion.nl/pages/date_formats .
As you can see, on the lowerright corner, you see a link to date
formats which should be time formats.

Please see: http://github.com/prototype/i18n_demo_app/commit/c000166751d0dc9b5853e4ab1c95fbfa68fe3ebf

Seems I'm almost done with this. If there isn't anything else I can
think of with regards to the dutch locale, I encourage you guys to
pull from my tree to add dutch locale to the demo app ^_^

Cheers,
Ninh

Ninh Bui

unread,
Sep 4, 2008, 7:08:54 AM9/4/08
to rails-i18n
Hi Clemens,

Well, you're talking to one of the phusion guys right now ;), and
unfortunately, we're not at Railsconf. We'll try to update it today
though.
I'm currently writing a dutch locale, all the strings are done, I'll
try to get the date/time formats done as well today. See:
http://github.com/prototype/i18n_demo_app/commit/91ab31a1699ff29c3c44e6d371f1fc82114019c6

Cheers,
Ninh

On Sep 4, 11:34 am, Clemens Kofler <clem...@railway.at> wrote:
> Hi Ninh,
>
> sorry about your inconvenience. I already fixed this issue in the
> current version of the demo - see this commit:http://github.com/clemens/i18n_demo_app/commit/7ab85259a4df3e3020fe85....
Reply all
Reply to author
Forward
0 new messages