Isn’t locate database old?
#Did you call updatedb manually?
Just did and checked again : all the same.
Anyway,
could you check “/usr/lib/ruby/site_ruby/1.8/gettext.rb” manually ?
I removed it but here is
‘/usr/lib/ruby/gems/1.8/gems/gettext-1.1.1/lib/gettext.rb’ :
=begin
gettext.rb - GetText module
Copyright © 2001-2005 Masao M.
Copyright © 2001-2003 Masahiro S.
Masao M. <[email protected]>
Masahiro S. <[email protected]>
You may redistribute it and/or modify it under the same
license terms as Ruby.
$Id: gettext.rb,v 1.5 2005/11/30 17:59:14 mutoh Exp $
=end
require ‘rbconfig’
require ‘gettext/version’
require ‘gettext/mo’
require ‘gettext/locale’
require ‘gettext/textdomain’
require ‘gettext/string’
module GetText
class NoboundTextDomainError < RuntimeError
end
@@__textdomain = Hash.new
@@__textdomain_key = Hash.new
@@output_charset = nil
@@locale = nil
def bindtextdomain(domainname, path = nil, locale = nil, charset =
nil)
if @@locale
locale = @@locale
Locale.set(Locale::CTYPE, locale)
else
locale ||= Locale.get
end
if @@output_charset
charset = @@output_charset
else
charset ||= ENV[“OUTPUT_CHARSET”] ? ENV[“OUTPUT_CHARSET”] :
Locale.codeset
@@output_charset = charset
end
src = callersrc
$stderr.print “bind the domain ‘#{domainname}’ to ‘#{src}’. charset
is #{charset}\n” if $DEBUG
textdomain = @@__textdomain[src]
unless textdomain
textdomain = @@__textdomain_key[domainname]
@@__textdomain[src] = textdomain
end
if ! textdomain or ! textdomain.same_property?(domainname, path,
locale, charset)
textdomain = TextDomain.new(domainname, path, locale, charset)
@@__textdomain_key[domainname] = textdomain
@@__textdomain[src] = textdomain
end
@@__textdomain[src]
end
def textdomain(domainname)
src = callersrc
textdomain = @@__textdomain_key[domainname]
raise NoboundTextDomainError, “#{domainname} is not bound.” unless
textdomain
@@__textdomain[src] = textdomain
$stderr.print “Use the domain ‘#{domainname}’ to ‘#{src}’. charset
is #{textdomain.charset}\n” if $DEBUG
@@__textdomain[src]
end
def gettext(msgid)
textdomain = @@__textdomain[callersrc]
textdomain ? textdomain.gettext(msgid) : msgid
end
def ngettext(msgid, msgid_plural, n)
textdomain = @@__textdomain[callersrc]
textdomain ? textdomain.ngettext(msgid, msgid_plural, n) : (n == 1 ?
msgid : msgid_plural)
end
def N_(msgid)
msgid
end
def sgettext(msgid, div = ‘|’)
textdomain = @@__textdomain[callersrc]
if textdomain
msg = textdomain.gettext(msgid)
else
msg = msgid
end
if msg == msgid
if index = msg.rindex(div)
msg = msg[(index + 1)…-1]
end
end
msg
end
def callersrc
caller(2)[0].sub(/:\d+(?::in `\S+’)?\Z/, ‘’)
end
def locale=(locale)
@@locale = locale
textdomain = @@__textdomain[callersrc]
textdomain.set_locale(locale) if textdomain
locale
end
def output_charset=(charset)
@@output_charset = charset
end
def output_charset
@@output_charset
end
def locale
@@locale
end
def charset=(cs)
textdomain = @@__textdomain[callersrc]
textdomain.set_charset(cs) if textdomain
end
alias :setlocale :locale=
alias :set_locale :locale=
alias :set_output_charset :output_charset=
alias :_ :gettext
alias :n_ :ngettext
alias :s_ :sgettext
module_function :bindtextdomain, :textdomain,
:N_, :gettext, :, :ngettext, :n,
:sgettext, :s_, :callersrc,
:setlocale, :set_locale, :locale=, :locale, :charset=,
:set_output_charset, :output_charset=, :output_charset
end
And your “/usr/local/lib/site_ruby/1.8/” path seems strange.
Isn’t it “/usr/local/lib/ruby/site_ruby/1.8” ?
No, I made a copy/paste ; the other gem modules are there too :
test:~# ls /usr/local/lib/site_ruby/1.8
gemconfigure.rb i386-linux rubygems rubygems.rb ubygems.rb
Did you re-install ruby-gettext-1.1.1 with gem ?
Yes : ‘gem uninstall gettext’, then ‘gem install gettext’
Is there any way to get the path of a loaded module ? So I could check
which version it is for sure.
$ ruby -v -e ‘p $:’
I meant : a way to get the complete of a module which has been loaded
with require.