public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Search Repo:
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
Introduce "lang" parameter for a Site. Used in feed.rxml to 
specify feed language, especially useful for non-english blogs.

Site settings form altered.
yaroslav (author)
Sun May 11 03:59:54 -0700 2008
commit  bc58c2c800ee1bb8e33b4054e8565ce7e19ee8fa
tree    18cdd53682f6d1efdf6803f43aa3f263b10e9289
parent  f80afafc295d5ef9687392074ff696d90beb47f2
...
31
32
33
 
 
 
 
 
34
35
36
...
31
32
33
34
35
36
37
38
39
40
41
0
@@ -31,6 +31,11 @@
0
     <dt><label for="site_timezone">Website Timezone</label></dt>
0
     <dd><%= select_tag 'site_timezone', options_for_select(['UTC'] + TZInfo::Timezone.all.map{|tz| [tz.to_s, tz.name]}.sort, @site.timezone.name), :name => 'site[timezone]' %></dd>
0
     <dt>
0
+ <label for="site_lang">Site language</label>
0
+ <span class="hint">Used to specify language in your site feeds</span>
0
+ </dt>
0
+ <dd><%= f.text_field :lang %></dd>
0
+ <dt>
0
       <label for="site_current_theme_path">Current Theme Path</label>
0
       <span class="hint">This is the path to the current template in /themes/site-<%= site.id %>. Be careful with this setting!</span>
0
     </dt>
...
1
2
3
 
4
5
6
...
1
2
 
3
4
5
6
0
@@ -1,6 +1,6 @@
0
 xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
0
 
0
-xml.feed "xml:lang" => "en-US", "xmlns" => 'http://www.w3.org/2005/Atom' do
0
+xml.feed "xml:lang" => "#{site.lang || 'en-US'}", "xmlns" => 'http://www.w3.org/2005/Atom' do
0
   xml.title "#{site.title || 'Mephisto'} - #{@section ? @section.name : 'All'}#{' Comments' if @comments && @articles.nil?}"
0
   xml.id "tag:#{request.host},#{Time.now.utc.year}:mephisto#{"/#{@section.path}" if @section}#{ '/comments' if @comments && @articles.nil?}"
0
   xml.generator "Mephisto #{Mephisto::Version::TITLE}", :uri => "http://mephistoblog.com", :version => "#{Mephisto::Version::STRING}"
...
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
0
@@ -1 +1,10 @@
0
+class AddLangToSites < ActiveRecord::Migration
0
+ def self.up
0
+ add_column :sites, :lang, :string, :null => false, :default => 'en-US'
0
+ end
0
+
0
+ def self.down
0
+ remove_column :sites, :lang
0
+ end
0
+end

Comments

  • TomK32 Wed Jun 04 23:56:25 -0700 2008

    looks like :lang is missing in bootstrap.

  • yaroslav Thu Jun 05 02:35:05 -0700 2008

    TomK32, thanks for noticing, need to update schema.rb, but getting weird table removals atm..

  • yaroslav Thu Jun 05 02:41:19 -0700 2008

    Well, running db:migrate on fresh mephisto for me deletes “feedbacks” table all the time, not sure if this is intended.