Sha256: 679e0b553ae64a0cad16ffc0e8cd50477214c37978b9945d9ccd3a75f75dc36f

Contents?: true

Size: 617 Bytes

Versions: 28

Compression:

Stored size: 617 Bytes

Contents

require 'benchmark/base'

$LOAD_PATH.unshift 'lib'

module FastestGettext
  def set_domain(folder,domain,locale)
    @data = {}
    require 'fast_gettext/vendor/mofile'
    FastGettext::GetText::MOFile.open(File.join(folder,locale,'LC_MESSAGES',"#{domain}.mo"), "UTF-8").each{|k,v|@data[k]=v}
  end
  def _(word)
    @data[word]
  end
end


include FastestGettext
set_domain(locale_folder('test'),'test','de')
puts "Ideal: (primitive Hash lookup)"
results_test{_('car') == 'Auto'}

#i cannot add the large file, since its an internal applications mo file
set_domain(locale_folder('large'),'large','de')
results_large

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
fast_gettext-0.8.1 benchmark/ideal.rb
fast_gettext-0.8.0 benchmark/ideal.rb
fast_gettext-0.7.1 benchmark/ideal.rb
fast_gettext-0.7.0 benchmark/ideal.rb
fast_gettext-0.6.12 benchmark/ideal.rb
fast_gettext-0.6.11 benchmark/ideal.rb
fast_gettext-0.6.10 benchmark/ideal.rb
fast_gettext-0.6.9 benchmark/ideal.rb
fast_gettext-0.6.8 benchmark/ideal.rb
fast_gettext-0.6.7 benchmark/ideal.rb
fast_gettext-0.6.6 benchmark/ideal.rb
fast_gettext-0.6.5 benchmark/ideal.rb
fast_gettext-0.6.4 benchmark/ideal.rb
fast_gettext-0.6.3 benchmark/ideal.rb
fast_gettext-0.6.2 benchmark/ideal.rb
fast_gettext-0.6.1 benchmark/ideal.rb
fast_gettext-0.6.0 benchmark/ideal.rb
fast_gettext-0.5.13 benchmark/ideal.rb
fast_gettext-0.5.12 benchmark/ideal.rb
fast_gettext-0.5.11 benchmark/ideal.rb