Module: SimpleARLocalizer

Defined in:
lib/simple_ar_localizer.rb,
lib/simple_ar_localizer/map.rb,
lib/simple_ar_localizer/version.rb,
lib/simple_ar_localizer/localizer.rb

Defined Under Namespace

Classes: Localizer

Constant Summary collapse

DEFAULT_MAP =

Default mapping from inbound localisation data to I18n keys. These can be supplemented/overridden via the Rails.application.config.ar_localization_rules configuration variable.

{

  # per-model stuff
  'name':          'activerecord.models.%{model}',
  'name/singular': 'activerecord.models.%{model}.one',
  'name/plural':   'activerecord.models.%{model}.other',
  'name/:key':     'activerecord.models.%{model}.%{key}',
  'errors/:error': 'activerecord.errors.models.%{model}.%{error}',

  # per-attribute stuff
  'attributes/:attr':      'activerecord.attributes.%{model}.%{attr}', # only specifying a name
  'attributes/:attr/name': 'activerecord.attributes.%{model}.%{attr}', # verbose specification
  'attributes/:attr/errors/:error': 'activerecord.errors.models.%{model}.attributes.%{attr}.%{error}'

}
VERSION =
'1.0.1'

Class Method Summary collapse

Class Method Details

.transform(model_name, language, l10n_data) ⇒ Object

Convenience accessort to SimpleARLocalizer::Localizer::transform()


8
9
10
11
12
# File 'lib/simple_ar_localizer.rb', line 8

def self.transform( model_name, language, l10n_data )

  Localizer.transform( model_name, language, l10n_data )

end