Sha256: 5bf4da89c1b0e819506c0515f2a072c1e4b8156b513e1d286cbe46c5b74401c1

Contents?: true

Size: 603 Bytes

Versions: 2

Compression:

Stored size: 603 Bytes

Contents

class Object
	def to_l string, binding = nil
		lang = RubyExt::Localization.language
		unless lang == RubyExt::Localization::DEFAULT_LANGUAGE
			aself = self.respond_to(:localization_self) || self
			aclass = (aself.class == Class or aself.class == Module) ? aself : aself.class						
			
			localization = aclass.localization lang
			if localization and localization.include? string
				string = localization[string]
			else				
				RubyExt::Localization.log.warn("Not localized: '#{aclass.name}' '#{string}'!")
			end		
		end
		
		string = string.substitute binding if binding
		return string
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
RubyExt-0.1.1 lib/RubyExt/Localization/Object.rb
RubyExt-0.1.2 lib/RubyExt/Localization/Object.rb