# Multi-Lingual Radiant

**URL:** <https://www.ruby-forum.com/t/multi-lingual-radiant/102406>\
**Category:** Radiant CMS\
**Created:** [August 15, 2006, 2:16pm UTC](https://www.ruby-forum.com/t/multi-lingual-radiant/102406 "2006-08-15T14:16:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 15, 2006, 2:16pm UTC](https://www.ruby-forum.com/t/multi-lingual-radiant/102406/1 "2006-08-15T14:16:50Z")

</div>

Good day Radiant people 🙂

After several years of building multi-lingual sites as basically  
parallel static web pages, I’ve decided to try to automate some of  
the Repeating Yourself that inevitably happens.

I’m experimenting with Radiant to implement this functionality and  
would love to get some input from the community as to the best way to  
make this happen!

So, ideally, I “simply” want to prefix my URI with a language code,  
e.g.:

[http://mysite.com/en/](http://mysite.com/en/)  
[http://mysite.com/es/](http://mysite.com/es/)

…and have the localized version of a page served in response.

The meat of my idea is to implement a naming convention for Page  
Parts, Layouts, & Snippets to indicate localization, such as:

- body.en & body.es
- HTML Normal.en & HTML Normal.es
- sidebar.en & sidebar.es

Most ideal would be to implement this as a Radiant Behavior plugin,  
but behaviors are exclusive-per-page; to make a whole Radiant site  
use a multi-lingual behavior, I would be unable to use any other  
behaviors. My early experimentation also indicates that plugins load  
too early to allow redefinition of controller methods. So, it seems  
that I will have to fork from Radiant’s current source to modify:

- routes.rb to support language prefix of URI

- SiteController to implement a @language instance variable

- Behavior::Base

- Page #part to select based on the chosen language

Has anyone else done something like this? Any ideas are appreciated!

Cheers,  
\*Mars

( \<\> … \<\> )
