Forum: Rails I18n Globalize mailing list: experiences article by Sven Fuchs

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Martin Bernd S. (Guest)
on 2006-06-09 12:38
Since not everyone might be subscriped to the Globalize list and I still
don't know if there's an archive:

Sven F. wrote an article about his experiences setting up / using
Globalize

-- begin --

After having got totally thrilled about Globalize I've written down this
report about my first experiences:
http://www.artweb-design.de/articles/2006/06/09/re...

I'm probably going to expand that by a follow up once I've collected
some more insights.

Appreciate any feedback/review/criticism of course.

Also, do you think this could/should be linked to from the Globalize
wiki? I've had read both of the "example" and "howto" pages over there,
but being a Rails newbie I found them a bit sparse (?) (no offense!
That's just been my own dump noob perpective :)

Thanks in advance!

Oh, btw ... did I mention that I'm totally thrilled about Globalize?
Keep up that great work. I love it :)

-- end --

to which Josh Harvey replied

-- begin --

Thanks a million, Sven! Your writeup is great, and exactly the kind of
thing Globalize needs. Please do link it in a prominent place in the
wiki. Maybe we should add a "docs" or "writeups" page; I'll look into
that.

A few comments:

The preferred way to setup a Globalize app now is with Jeremy Voorhis's
"rake globalize:setup". So, instead of "script/generate globalize tiny"
and "rake migrate", just do "rake globalize:setup".
You can see all the rake tasks by doing "rake -T" in your app's home
directory.

You also don't have to hardcode all the translations for your code. If
Globalize sees a word that hasn't been translated yet, it will write a
NULL record to the database. You can then write a rails controller which
will look for all NULL records and let your translate them.

You may want to change the section where you mention <%=
@article.title.t -%>. As you mentioned later, the preferred way of doing
this is with the "translates" directive in the ActiveRecord model, and
<%= @article.title %> in the view. Behind the scenes, Globalize treats
this very differently, it's not just a matter of leaving off the .t, so
<%= @article.title.t %> might give new users the wrong idea.

Of course, you would have know all this if there had already been a good
writeup like yours available :)

-- end --

and Sven answered

-- begin --

Thanks, Joshua, for the friendly words :) and comments!

I'll go and update my post asap of course. At the very least I need to
mount up some warning signs.

As for the NULL values ... *LOL*. I can't believe that I've actually
noticed these rows, wondered about what strange kind of stuff's
happening and later on even manually inserted extra copies of these with
my translations added. Ok, got it. *slaps head*

-- end --
Martin Bernd S. (Guest)
on 2006-06-13 13:54
Sven updated his article...

-- begin --

Hi Joshua, hi all,

ok, I've tried hard to correct the flaws in my first write-up, but I
felt that my actual experience and good recommendations to a newbie
really are two things that don't mix well. ;)

So I rewrote the whole thing:

http://www.artweb-design.de/articles/2006/06/13/re...

I hope I've managed to straighten the flaws out. Otherwise please
correct me again.

I think I'm pretty snow-blind meanwhile. I'd very much appreciate both
tips/reviews regarding the content as well as regarding my English and
phrasing!

I'd then link that article to the wiki. There's been some sudden
positive feedback. :)

Thanks in advance!

-- end --
This topic is locked and can not be replied to.