Sha256: 926ef1ebcfffb6bf01fcc8f644131daf1989caaca2a1e9e9693076fa7abfcc8d
Contents?: true
Size: 604 Bytes
Versions: 153
Compression:
Stored size: 604 Bytes
Contents
module RubyApp module Mixins module TranslateMixin require 'ruby_app' def translate name = self.is_a?(Class) ? self.to_s : self.class.to_s name.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2') name.gsub!(/([a-z\d])([A-Z])/,'\1_\2') name.tr!("-", "_") name.downcase! names = name.split('::') value = RubyApp::Language.t names.each do |name| value = value[name] end return value end def localize(*parameters) return RubyApp::Language.l(*parameters) end end end end
Version data entries
153 entries across 153 versions & 1 rubygems