]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
gettext: fix empty LANGUAGE env var
authorfranz <Franz.Netykafka@runbox.com>
Mon, 29 Jun 2009 06:26:46 +0000 (08:26 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 26 Aug 2009 21:31:38 +0000 (23:31 +0200)
When LANGUAGE env var is set to empty value, it breaks
gettext in ruby, so we unset it if it's empty.

lib/rbot/load-gettext.rb

index 2c65f19780e7cec70bb958bb58b7877c06fa5630..b37369c128fde1ccb690d983254aa508cfa8e95f 100644 (file)
@@ -10,6 +10,11 @@ end
 
 # try to load gettext, or provide fake getttext functions
 begin
+# workaround for gettext not checking empty LANGUAGE
+if ENV["LANGUAGE"] and ENV["LANGUAGE"].empty?
+  ENV.delete "LANGUAGE"
+end
+
   require 'gettext/version'
 
   gettext_version = GetText::VERSION.split('.').map {|n| n.to_i}