Sha256: a3ec45e5b24fd28a098c5cb93efc74acae0f224415f75b0dc56fb417a4f25e34

Contents?: true

Size: 277 Bytes

Versions: 134

Compression:

Stored size: 277 Bytes

Contents

module LocalizedName
  def localize(locale = I18n.locale.to_s)
    values = Hash[*self.strip.split("\n").map{|n| n.split(':', 2)}.flatten]
    name = values[locale.to_s] || self
    name.strip
  rescue ArgumentError
    self
  end
end

class String
  include LocalizedName
end

Version data entries

134 entries across 134 versions & 5 rubygems

Version Path
enju_event-0.0.18 spec/dummy/lib/enju_leaf/localized_name.rb
enju_oai-0.0.3 spec/dummy/lib/enju_leaf/localized_name.rb
enju_event-0.0.17 spec/dummy/lib/enju_leaf/localized_name.rb
enju_event-0.1.5 spec/dummy/lib/enju_leaf/localized_name.rb
enju_event-0.0.16 spec/dummy/lib/enju_leaf/localized_name.rb
enju_message-0.1.2 spec/dummy/lib/enju_leaf/localized_name.rb
enju_message-0.0.19 spec/dummy/lib/enju_leaf/localized_name.rb
enju_message-0.1.1 spec/dummy/lib/enju_leaf/localized_name.rb
enju_subject-0.0.12 spec/dummy/lib/localized_name.rb
enju_circulation-0.0.33 spec/dummy/lib/enju_leaf/localized_name.rb
enju_event-0.1.4 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.32 spec/dummy/lib/enju_leaf/localized_name.rb
enju_message-0.1.0 spec/dummy/lib/enju_leaf/localized_name.rb
enju_event-0.1.3 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.31 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.30 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.29 spec/dummy/lib/enju_leaf/localized_name.rb
enju_message-0.0.18 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.28 spec/dummy/lib/enju_leaf/localized_name.rb
enju_message-0.0.17 spec/dummy/lib/enju_leaf/localized_name.rb