My favorites | Sign in
Project Logo
                
Search
for
Updated Apr 04, 2008 by dsimard
Install  
  1. Execute ./script/plugin install http://simplyglobal.googlecode.com/svn/trunk/simplyglobal
  2. Create a file named simplyglobal.rb in the config/initializers directory
  3. In simplyglobal.rb, create hashes of language
  4. # français
    fr = {
        "hi" => "bonjour",
        "welcome" => "bienvenue"  
    }
    
    # espanol
    es = {
        "hi" => "hola",
        "welcome" => "bienvenida"
    }
  5. Add the language hashes to the object
  6. SimplyGlobal.add_language_hash(:fr, fr)
    SimplyGlobal.add_language_hash(:es, es)

You will end up with a file named simplyglobal.rb that looks like this :

# français
fr = {
    "hi" => "bonjour",
    "welcome" => "bienvenue"  
}

# espanol
es = {
    "hi" => "hola",
    "welcome" => "bienvenida"
}

SimplyGlobal.add_language_hash(:fr, fr)
SimplyGlobal.add_language_hash(:es, es)

In development, this file will be loaded every request. In production, it is loaded once.


Sign in to add a comment
Hosted by Google Code