Add locale link in template
This commit is contained in:
parent
bd46cb1b12
commit
e2a6d9fe0d
|
@ -15,7 +15,7 @@ namespace :dev do
|
||||||
:content_en => File.open("#{RAILS_ROOT}/lib/template/#{page_name}.page.en").read )
|
:content_en => File.open("#{RAILS_ROOT}/lib/template/#{page_name}.page.en").read )
|
||||||
end
|
end
|
||||||
|
|
||||||
["nav", "footer"].each do |page_name|
|
["nav", "footer", "locale"].each do |page_name|
|
||||||
Snippet.create!( :name => page_name, :parent_name => "root",
|
Snippet.create!( :name => page_name, :parent_name => "root",
|
||||||
:content_zh_tw => File.open("#{RAILS_ROOT}/lib/template/#{page_name}.snippet.zh_tw").read,
|
:content_zh_tw => File.open("#{RAILS_ROOT}/lib/template/#{page_name}.snippet.zh_tw").read,
|
||||||
:content_en => File.open("#{RAILS_ROOT}/lib/template/#{page_name}.snippet.en").read )
|
:content_en => File.open("#{RAILS_ROOT}/lib/template/#{page_name}.snippet.en").read )
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
<ul>
|
||||||
|
<li><a href="?locale=en">English</a></li>
|
||||||
|
<li><a href="?locale=zh_tw">中文版</a></li>
|
||||||
|
</ul>
|
|
@ -0,0 +1,4 @@
|
||||||
|
<ul>
|
||||||
|
<li><a href="?locale=en">English</a></li>
|
||||||
|
<li><a href="?locale=zh_tw">中文版</a></li>
|
||||||
|
</ul>
|
|
@ -17,6 +17,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
|
{{ 'locale' | render_snippet }}
|
||||||
{{ 'footer' | render_snippet }}
|
{{ 'footer' | render_snippet }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
|
{{ 'locale' | render_snippet }}
|
||||||
{{ 'footer' | render_snippet }}
|
{{ 'footer' | render_snippet }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Reference in New Issue