Sha256: 7c876780d66b812abd7f3532fefe88425481ced75777b1d93d5a7def6d72fb6d

Contents?: true

Size: 649 Bytes

Versions: 4

Compression:

Stored size: 649 Bytes

Contents

class GettextSimpleRails::Translators::SimpleFormTranslator
  def detected?
    return ::Kernel.const_defined?("SimpleForm")
  end
  
  def translations
    @translations = {"simple_form" => {
      "hints" => {}
    }}
    
    hints = @translations["simple_form"]["hints"]
    
    GettextSimpleRails::ModelInspector.model_classes do |inspector|
      clazz_snake_name = StringCases.camel_to_snake(inspector.clazz.name)
      
      clazz_hints = {}
      hints[clazz_snake_name] = clazz_hints
      
      inspector.attributes do |attribute|
        clazz_hints[attribute.name.to_s] = ""
      end
    end
    
    return @translations
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gettext_simple_rails-0.0.14 lib/gettext_simple_rails/translators/simple_form_translator.rb
gettext_simple_rails-0.0.13 lib/gettext_simple_rails/translators/simple_form_translator.rb
gettext_simple_rails-0.0.12 lib/gettext_simple_rails/translators/simple_form_translator.rb
gettext_simple_rails-0.0.11 lib/gettext_simple_rails/translators/simple_form_translator.rb