# File lib/gettext.rb, line 279 def sgettext(msgid, div = '|') cached_key = [bound_target, Locale.current, msgid] if cached? if @@__cache_msgids[cached_key] return @@__cache_msgids[cached_key] end end msg = nil # Use "for"(not "each") to support JRuby 1.1.0. for target in bound_targets(self) manager = @@__textdomainmanagers[target] for textdomain in manager.textdomains msg = textdomain[1].gettext(msgid) break if msg end break if msg end msg ||= msgid if div and msg == msgid if index = msg.rindex(div) msg = msg[(index + 1)..-1] end end @@__cache_msgids[cached_key] = msg end