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.