Forum: Ruby on Rails Multilingual Rails Plugin Update

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.
jmharvey.9956003 (Guest)
on 2005-11-24 04:32
(Received via mailing list)
Here's a quick update on the Multilingual plugin.

First of all, thanks for all the kind words and helpful comments. I'm
glad to see that so many people are interested in this project.

After the initial release, it became apparent that there were a few
major glitches with the code, so I had to make some changes. There are
probably a few more rough spots ahead. Here's what I changed since
yesterday:

- Not overriding to_s and strftime anymore. I was warned about this,
and it really breaks too much stuff. Would have been cool, though. Now
Fixnum, Bignum, and Float have "localized" methods that return
locale-formatted versions. Time and Date also have "localized(format)"
methods that return localized versions of strftime.

- Now using CSV formatted rows to populate the tables, instead of
hardcoded inserts. This makes the migrate script totally
cross-platform. On the downside, it now takes about 60 seconds to do
the migrate on my computer. Maybe the CSV library is really slow?

I also have some thoughts about issues brought up in the mailing list.

- Some alternate table schemas were offered. I'm not that concerned
about this right now, because I think the most important part to nail
down now is the API interface. The implementation can certainly be
tweaked later.

That said, I still think my approach has a big advantage: it doesn't
require messing with tables during development. The other approaches
would require some kind of script to create or alter tables every time
a field or language was added or deleted. This could quickly turn into
a nightmare, especially if you're working with a production app on a
remote machine. If you're using sqlite, you might have to rebuild the
entire db. This also seems to contradict the Rails spirit.

The drawback of my solution may be performance, but that hasn't been
demonstrated. It uses joins on integer primary key columns, so the db
engines should do a good job with the queries. I'm not sure this will
be an issue. Another drawback cited was cleanliness of design. I think
that's debatable, too.

- Caching translations. Yes, I definitely plan to cache translations,
especially view translations, in the near future. At first there will
probably be an option to cache every translation in memory, once
loaded. Later we can explore more sophisticated approaches.

Finally, Josh Sierles was kind enough to host the project on his
server. We'll be moving the svn repository and RDocs there tomorrow,
and hopefully setup Collaboa and a wiki soon. I'll keep you posted.

Cheers,
Josh Harvey
hammed (Guest)
on 2005-11-24 05:36
(Received via mailing list)
>
> - Now using CSV formatted rows to populate the tables, instead of
> hardcoded inserts. This makes the migrate script totally
> cross-platform. On the downside, it now takes about 60 seconds to do
> the migrate on my computer. Maybe the CSV library is really slow?
>

Hi Joshua,

I came across this the other day. I haven't tried it but it may speed up
your csv processing:

http://raa.ruby-lang.org/project/fastercsv/

Hammed
morus.walter.ml (Guest)
on 2005-11-24 12:07
(Received via mailing list)
Hi Joshua,

Thanks for your work on making rails multlingual.
>
> - Now using CSV formatted rows to populate the tables, instead of
> hardcoded inserts. This makes the migrate script totally
> cross-platform. On the downside, it now takes about 60 seconds to do
> the migrate on my computer. Maybe the CSV library is really slow?
>
Hmm. Does not seem to work for me.
I created a new Rails (0.14.3) project, databases (postgresql) and tried
to install the plugin by
- script/plugin install
     https://OpenSVN.csie.org/multi_lingual_rails/multi...
  (worked fine)
- script/generate multilingual (created the migration)
and
- rake migrate
  failed with `rake aborted! uninitialized constant DATA'

Any help with this?

I'm using Rails 0.14.3, ruby 1.8.2 on Linux with postgres 8.1

Morus
eduardo.fernandez (Guest)
on 2005-11-24 14:00
(Received via mailing list)
Same here with OSX Tiger and latest Rails rc.

However I noticed that the tables were created in the database. It's
the data loading that fails.

On 11/24/05, Morus W. <removed_email_address@domain.invalid> wrote:
> Hi Joshua,
> I created a new Rails (0.14.3) project, databases (postgresql) and tried
> to install the plugin by
> - script/plugin install
>      https://OpenSVN.csie.org/multi_lingual_rails/multi...
>   (worked fine)
> - script/generate multilingual (created the migration)
> and
> - rake migrate
>   failed with `rake aborted! uninitialized constant DATA'



--
Eduardo Fernández Corrales
This topic is locked and can not be replied to.