config/locales/en.yml:
en:
wtfblabla: hello
test.rb:
require 'i18n'
module I18n
class<< self
alias_method :old_translate, :translate
def translate(*args)
old_translate(*args) + 'blabla'
end
alias_method :t, :translate
end
end
I18n.load_path += p(Dir[File.join(File.dirname(__FILE__), 'config', 'locales', '*.yml').to_s])
p I18n.t "wtfblabla"
output:
["./config/locales/en.yml"]
"helloblabla"