# How to render language dependent .rhtml templates?

**URL:** <https://www.ruby-forum.com/t/how-to-render-language-dependent-rhtml-templates/89337>\
**Category:** Rails\
**Created:** [March 19, 2007, 5:41pm UTC](https://www.ruby-forum.com/t/how-to-render-language-dependent-rhtml-templates/89337 "2007-03-19T17:41:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [March 19, 2007, 5:41pm UTC](https://www.ruby-forum.com/t/how-to-render-language-dependent-rhtml-templates/89337/1 "2007-03-19T17:41:26Z")

</div>

I want to localize my website, and do so with minimal server load  
increase. Most of the texts comes from .rhtml templates, so I figure,  
if the application rendered .rhtml pages per language, it would be  
more efficient than going through a database / gettext calls for every  
sentence.

Any idea on how I can do that on a global site basis?

Of course, dynamically generated text will have to go through gettext  
or other string replacement system.

Thanks,  
Amir

---

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [March 19, 2007, 5:56pm UTC](https://www.ruby-forum.com/t/how-to-render-language-dependent-rhtml-templates/89337/2 "2007-03-19T17:56:01Z")

</div>

helzer wrote:

> I want to localize my website, and do so with minimal server load  
> increase. Most of the texts comes from .rhtml templates, so I figure,  
> if the application rendered .rhtml pages per language, it would be  
> more efficient than going through a database / gettext calls for every  
> sentence.
> 
> Any idea on how I can do that on a global site basis?
> 
> Of course, dynamically generated text will have to go through gettext  
> or other string replacement system.
> 
> Thanks,  
> Amir

ilans-mac:~ ilan$ gem list -r | grep localization  
localization\_generator (1.0.8, 1.0.7, 1.0.6, 1.0.5, 1.0.4, 1.0.3, 1.0.2,  
1.0.1, 1.0.0)  
Ruby application internationalization and localization library  
ilans-mac:~ ilan$

---

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [March 19, 2007, 8:58pm UTC](https://www.ruby-forum.com/t/how-to-render-language-dependent-rhtml-templates/89337/3 "2007-03-19T20:58:35Z")

</div>

On 3/19/07, helzer [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I want to localize my website, and do so with minimal server load  
> increase. Most of the texts comes from .rhtml templates, so I figure,  
> if the application rendered .rhtml pages per language, it would be  
> more efficient than going through a database / gettext calls for every  
> sentence.

See  
[http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html#Localized+templates+for+Views%2FActionMailer](http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html#Localized+templates+for+Views%2FActionMailer).

Isak

---

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [March 19, 2007, 10:34pm UTC](https://www.ruby-forum.com/t/how-to-render-language-dependent-rhtml-templates/89337/4 "2007-03-19T22:34:29Z")

</div>

Hi Isak,

That’s called hitting the nail on the head! Exactly what I was looking  
for.

Thanks,  
Amir
