Could you release the url translation plugin ? It could be good start
to look at.

++

yk

2008/9/16 Kwi <[EMAIL PROTECTED]>:
>
> Hi people,
>
> I am the Sven's secret mailer.
> So I developed a personal globalize plugin in order to translate
> named_routes and resources few months ago (This plugin do not set the
> locale automatically, it's just focus on url translation).
>
> I don't really like the way I did it, but It was my best idea at the
> time (feel free to make some better suggestions)
>
> First of all, you have to declare in your routes.rb wich route you
> want to translate with the options :globalized, for example with the
> map.with_options :
>
>  map.with_options :globalized => true do |m|
>    #build content routes
>    %w(how_to about help legal_notice partners privacy changelog).each
> do |r|
>      m.send(r.to_sym, r, {:controller => 'contents', :action => r})
>    end
>
>    m.resources :registration
>    m.resources :users
>  end
>
> Then i wrote a bunch of code that override methods : resource,
> resources and add_named_route.
> I modified the treatment in order to not just create the routes
> specified, but to create routes for each languages supported, for
> example :
>
>  map.resources :users will create routes : users, users_fr, users_en,
> users_es, and so on... with a path translated by calling users.t()
>
> Then i override the method define_url_helper wich is used internally
> by rails routing to create helper for routes, and when you will call
> users_path, the localized helper will be called, so if the french
> locale is set, users_path will return the result of users_fr_path.
>
> All of this is really tricky and make your "$>rake routes" ugly, but
> that's working fine.
>
>
> So that's all for the url translation plugin, I also developed a full
> ajaxed and ergonomic interface for translating a website in an easy
> way (with a "lazby boy" feature : auto translation help coming from
> google translator). It's just composed of a css, a controller, views
> and a model. If people are interested I can release that too.
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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