Class: Object

Inherits:
BasicObject
Defined in:
lib/six-updater-web/vendor/plugins/recordselect/lib/localization.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/extensions/localize.rb

Overview

Provides a simple pass-through localizer for RecordSelect. If you want to localize RS, you need to override this method and route it to your own system.

Instance Method Summary collapse

Instance Method Details

#as_(key, options = {}) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/extensions/localize.rb', line 2

def as_(key, options = {})
  unless key.blank?
    # options[:default] ||= key.to_s.titleize unless ActiveScaffold::Config::Core.show_missing_translations
    # options[:default] = nil if ActiveScaffold::Config::Core.show_missing_translations
    # text = I18n.translate "#{key}", {:scope => [:active_scaffold]}.merge(options)
    text = I18n.translate "%{key}", {:scope => [:active_scaffold], :default => key.is_a?(String) ? key : key.to_s.titleize}.merge(options)
  end
  text
end

#rs_(string_to_localize, *args) ⇒ Object



5
6
7
# File 'lib/six-updater-web/vendor/plugins/recordselect/lib/localization.rb', line 5

def rs_(string_to_localize, *args)
  args.empty? ? string_to_localize : (sprintf string_to_localize, *args)
end