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_circulation-0.0.71 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.70 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.69 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.68 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.67 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.66 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.65 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.64 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.63 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.62 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.61 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.60 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.59 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.58 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.57 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.56 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.55 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.54 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.53 spec/dummy/lib/enju_leaf/localized_name.rb
enju_circulation-0.0.52 spec/dummy/lib/enju_leaf/localized_name.rb