File: metadata.rb [i18n-0.6.9 Documentation]

Last Modified
  2014-02-16 06:57:56 +0000
Requires

## Description

I18n translation metadata is useful when you want to access information about how a translation was looked up, pluralized or interpolated in your application.

    msg = I18n.t(:message, :default => 'Hi!', :scope => :foo)
    msg.translation_metadata
    # => { :key => :message, :scope => :foo, :default => 'Hi!' }

If a :count option was passed to translate it will be set to the metadata. Likewise, if any interpolation variables were passed they will also be set.

To enable translation metadata you can simply include the Metadata module into the Simple backend class - or whatever other backend you are using:

    I18n::Backend::Simple.include(I18n::Backend::Metadata)