lib/gettext_activerecord/parser.rb
# Sets some preferences to parse ActiveRecord files.
#
# * config: a Hash of the config. It can takes some values below:
#   * :use_classname - If true, the msgids of ActiveRecord become "ClassName|FieldName" (e.g. "Article|Title"). Otherwise the ClassName is not used (e.g. "Title"). Default is true.
#   * :db_yml - the path of database.yml. Default is "config/database.yml".
#   * :db_mode - the mode of the database. Default is "development"
#   * :activerecord_classes - an Array of the superclass of the models. The classes should be String value. Default is ["ActiveRecord::Base"]
#   * :untranslate_classes - an Array of the modules/class names which is ignored as the msgid.
#   * :untranslate_columns - an Array of the column names which is ignored as the msgid.
#   * :adapter - the options for ActiveRecord::Base.establish_connection. If this value is set, :db_yml option is ignored.
#   * :host - ditto
#   * :username - ditto
#   * :password - ditto
#   * :database - ditto
#   * :socket - ditto
#   * :encoding - ditto
#
# "ClassName|FieldName" uses GetText.sgettext. So you don't need to translate the left-side of "|". 
# See <Documents for Translators for more details(http://www.yotabanana.com/hiki/ruby-gettext-translate.html)>.
Sets some preferences to parse ActiveRecord files.
config: a Hash of the config. It can takes some values below:
:use_classname - If true, the msgids of ActiveRecord become "ClassName|FieldName" . Otherwise the ClassName is not used . Default is true.
:db_yml - the path of database.yml.


Sets some preferences to parse ActiveRecord files . config : a Hash of the config . It can takes some values below : : use_classname - If true the msgids of ActiveRecord become " ClassName|FieldName " . Otherwise the ClassName is not used . Default is true . : db_yml - the path of database . yml .
def init(config)
      puts "\nconfig: #{config.inspect}\n\n" if $DEBUG
      if config
        config.each{|k, v|
          @config[k] = v
        }
      end
      @ar_re = /class.*(#{@config[:activerecord_classes].join("|")})/
    end
def init ( config ) puts "\nconfig: #{config.inspect}\n\n" if $DEBUG if config config . each { | k , v | @config [ k ] = v } end @ar_re = / class.*( #{ @config [ :activerecord_classes ] . join ( "|" ) } ) / end
Sets some preferences to parse ActiveRecord files.
Sets some preferences to parse ActiveRecord files .
config