Marcelo de Moraes Serpa
2007-Nov-11 22:37 UTC
How to architect a global application [in Rails]
Hello list, I''m building an application that will soon probably be translated and localized for different languages and cultures (countries). And here lies the issue. I''m not sure how to architect the application so that it is easy to add a new country and localized content and also routes. I know I could use Globalize and it seems to be an awesome plugin, but I don''t know how to fit things together such as when the application eventually gets to other boundaries it will be easy to add and admin the new localized content - maybe new application instance(s)? Thanks in advance, Marcelo. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Marcelo de Moraes Serpa
2007-Nov-13 10:57 UTC
Re: How to architect a global application [in Rails]
No ideas? On Nov 11, 2007 8:37 PM, Marcelo de Moraes Serpa <celoserpa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello list, > > I''m building an application that will soon probably be translated and > localized for different languages and cultures (countries). And here > lies the issue. I''m not sure how to architect the application so that > it is easy to add a new country and localized content and also routes. > I know I could use Globalize and it seems to be an awesome plugin, but > I don''t know how to fit things together such as when the application > eventually gets to other boundaries it will be easy to add and admin > the new localized content - maybe new application instance(s)? > > Thanks in advance, > > Marcelo. >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''ve never had to do this in rails ... one thing though. I think, because of Ruby''s dynamic nature, you could easily capture all the places where messages are being generated without having to litter your code with lookups. A friend of mine recently came up with something where he used the English message as an index into the translation table. If you can come up with a way of doing this then you can easily identify messages that haven''t been translated and display the English message as a default, while creating an admin screen for the messages that haven''t been translated into a given language. This gets around all the usual stuff about having to have message ID''s and lookups everywhere, but is a little messier. Views are more difficult. I think you may have to override the render method to pick up the translated page if it is there. I''ve not looked at the plugin but if I were starting from scratch that''s where I''d start. HTH On Nov 13, 10:57 am, "Marcelo de Moraes Serpa" <celose...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> No ideas? > > On Nov 11, 2007 8:37 PM, Marcelo de Moraes Serpa <celose...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hello list, > > > I''m building an application that will soon probably be translated and > > localized for different languages and cultures (countries). And here > > lies the issue. I''m not sure how to architect the application so that > > it is easy to add a new country and localized content and also routes. > > I know I could use Globalize and it seems to be an awesome plugin, but > > I don''t know how to fit things together such as when the application > > eventually gets to other boundaries it will be easy to add and admin > > the new localized content - maybe new application instance(s)? > > > Thanks in advance, > > > Marcelo.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> Views are more difficult. I think you may have to override the render > method to pick up the translated page if it is there.D''oh - just use named partials ... On Nov 13, 4:47 pm, ghoti <francis.f...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve never had to do this in rails ... one thing though. I think, > because of Ruby''s dynamic nature, you could easily capture all the > places where messages are being generated without having to litter > your code with lookups. > > A friend of mine recently came up with something where he used the > English message as an index into the translation table. If you can > come up with a way of doing this then you can easily identify messages > that haven''t been translated and display the English message as a > default, while creating an admin screen for the messages that haven''t > been translated into a given language. This gets around all the usual > stuff about having to have message ID''s and lookups everywhere, but is > a little messier. > > Views are more difficult. I think you may have to override the render > method to pick up the translated page if it is there. > > I''ve not looked at the plugin but if I were starting from scratch > that''s where I''d start. > > HTH > > On Nov 13, 10:57 am, "Marcelo de Moraes Serpa" <celose...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > No ideas? > > > On Nov 11, 2007 8:37 PM, Marcelo de Moraes Serpa <celose...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hello list, > > > > I''m building an application that will soon probably be translated and > > > localized for different languages and cultures (countries). And here > > > lies the issue. I''m not sure how to architect the application so that > > > it is easy to add a new country and localized content and also routes. > > > I know I could use Globalize and it seems to be an awesome plugin, but > > > I don''t know how to fit things together such as when the application > > > eventually gets to other boundaries it will be easy to add and admin > > > the new localized content - maybe new application instance(s)? > > > > Thanks in advance, > > > > Marcelo.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i ahve not played with i18n packages other than globalize, but have found that package to be quite good. i would definitely take a close look at it before trying to reinvent what it does. it really could save you a *lot* of times. cheers, daniel Marcelo de Moraes Serpa wrote:> Hello list, > > I''m building an application that will soon probably be translated and > localized for different languages and cultures (countries). And here > lies the issue. I''m not sure how to architect the application so that > it is easy to add a new country and localized content and also routes. > I know I could use Globalize and it seems to be an awesome plugin, but > I don''t know how to fit things together such as when the application > eventually gets to other boundaries it will be easy to add and admin > the new localized content - maybe new application instance(s)? > > Thanks in advance, > > Marcelo.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---