# File lib/gettext/textdomain_manager.rb, line 97 def translate_singluar_message(klass, msgid, div = nil) key = [Locale.current, klass, msgid, div].hash msg = @@singular_message_cache[key] return msg if msg and @@cached # Find messages from related classes. each_textdomains(klass) do |textdomain, lang| msg = textdomain.translate_singluar_message(lang, msgid) break if msg end # If not found, return msgid. msg ||= msgid if div and msg == msgid if index = msg.rindex(div) msg = msg[(index + 1)..-1] end end @@singular_message_cache[key] = msg end