Project

General

Profile

Bug #5374 ยป gettext-test.rb

test for gettext workaround - 375gnu (Hleb Valoshka), 09/28/2011 04:02 AM

 
1
#!/usr/bin/ruby1.9.1 -d -I.
2

    
3
require 'gettext'
4
include GetText
5

    
6
$SAFE = 1
7

    
8
set_current_locale ARGV[0]
9
bindtextdomain('test', :path => './')
10

    
11
module Locale
12
  module_function
13
  def require_driver(name)  #:nodoc:
14
    require File.join(ROOT, "locale/driver", name.to_s).untaint
15
  end
16
end
17

    
18
module GetText
19
  class MOFile
20
  alias :oldload :load
21
    def load(arg)
22
      arg = arg.dup.untaint if arg.kind_of? String
23
      oldload(arg)
24
    end
25
  end
26
end
27

    
28
puts _('Hello world!')
29

    
30