[Bug 557767] New: WebYaST language should use proper default
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c0 Summary: WebYaST language should use proper default Classification: openSUSE Product: openSUSE 11.2 Version: RC 2 Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: WebYaST AssignedTo: schubi@novell.com ReportedBy: kkaempf@novell.com QAContact: qa@suse.de Found By: Development Blocker: --- Created an attachment (id=328993) --> (http://bugzilla.novell.com/attachment.cgi?id=328993) screen region See attachment, thats the initial webyast language screen :-/ -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c1 Klaus Kämpf <kkaempf@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P2 - High --- Comment #1 from Klaus Kämpf <kkaempf@novell.com> 2009-11-23 15:30:48 UTC --- Raising P2, this should be (easy to) fixed before release -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c2 Jiří Suchomel <jsuchome@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jsuchome@novell.com, | |schubi@novell.com AssignedTo|schubi@novell.com |jreidinger@novell.com --- Comment #2 from Jiří Suchomel <jsuchome@novell.com> 2009-11-24 10:53:02 UTC --- The screenshot is from language plugin... -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c3 Ladislav Slezak <lslezak@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO CC| |lslezak@novell.com Info Provider| |kkaempf@novell.com --- Comment #3 from Ladislav Slezak <lslezak@novell.com> 2009-11-24 11:03:40 UTC --- I cannot reproduce it in FF 3.5.4. It offers me Czech by default even when I remove "lang" cookie from the browser. I guess it uses the browser's preferred language. Klaus, please add more details, esp. the browser you used. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c4 --- Comment #4 from Jiří Suchomel <jsuchome@novell.com> 2009-11-24 11:14:52 UTC --- With WebYaST_on_SLES11.i686-0.0.38 and Firefox 3.0.15 it also works correctly. Maybe YaST2 logs could reveal anything? -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c5 Klaus Kämpf <kkaempf@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW Info Provider|kkaempf@novell.com | --- Comment #5 from Klaus Kämpf <kkaempf@novell.com> 2009-11-24 11:20:18 UTC --- I used FF 3.5.4, language "en", "en_US" -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c6 --- Comment #6 from Ladislav Slezak <lslezak@novell.com> 2009-11-24 12:11:23 UTC --- Yeah, I can reproduce it setting the preferred language to en-us in FF. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c7 --- Comment #7 from Stefan Schubert <schubi@novell.com> 2009-11-24 12:19:32 UTC --- This could be a problem cause our language tag is en_us and en_gb. So "_" and "-". In the last weeks "en" directory has disappeared in lcn. I assume that it has been replaced by the two described above. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c8 --- Comment #8 from Josef Reidinger <jreidinger@novell.com> 2009-11-24 12:22:32 UTC --- (In reply to comment #7)
This could be a problem cause our language tag is en_us and en_gb. So "_" and "-". In the last weeks "en" directory has disappeared in lcn. I assume that it has been replaced by the two described above.
So if I simple replace _ by - then it start work? -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c9 --- Comment #9 from Stefan Schubert <schubi@novell.com> 2009-11-24 12:44:41 UTC --- may be :-) -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c10 Josef Reidinger <jreidinger@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |schubi@novell.com --- Comment #10 from Josef Reidinger <jreidinger@novell.com> 2009-11-24 13:00:45 UTC --- (In reply to comment #9)
may be :-)
And is there any problem with setting it back? so should I set to cookie en-GB or en_GB? -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c11 --- Comment #11 from Jiří Suchomel <jsuchome@novell.com> 2009-11-24 13:08:50 UTC --- (In reply to comment #7)
This could be a problem cause our language tag is en_us and en_gb. So "_" and "-". In the last weeks "en" directory has disappeared in lcn. I assume that it has been replaced by the two described above.
Well, I don't know the code, but I think that using "en_US" instead of "en" inside lang_helper should work as well. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c12 Stefan Schubert <schubi@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW Info Provider|schubi@novell.com | --- Comment #12 from Stefan Schubert <schubi@novell.com> 2009-11-24 13:12:21 UTC --- The "_" comes from our official translation SVN and is only copied into our git repository. It seems that we have two conflicting "standards" here. .lcn/trunk/webyast 125 % ls en_* en_GB: Makefile.svn po en_US: Makefile.svn po I would say set the cookie to en_GB. But you will have to test it :-) -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c13 --- Comment #13 from Jiří Suchomel <jsuchome@novell.com> 2009-11-24 15:30:42 UTC --- (In reply to comment #11)
Well, I don't know the code, but I think that using "en_US" instead of "en" inside lang_helper should work as well.
This worked for me for that initial page, but I do not know if it wouldn't break other stuff, I do not know how lang_helper is being used...: index f9c466b..b444561 100644 --- a/webclient/vendor/plugins/lang_helper/lib/lang_helper.rb +++ b/webclient/vendor/plugins/lang_helper/lib/lang_helper.rb @@ -29,6 +29,7 @@ module LangHelper end def current_locale + return "en_US" if locale.language == "en" # only en_US or en_GB locale.language end -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c14 --- Comment #14 from Josef Reidinger <jreidinger@novell.com> 2009-11-25 07:41:24 UTC --- OK, I study problem. Problem is that firefox use for preferred languages - instead _... I try create patch for it. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c15 Josef Reidinger <jreidinger@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |mvidner@novell.com --- Comment #15 from Josef Reidinger <jreidinger@novell.com> 2009-11-25 08:12:11 UTC --- My few patches: #first one just fallback to american english if translation is not available def current_locale - locale.language + ret = locale.language + ret = "en_US" unless I18n.supported_locales.include?(ret) #fallback to American English if language from locale is not available + return ret end #second one which translate _ to - and ignore case( as we have en_GB and firefox set en-gb so case doesn't match) def current_locale - locale.language + ret = locale.language + Rails.logger.info ("detected locale #{ret}") + ret.tr!('-','_') #one of locale fallback is browser language and firefox use - instead _ bnc#557767 + ret = I18n.supported_locales.detect { |k| ret.downcase == k.downcase ? k : nil} #remove any problems with case-sensitive comparing + ret = "en_US" unless ret #fallback to en_US if translation is not available + Rails.logger.info ("returned locale #{ret}") + return ret end Schubi - please review and also could you please point me to tests for lang_helper? Martin - pleaes decide which patch you find more suitable for release. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c16 --- Comment #16 from Josef Reidinger <jreidinger@novell.com> 2009-11-25 08:15:35 UTC --- just to clarify way how language is choosen from ruby getttext documentation: When the value is nil, the locale is set order by "the parameter of bindtextdomain" > params["lang"] > "lang" value of QUERY_STRING > "lang" value of Cookie > HTTP_ACCEPT_LANGUAGE value > "en" (English) -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c17 Martin Vidner <mvidner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW Info Provider|mvidner@novell.com | --- Comment #17 from Martin Vidner <mvidner@novell.com> 2009-11-25 08:31:55 UTC --- It seems that we still don't fully understand the problem. In that case, I prefer the first patch from comment 15 for its simplicity. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c18 --- Comment #18 from Josef Reidinger <jreidinger@novell.com> 2009-11-25 08:53:42 UTC --- (In reply to comment #17)
It seems that we still don't fully understand the problem. In that case, I prefer the first patch from comment 15 for its simplicity.
Why we don't fully understand problem? For me it is quite clear. If cookie is not set then is used HTTP_ACCEPT_LANGUAGE value which sets browser and firefox use different format of locale then we ( and it is silly, there is not standard?). So what second patch do is that it translate from crappy browser locale to correct one. If browser start using same locale as we, then it still work, as patch only translate non-used character to correct one and ignore case of locale string. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c19 Josef Reidinger <jreidinger@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED --- Comment #19 from Josef Reidinger <jreidinger@novell.com> 2009-11-25 09:17:49 UTC --- record from IRC discuss: [10:04] <mvidner> jreidinger: well, I actually meant that I didn't understand it from your explanation :) now it is clearer [10:05] <mvidner> jreidinger: BTW ret ||= "en_US" is IMHO better than 'unless' [10:05] <jreidinger> so can I send sr with patch1? (still don't know where is test-suite for lib_lang)....Yeah, you are right [10:10] <mvidner> jreidinger: actually I will not take either one for RC4, so I'll suggest an improvement of patch 2 afterwards [10:10] <jreidinger> mvidner: OK There is reason wy firefox use - instead _ and why it ignore case-sensitive, so second patch is rfc2616 compliant http://tools.ietf.org/html/rfc2616#section-3.10 -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c20 Josef Reidinger <jreidinger@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #20 from Josef Reidinger <jreidinger@novell.com> 2009-11-25 13:33:20 UTC --- submitted second solution for next release . -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557767 http://bugzilla.novell.com/show_bug.cgi?id=557767#c21 Swamp Workflow Management <swamp@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status Whiteboard| |maint:released:sle11:29137 --- Comment #21 from Swamp Workflow Management <swamp@suse.com> 2009-12-02 20:53:35 UTC --- Update released for: yast2-webclient Products: SLE-WEBYAST 1.0 (i386, x86_64) -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com