Browse files

fix language selector

  • Loading branch information...
1 parent 3f7b4f9 commit 8190712f3ab684e2f8eef2b5f1d8a8098072e403 @digitaltom digitaltom committed Dec 20, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 app/views/main/release.html.erb
  2. +1 −1 config/initializers/languages.rb
View
2 app/views/main/release.html.erb
@@ -160,7 +160,7 @@
<h2 class="box-header centered"><%= _("Language") %></h2>
<form action="<%= url_for :controller => :main, :action => :index %>" method="get" class="centered">
<select name="locale" onChange="this.form.submit();">
- <option value="<%= @lang %>" selected="true"><%= link_to(LANGUAGE_NAMES[@lang.sub('_', '-')] || @lang, :controller => :main, :action => :index, :locale => "#{@lang}") %></option>
+ <option value="<%= @lang %>" selected="true"><%= link_to(LANGUAGE_NAMES[@lang] || @lang, :controller => :main, :action => :index, :locale => "#{@lang}") %></option>
<% LANGUAGES.each do |lang| %>
<option value="<%= lang %>"><%= link_to(LANGUAGE_NAMES[lang] || lang, :controller => :main, :action => :index, :locale => "#{lang}") %></option>
<% end -%>
View
2 config/initializers/languages.rb
@@ -14,7 +14,7 @@
'km' => 'ភាសាខ្មែរ', 'ko' => '한국어 [韓國語]', 'lt' => 'lietuvių kalba', 'nb' => 'Bokmål',
'nl' => 'Nederlands', 'pl' => 'polski', 'ro' => 'român', 'ru' => 'Русский язык',
'sk' => 'slovenčina', 'th' => 'ภาษาไทย', 'uk' => 'Українська', 'wa' => 'walon',
- 'pt_BR' => 'português', 'z_-TW' => '台語', 'zh_CN' => '简体中文' }
+ 'pt_BR' => 'português', 'zh_TW' => '台語', 'zh_CN' => '简体中文' }
FastGettext.add_text_domain 'software', :path => Rails.root.join('locale')
FastGettext.available_locales = LANGUAGES #all you want to allow

0 comments on commit 8190712

Please sign in to comment.