Permalink
Browse files

new language selector using dropdown list

  • Loading branch information...
molpe committed Nov 19, 2009
1 parent cd21505 commit 3c74c15b0792d869a88bed4737dcde5b0eebf89f
View
@@ -13,6 +13,8 @@ Edge
* using acts_as_taggable_on instead of acts_as_taggable_on_steroids_
* comments can be posted to twitter (kudos to boonious)
* for comments notification, commentable must respond to user or owner (till now must respond to owner)
+* New language selector using dropdown list
+* Added translations for Brazilian Portuguese
0.5.4
----
@@ -1,5 +1,9 @@
module I18nHelper
-
+
+ def supported_languages_for_select
+ TogSupportedLanguages::LANGUAGES.collect{ |k, v| [v[:native_name].to_s, v[:iso_639_1].to_s] }
+ end
+
def supported_languages(&block)
TogSupportedLanguages::LANGUAGES.each_pair do |k,v|
yield v
@@ -1,9 +1,5 @@
<div id="footer" class="clearfix">
<span class="copyright"><strong><%=config['plugins.tog_core.site.name']%> © <%=Time.now.year%></strong></span>
<span class="links"><%= link_to I18n.t('tog_core.views.shared.anon_footer.about', :site => config['plugins.tog_core.site.name']), "http://www.toghq.com" %></span>
-
- <% supported_languages do |l| %>
- <span><%= link_to l[:native_name], set_locale_path(:locale => l[:iso_639_1]) %></span>
- <% end %>
-
+ <%= render :partial => "/shared/lang_selector" -%>
</div> <!-- /#footer -->
@@ -0,0 +1,4 @@
+<% form_tag set_locale_path, {:method => :get, :id => "set_locale"} do %>
+ <%= I18n.t("tog_core.views.shared.logged_footer.locale")%>
+ <%= select_tag :locale, options_for_select(supported_languages_for_select , I18n.locale.to_s), {:class => "fieldbox", :onchange => "document.forms['set_locale'].submit();"}%>
+<% end %>
@@ -3,6 +3,8 @@
<strong><%=config['plugins.tog_core.site.name']%> © <%=Time.now.year%></strong>
<br />
<%= I18n.t("tog_core.views.shared.logged_footer.powered_by")%> <%= Tog::Version.full_version %>
+ <br/>
+ <%= render :partial => "/shared/lang_selector" -%>
</div>
<div class="links">
<ul class="clearfix">
@@ -24,13 +26,6 @@
<li><%= link_to I18n.t("tog_core.views.shared.logged_footer.edit_profile"), edit_member_profile_path(current_user.profile) -%></li>
</ul>
</li>
- <li><%= I18n.t("tog_core.views.shared.logged_footer.locale")%>
- <ul>
- <% supported_languages do |l| %>
- <li><%= link_to l[:native_name], set_locale_path(:locale => l[:iso_639_1]) %></li>
- <% end %>
- </ul>
- </li>
</ul>
</div>
</div> <!-- /#footerlogged -->

0 comments on commit 3c74c15

Please sign in to comment.