You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

18 lines
466 B

module Gibberish
module StringExt
def brackets_with_translation(*args)
args = [underscore.tr(' ', '_').to_sym] if args.empty?
return brackets_without_translation(*args) unless args.first.is_a? Symbol
Gibberish.translate(self, args.shift, *args)
end
def self.included(base)
base.class_eval do
alias :brackets :[]
alias_method_chain :brackets, :translation
alias :[] :brackets
end
end
end
end