Skip to content
Browse files

sometimes a browser doesn't pass a language, and that can cause a bun…

…ch of problems
  • Loading branch information...
1 parent 0a1374d commit b88092b81aa64d737826a68e8ed75ff9e9bacb31 @peburrows committed May 27, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/models/translate_response_cache.rb
View
2 app/models/translate_response_cache.rb
@@ -64,7 +64,7 @@ def language
return proper_language(self.parameters[:language]) if self.parameters[:language]
return session_lang = proper_language(self.session[:language]) if self.session[:language]
- lang = self.env['HTTP_ACCEPT_LANGUAGE']
+ lang = self.env['HTTP_ACCEPT_LANGUAGE'] || ''
m = lang.match(/^[a-zA-Z]{2}(\-[a-zA-Z]{2})?/)
return TranslatorExtension.defaults[:language] unless m

0 comments on commit b88092b

Please sign in to comment.
Something went wrong with that request. Please try again.