# How to architect a global application \[in Rails\]

**URL:** <https://www.ruby-forum.com/t/how-to-architect-a-global-application-in-rails/119887>\
**Category:** Rails\
**Created:** [November 11, 2007, 11:38pm UTC](https://www.ruby-forum.com/t/how-to-architect-a-global-application-in-rails/119887 "2007-11-11T23:38:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhfs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b2d939/32.png) [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Post date:** [November 11, 2007, 11:38pm UTC](https://www.ruby-forum.com/t/how-to-architect-a-global-application-in-rails/119887/1 "2007-11-11T23:38:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mhfs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b2d939/32.png) [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Post date:** [November 13, 2007, 11:58am UTC](https://www.ruby-forum.com/t/how-to-architect-a-global-application-in-rails/119887/2 "2007-11-13T11:58:00Z")

</div>

No ideas?

---

<div class="post-metadata">

**Author:** ![mhfs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b2d939/32.png) [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Post date:** [November 13, 2007, 5:55pm UTC](https://www.ruby-forum.com/t/how-to-architect-a-global-application-in-rails/119887/3 "2007-11-13T17:55:26Z")

</div>

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 S.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![mhfs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b2d939/32.png) [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Post date:** [November 13, 2007, 5:57pm UTC](https://www.ruby-forum.com/t/how-to-architect-a-global-application-in-rails/119887/4 "2007-11-13T17:57:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mhfs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b2d939/32.png) [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Post date:** [November 13, 2007, 6:32pm UTC](https://www.ruby-forum.com/t/how-to-architect-a-global-application-in-rails/119887/5 "2007-11-13T18:32:55Z")

</div>

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
