<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.gitignore</filename>
    </added>
    <added>
      <filename>book-content/en/0-front-matter/0-foreword.markdown</filename>
    </added>
    <added>
      <filename>book-content/en/0-front-matter/1-preface.markdown</filename>
    </added>
    <added>
      <filename>book-content/en/0-front-matter/2-contributors.markdown</filename>
    </added>
    <added>
      <filename>book-content/en/1-introduction/1-ruby.markdown</filename>
    </added>
    <added>
      <filename>book-content/en/1-introduction/2-merb.markdown</filename>
    </added>
    <added>
      <filename>book-content/en/1-introduction/3-datamapper.markdown</filename>
    </added>
    <added>
      <filename>book-content/en/1-introduction/4-rspec.markdown</filename>
    </added>
    <added>
      <filename>book-content/en/toc.markdown</filename>
    </added>
    <added>
      <filename>book-content/fr/toc.markdown</filename>
    </added>
    <added>
      <filename>gems/cache/merb_babel-0.1.0.gem</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/LICENSE</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/README</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/Rakefile</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/TODO</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/lib/merb_babel.rb</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/lib/merb_babel/core_ext.rb</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/lib/merb_babel/m_i18n.rb</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/lib/merb_babel/m_l10n.rb</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/lib/merb_babel/m_locale.rb</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/lib/merb_babel/merbtasks.rb</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/spec/lang/en-UK.yml</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/spec/lang/en-US.yml</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/spec/lang/en.yml</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/spec/m_i18n_spec.rb</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/spec/m_l10n_spec.rb</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/spec/merb_babel_spec.rb</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/spec/other_lang_dir/fr.yml</filename>
    </added>
    <added>
      <filename>gems/gems/merb_babel-0.1.0/spec/spec_helper.rb</filename>
    </added>
    <added>
      <filename>gems/specifications/merb_babel-0.1.0.gemspec</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -16,11 +16,17 @@ A static HTML and a PDF version will soon be available online.
  * Modify, fix, add content
  * send me a pull request
 
-For the moment, the content of the book is located inside ./book-content/ and is organized by chapters and pages.
+For the moment, the content of the book is located inside ./book-content/ and is organized by languages, chapters and pages.
 
 Chapters and pages must be lowercase and start by a digit followed by a dash and the chapter/page title without spaces or any non ascii characters.
 
-All content files are markdown files and the merb app uses [maruku](http://maruku.rubyforge.org) to render the markdown files. Check the [supported syntax](http://maruku.rubyforge.org/markdown_syntax.html) or check ./book-content/1-introduction/1-ruby.markdown for a good example of how to use images, quotes and css selectors.
+All content files are markdown files and the merb app uses [maruku](http://maruku.rubyforge.org) to render the markdown files. Check the [supported syntax](http://maruku.rubyforge.org/markdown_syntax.html) or check ./book-content/en/1-introduction/1-ruby.markdown for a good example of how to use images, quotes and css selectors.
+
+The book supports multiple languages, each language needs to replicate the English folder structure with the same file names.
+
+If you are copying a page or chapter to your language folder and want to mark a section of your text as requiring translation, just add the to-translate class to the css selector of your content as shown below:
+
+		{: .to-translate}
 
 
 ## Legal</diff>
      <filename>README.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -1,2 +1,5 @@
 class Application &lt; Merb::Controller
+  
+  before :set_language
+  
 end
\ No newline at end of file</diff>
      <filename>app/controllers/application.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,11 @@
 class Pages &lt; Application
 
   def index
-    render
+    page_file = find_toc
+    raise NotFound unless page_file    
+    
+    text = File.open(page_file).read
+    render Maruku::new(text).to_html
   end
   
   def show
@@ -18,7 +22,11 @@ class Pages &lt; Application
   private
     # If no page name is being passed, the first page is being returned
     def find_page_file(chapter, page_name, format=&quot;markdown&quot;)
-      Dir[&quot;#{Merb.root}/book-content/*-#{chapter}/*-#{page_name||&quot;*&quot;}.#{format}&quot;].entries.first
+      Dir[&quot;#{Merb.root}/book-content/#{language}/*-#{chapter}/*-#{page_name||&quot;*&quot;}.#{format}&quot;].entries.first
+    end
+    
+    def find_toc(format=&quot;markdown&quot;)
+      Dir[&quot;#{Merb.root}/book-content/#{language}/toc.#{format}&quot;].entries.first
     end
   
 end</diff>
      <filename>app/controllers/pages.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,11 @@
 module Merb
   module GlobalHelpers
     # helpers defined here available to all views.  
+    
+    def same_url_but_in_english
+      named_route = params[:chapter] ? :page : :toc
+      url(named_route, :language =&gt; 'en', :chapter =&gt; params[:chapter], :page_name =&gt; params[:page_name])
+    end
+    
   end
 end</diff>
      <filename>app/helpers/global_helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
-&lt;div class=&quot;error&quot;&gt;we couldn't find the page you requested, you might want to check on the index&lt;/div&gt;
+&lt;div class=&quot;error&quot;&gt;The page you requested doesn't seem to exist&lt;/div&gt;
 
-&lt;%= link_to &quot;Table of Content&quot;, url(:toc) %&gt;
\ No newline at end of file
+&lt;% if language != 'en' -%&gt;
+	&lt;p&gt;You required a page with the language code &lt;strong&gt;&lt;%= language %&gt;&lt;/strong&gt;, it might not be available yet, click on the following link to see the requested page in English.&lt;/p&gt;
+	
+	&lt;p&gt;&lt;%= link_to &quot;Same page but in English&quot;, same_url_but_in_english %&gt;&lt;/p&gt;
+&lt;% end -%&gt;
+
+Otherwise, check the &lt;%= link_to &quot;Table of Contents&quot;, url(:toc, :language =&gt; language) %&gt;
\ No newline at end of file</diff>
      <filename>app/views/exceptions/not_found.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,7 @@
 
 		&lt;div id=&quot;book-title&quot;&gt;&lt;a href=&quot;/&quot;&gt;The Merb Open Source Book&lt;/a&gt;&lt;/div&gt;
 		&lt;div id=&quot;book&quot;&gt;
-			&lt;div class=&quot;toc-link&quot;&gt;&lt;a href=&quot;/&quot;&gt;table of contents&lt;/a&gt;&lt;/div&gt;
+			&lt;div class=&quot;toc-link&quot;&gt;&lt;a href=&quot;&lt;%= url(:toc, :language =&gt; language) %&gt;&quot;&gt;table of contents&lt;/a&gt;&lt;/div&gt;
 			
 			&lt;div id=&quot;table-of-contents&quot;&gt;
 				&lt;%= catch_content :toc %&gt;</diff>
      <filename>app/views/layout/application.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,7 @@
 
 dependency &quot;maruku&quot;, &quot;&gt;= 0.5.9&quot;
 dependency &quot;merb-assets&quot;, &quot;~&gt; 1.0&quot;
+dependency &quot;merb_babel&quot;, &quot;&gt;= 0.1.0&quot;
 
 #  use_orm :none
 use_test :rspec
@@ -12,15 +13,18 @@ use_template_engine :erb
  
 Merb::Config.use do |c|
   c[:use_mutex] = false
-  #c[:session_store] = 'cookie'  # can also be 'memory', 'memcache', 'container', 'datamapper
+  c[:session_store] = 'cookie'  # can also be 'memory', 'memcache', 'container', 'datamapper
   
   # cookie session store configuration
-  #c[:session_secret_key]  = '8cea7e76dcb6c428521f22c4943b4e69430a85fa'  # required for cookie session store
-  #c[:session_id_key] = '_merb-book_session_id' # cookie session id key, defaults to &quot;_session_id&quot;
+  c[:session_secret_key]  = '8cea7e76dcb6c428521f22c4943b4e69430a85fa'  # required for cookie session store
+  c[:session_id_key] = '_merb-book_session_id' # cookie session id key, defaults to &quot;_session_id&quot;
 end
  
 Merb::BootLoader.before_app_loads do
   # This will get executed after dependencies have been loaded but before your app's classes have loaded.
+   Merb::Plugins.config[:Merb_babel] = {
+      :default_language =&gt; 'en'
+    }
 end
  
 Merb::BootLoader.after_app_loads do</diff>
      <filename>config/init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,9 @@
 Merb.logger.info(&quot;Compiling routes...&quot;)
 Merb::Router.prepare do
 
-  match('/table-of-content').to(:controller =&gt; 'pages', :action =&gt; 'index').name(:toc)
-  match(&quot;/:chapter(/:page_name)&quot;).to(:controller =&gt; 'pages', :action =&gt; 'show').name(:page)
+  match('(/:language)/table-of-contents', :language =&gt; /^[a-z]{2}$/).to(:controller =&gt; 'pages', :action =&gt; 'index').name(:toc)
+  match(&quot;(/:language)/:chapter(/:page_name)&quot;, :language =&gt; /^[a-z]{2}$/, :chapter =&gt; /.{3,}/).to(:controller =&gt; 'pages', :action =&gt; 'show').name(:page)
   #default_routes
   
-  match('/').to(:controller =&gt; 'pages', :action =&gt; 'index')
+  match('/(:language)', :language =&gt; /^[a-z]{2}$/).to(:controller =&gt; 'pages', :action =&gt; 'index')
 end
\ No newline at end of file</diff>
      <filename>config/router.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,6 +21,21 @@ body {
 	-webkit-box-shadow: #333 0px 1px 5px;
 }
 
+.to-translate:before {
+  font-weight: bold;
+  background: #999;
+	color: white;
+	padding: 0.5em;
+  content: &quot;Translation needed&quot;;
+}
+
+
+.to-translate{
+	border-left: 1.5em solid #CC6600;
+	padding: 1em;
+	background: #ccc;
+}
+
 #book-title{
 	padding: 4em 2em 1em 9em;
 	font-size: 160%;</diff>
      <filename>public/stylesheets/master.css</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>app/views/pages/index.html.erb</filename>
    </removed>
    <removed>
      <filename>book-content/0-front-matter/0-foreword.markdown</filename>
    </removed>
    <removed>
      <filename>book-content/0-front-matter/1-preface.markdown</filename>
    </removed>
    <removed>
      <filename>book-content/0-front-matter/2-contributors.markdown</filename>
    </removed>
    <removed>
      <filename>book-content/1-introduction/1-ruby.markdown</filename>
    </removed>
    <removed>
      <filename>book-content/1-introduction/2-merb.markdown</filename>
    </removed>
    <removed>
      <filename>book-content/1-introduction/3-datamapper.markdown</filename>
    </removed>
    <removed>
      <filename>book-content/1-introduction/4-rspec.markdown</filename>
    </removed>
    <removed>
      <filename>log/merb.4000.pid</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>f924debb78f7a104d76857c4737d9d6882ec2557</id>
    </parent>
  </parents>
  <author>
    <name>Matt Aimonetti</name>
    <email>mattaimonetti@gmail.com</email>
  </author>
  <url>http://github.com/mattetti/merb-book/commit/331383c66c1aa2da7eea455f2de9fb72e6f1e793</url>
  <id>331383c66c1aa2da7eea455f2de9fb72e6f1e793</id>
  <committed-date>2008-12-01T23:44:32-08:00</committed-date>
  <authored-date>2008-12-01T23:44:32-08:00</authored-date>
  <message>added i18n to the merb book</message>
  <tree>fee795d522523008b066db862daa8219a236c889</tree>
  <committer>
    <name>Matt Aimonetti</name>
    <email>mattaimonetti@gmail.com</email>
  </committer>
</commit>
