Sha256: d1f7a23fe5013a5a2fed6f418bfab88070e2f3bb21679a29a0531d308010d06c
Contents?: true
Size: 778 Bytes
Versions: 27
Compression:
Stored size: 778 Bytes
Contents
module I18n module_function def locale=(new_locale) FastGettext.locale = new_locale end def locale FastGettext.locale.to_sym end # since Rails 2.3.8 a config object is used instead of just .locale if defined? Config class Config def locale FastGettext.locale.to_sym end def locale=(new_locale) FastGettext.locale=(new_locale) end end end # backport I18n.with_locale if it does not exist unless respond_to?(:with_locale) # Executes block with given I18n.locale set. def with_locale(tmp_locale = nil) if tmp_locale current_locale = self.locale self.locale = tmp_locale end yield ensure self.locale = current_locale if tmp_locale end end end
Version data entries
27 entries across 27 versions & 2 rubygems