Sha256: 18c892fbfad70ffaef71fd999b8a7eab38cb31f805a986335d15dd0246cd10dc

Contents?: true

Size: 271 Bytes

Versions: 58

Compression:

Stored size: 271 Bytes

Contents

module LocalizedName
  def localize(locale = I18n.locale)
    string = YAML.load(self)
    if string.is_a?(Hash) and string[locale.to_s]
      return string[locale.to_s]
    end
    self
  rescue NoMethodError
    self
  end
end

class String
  include LocalizedName
end

Version data entries

58 entries across 57 versions & 4 rubygems

Version Path
enju_seed-0.3.6 lib/enju_seed/localized_name.rb
enju_seed-0.3.5 lib/enju_seed/localized_name.rb
enju_seed-0.3.4 lib/enju_seed/localized_name.rb
enju_seed-0.3.3 lib/enju_seed/localized_name.rb
enju_seed-0.3.2 lib/enju_seed/localized_name.rb
enju_seed-0.3.1 lib/enju_seed/localized_name.rb
enju_seed-0.3.0 lib/enju_seed/localized_name.rb
enju_seed-0.3.0.rc.1 lib/enju_seed/localized_name.rb
enju_seed-0.3.0.beta.7 lib/enju_seed/localized_name.rb
enju_seed-0.3.0.beta.6 lib/enju_seed/localized_name.rb
enju_seed-0.2.3 lib/enju_seed/localized_name.rb
enju_seed-0.2.2 lib/enju_seed/localized_name.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_seed-0.2.1/lib/enju_seed/localized_name.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_seed-0.2.0/lib/enju_seed/localized_name.rb
enju_seed-0.2.1 lib/enju_seed/localized_name.rb
enju_seed-0.2.0 lib/enju_seed/localized_name.rb
enju_seed-0.2.0.beta.7 lib/enju_seed/localized_name.rb
enju_seed-0.2.0.beta.6 lib/enju_seed/localized_name.rb
enju_seed-0.2.0.beta.5 lib/enju_seed/localized_name.rb
enju_seed-0.2.0.beta.4 lib/enju_seed/localized_name.rb