[yast-commit] <web-client> master : use text names for languages instead of flags (bnc#541528)
ref: refs/heads/master commit 7781222eea33c1659c5b9a1d423c0ac4f0a2fd5e Author: Ladislav Slezak <lslezak@novell.com> Date: Fri Oct 30 17:22:51 2009 +0100 use text names for languages instead of flags (bnc#541528) the strings have been read from language_<xy>_<YZ>.ycp file, the remaning left from http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes --- webclient/app/views/layouts/main.rhtml | 4 +- webclient/package/yast2-webclient.changes | 6 +++ webclient/package/yast2-webclient.spec | 2 +- .../vendor/plugins/lang_helper/lib/lang_helper.rb | 33 +++++++++++++++++-- 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/webclient/app/views/layouts/main.rhtml b/webclient/app/views/layouts/main.rhtml index 2aa54d0..694e968 100644 --- a/webclient/app/views/layouts/main.rhtml +++ b/webclient/app/views/layouts/main.rhtml @@ -47,8 +47,8 @@ if host.blank? || user.blank? -%> <% else -%> <ul> - <li><%= link_to_remote( image_tag(current_locale_image, :size => "16x11", :alt => "#{current_locale}"), - :update =>"language_selection", :url => { :controller => :controlpanel, :action => :select_language} ) %></li> + <li><%=_("Langugage:")%> <strong><%= link_to_remote(current_locale_name, + :update =>"language_selection", :url => { :controller => :controlpanel, :action => :select_language} ) %></strong></li> <li><strong><%=_("Connected Host")%></strong></li> <li><%=_("Name:")%> <strong><%= host.name -%></strong></li> <li><%=_("User:")%> <strong><%= user -%></strong></li> diff --git a/webclient/package/yast2-webclient.changes b/webclient/package/yast2-webclient.changes index a05e9c0..6c238c0 100644 --- a/webclient/package/yast2-webclient.changes +++ b/webclient/package/yast2-webclient.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Oct 30 17:20:01 CET 2009 - lslezak@suse.cz + +- use text names for languages instead of flags (bnc#541528) +- 0.0.9 + +------------------------------------------------------------------- Thu Oct 29 16:10:31 CET 2009 - mvidner@suse.cz - Removed the avahi (zeroconf) dependency. diff --git a/webclient/package/yast2-webclient.spec b/webclient/package/yast2-webclient.spec index a4b33fc..541b285 100644 --- a/webclient/package/yast2-webclient.spec +++ b/webclient/package/yast2-webclient.spec @@ -17,7 +17,7 @@ PreReq: rubygem-gettext_rails License: LGPL v 2.1 Group: Productivity/Networking/Web/Utilities Autoreqprov: on -Version: 0.0.8 +Version: 0.0.9 Release: 0 Summary: YaST2 - Webclient Source: www.tar.bz2 diff --git a/webclient/vendor/plugins/lang_helper/lib/lang_helper.rb b/webclient/vendor/plugins/lang_helper/lib/lang_helper.rb index 3dba9ff..ab13816 100644 --- a/webclient/vendor/plugins/lang_helper/lib/lang_helper.rb +++ b/webclient/vendor/plugins/lang_helper/lib/lang_helper.rb @@ -10,6 +10,20 @@ module LangHelper bindtextdomain("lang_helper", :path => File.join(RAILS_ROOT, "vendor/plugins/lang_helper/locale")) + LANGUGAGES = { 'af' => 'Afrikaans', 'ar' => 'العربية', 'be' => 'Беларуская', 'bg' => 'Български', 'bn' => 'বাংলা', + 'bs' => 'Bosanski', 'ca' => 'Català', 'cs' => 'Čeština', 'cy' => 'Cymraeg', 'da' => 'Dansk', + 'de' => 'Deutsch', 'el' => 'Ελληνικά ', 'en' => 'English', 'en_GB' => 'English (UK)', 'en_US' => 'English (US)', + 'es' => 'Español', 'et' => 'Eesti', 'fi' => 'Suomi', 'fr' => 'Français', 'gl' => 'Galego', + 'gu' => 'ગુજરાતી', 'he' => 'עברית', 'hi' => 'हिन्दी', 'hr' => 'Hrvatski', 'hu' => 'Magyar', + 'id' => 'Bahasa Indonesia', 'it' => 'Italiano', 'ja' => '日本語', 'ka' => 'ქართული', + 'km' => 'ខ្មែរ', 'ko' => '한글 ', 'lo' => 'ພາສາລາວ', 'lt' => 'Lietuvių', 'mk' => 'Македонски', 'mr' => 'मराठी', + 'nb' => 'Norsk', 'nl' => 'Nederlands', 'pa' => 'ਪੰਜਾਬੀ', 'pl' => 'Polski', + 'pt_BR' => 'Português brasileiro', 'pt' => 'Português', 'ro' => 'Română', 'ru' => 'Русский ', + 'si' => 'සිංහල', 'sk' => 'Slovenčina', 'sl' => 'Slovenščina', 'sr' => 'Srpski', + 'sv' => 'Svenska', 'ta' => 'தமிழ்', 'tg' => 'тоҷикӣ', 'th' => 'ภาษาไทย', 'tr' => 'Türkçe', + 'uk' => 'Українська', 'vi' => 'Tiếng Việt', 'wa' => 'Walon', 'xh' => 'isiXhosa', + 'zh_CN' => '简体中文', 'zh_TW' => '繁體中文', 'zu' => 'isiZulu'} + def current_locale_image return "/images/flags/#{locale.language}.png" end @@ -18,15 +32,26 @@ module LangHelper locale.language end + def language_name(code) + language = LANGUGAGES[code] + if language.nil? + Rails.logger.warn "Missing text for language code #{current_locale}" + language = code + end + language + end + + def current_locale_name + language_name current_locale + end + def show_language langs = I18n.supported_locales.sort ret = "<h4>" + _("Select locale") + "</h4>" langs.each_with_index do |lang, i| - ret << link_to( image_tag("/images/flags/#{lang}.png", :size => "16x11", :alt => "[#{lang}]" ), + ret << link_to( language_name(lang), :action => "cookie_locale", :id => lang) - if ((i + 1) % 6 == 0) - ret << "<br/>" - end + ret << "<br/>" end ret end -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
Ladislav Slezak