> We've went over a couple of options and for managability we've  
> decided on creating separate default page parts for each 
> language and  
> then overriding find_page_by_url in our extension to select 
> the right  
> content to render based upon the browser language type.
> 
> John implemented Ruby Language site with internationalization using  
> multiple roots under the root (home/english, home/spanish, 
> etc.) This  
> approach is cleaner in a couple of ways but is less manageable  
> (depending on your use case--if you have different editors for each  
> language it would be more manageable).
> 
> Has anybody already done a similar thing? Any other approaches worth  
> considering?

I would suggest a combination of the two approaches.

Have a parent page that (virtually) partitions the site into sub-pages
based on langauges, and then grab out page parts based on language
extensions:

class LanguagePartitionPage < Page

  def find_by_url(url, live = true, clean = true)
        #set a language variable from the url here
  end

  def child_url(page)
    clean_url(url + '/' + @language + '/' + child.slug)
  end

end

class Page
  def part(name)
    parts.find_by_name(name + '_' + language) || parts.find_by_name(name.to_s)
  end  
end     

Deciding how and where to store the langauge var is left as an exercise for the 
reader, but there's a host of options (stick it in
the request params, a global var, probably other cleaner methods too).

Dan.
_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to