Class: Rails::Pseudoloc::Backend
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Rails::Pseudoloc::Backend
- Defined in:
- lib/rails/pseudoloc/backend.rb
Overview
An I18n::Backend that pseudolocalizes all translations requested of it and delegates to another backend for the actual translations and localizations.
Instance Method Summary collapse
-
#initialize(backend) ⇒ Backend
constructor
Creates a pseudolocalized backend that gets all its translations from ‘backend`.
-
#translate(locale, key, options = {}) ⇒ Object
Pseudolocalizes the translation returned from the actual backend.
Constructor Details
Instance Method Details
#translate(locale, key, options = {}) ⇒ Object
Pseudolocalizes the translation returned from the actual backend.
20 21 22 23 24 |
# File 'lib/rails/pseudoloc/backend.rb', line 20 def translate(locale, key, = {}) value = __getobj__.translate(locale, key, ) value.is_a?(String) ? @codec.encode(value) : value end |