[yast-commit] <web-client> master : show only webyast language (bnc#547176) webyast language to select box (bnc#547176) use only available localizations (bnc#554683)
ref: refs/heads/master commit a6600309505579d5c9e28c1529e460ac736d491b Author: Josef Reidinger <jreidinger@suse.cz> Date: Wed Nov 18 12:38:30 2009 +0100 show only webyast language (bnc#547176) webyast language to select box (bnc#547176) use only available localizations (bnc#554683) --- .../app/controllers/language_controller.rb | 8 +++++++- plugins/language/app/views/language/index.rhtml | 11 +++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/plugins/language/app/controllers/language_controller.rb b/plugins/language/app/controllers/language_controller.rb index 884d3d3..b14e38b 100644 --- a/plugins/language/app/controllers/language_controller.rb +++ b/plugins/language/app/controllers/language_controller.rb @@ -8,7 +8,8 @@ require 'yast/service_resource' class LanguageController < ApplicationController before_filter :login_required layout 'main' - include ProxyLoader +#include ProxyLoader + include LangHelper # Initialize GetText and Content-Type. init_gettext "yast_webclient_language" # textdomain, options(:charset, :content_type) @@ -17,6 +18,7 @@ class LanguageController < ApplicationController # fields is filled. In case of errors redirect to help page, main page or just # show flash with partial problem. def index + return #no backend stuff is needed in appliance language = load_proxy 'org.opensuse.yast.modules.yapi.language' unless language @@ -41,6 +43,10 @@ class LanguageController < ApplicationController # Update handler. Sets to backend new language settins. If # everything goes fine show confirmation message, otherwise show some error. def update + cookies["lang"] = params[:webyast_language] + set_locale params[:webyast_language] + redirect_success + return #do nothing for update lang = load_proxy 'org.opensuse.yast.modules.yapi.language' if lang diff --git a/plugins/language/app/views/language/index.rhtml b/plugins/language/app/views/language/index.rhtml index 2cbf869..b42cefb 100644 --- a/plugins/language/app/views/language/index.rhtml +++ b/plugins/language/app/views/language/index.rhtml @@ -3,18 +3,13 @@ <% form_tag '/language/update' do -%> <fieldset id="language_set" class=""> <p> - <label><%=_("System language")%></label> - <%= select_tag :first_language, options_for_select(@valid||[], @current||""), - :disabled=>!@permissions[:write] %> - </p> - <p> <label><%=_("webYaST language")%> <label> - <%= link_to_remote(current_locale_name, - :update =>"language_selection", :url => { :controller => :controlpanel, :action => :select_language} ) %></label> +<%= select_tag "webyast_language", + options_for_select(LangHelper::LANGUAGES.invert.to_a.sort_by { |a| a[0].parameterize}, current_locale) %> </p> </fieldset> <div> - <%= form_send_buttons :disabled => !@permissions[:write] %> + <%= form_send_buttons %> </div> <% end -%> </div> -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
Josef Reidinger