Sha256: 817ac5fe628587e8f37cdea0799c7b4f013d42b180b1343e53dea4e3ce3780bd

Contents?: true

Size: 1003 Bytes

Versions: 17

Compression:

Stored size: 1003 Bytes

Contents

current_folder = File.dirname(__FILE__)
require File.join(current_folder,'..','..','spec_helper')


describe 'FastGettext::TranslationRepository::Po' do
  before do
    @rep = FastGettext::TranslationRepository.build('test',:path=>File.join(current_folder,'..','..','locale'),:type=>:po)
    @rep.is_a?(FastGettext::TranslationRepository::Po).should be_true
  end

  it "can be built" do
    @rep.available_locales.should == ['de','en']
  end

  it "can translate" do
    FastGettext.locale = 'de'
    @rep['car'].should == 'Auto'
  end

  it "can pluralize" do
    FastGettext.locale = 'de'
    @rep.plural('Axis','Axis').should == ['Achse','Achsen']
  end

  it "has access to the mo repositories pluralisation rule" do
    FastGettext.locale = 'en'
    rep = FastGettext::TranslationRepository.build('plural_test',:path=>File.join(current_folder,'..','..','locale'),:type=>:po)
    rep['car'].should == 'Test'#just check it is loaded correctly
    rep.pluralisation_rule.call(2).should == 3
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
grosser-fast_gettext-0.4.0 spec/fast_gettext/translation_repository/po_spec.rb
grosser-fast_gettext-0.4.10 spec/fast_gettext/translation_repository/po_spec.rb
grosser-fast_gettext-0.4.11 spec/fast_gettext/translation_repository/po_spec.rb
grosser-fast_gettext-0.4.12 spec/fast_gettext/translation_repository/po_spec.rb
grosser-fast_gettext-0.4.13 spec/fast_gettext/translation_repository/po_spec.rb
grosser-fast_gettext-0.4.14 spec/fast_gettext/translation_repository/po_spec.rb
grosser-fast_gettext-0.4.15 spec/fast_gettext/translation_repository/po_spec.rb
grosser-fast_gettext-0.4.16 spec/fast_gettext/translation_repository/po_spec.rb
grosser-fast_gettext-0.4.2 spec/fast_gettext/translation_repository/po_spec.rb
grosser-fast_gettext-0.4.3 spec/fast_gettext/translation_repository/po_spec.rb
grosser-fast_gettext-0.4.4 spec/fast_gettext/translation_repository/po_spec.rb
grosser-fast_gettext-0.4.5 spec/fast_gettext/translation_repository/po_spec.rb
grosser-fast_gettext-0.4.7 spec/fast_gettext/translation_repository/po_spec.rb
grosser-fast_gettext-0.4.8 spec/fast_gettext/translation_repository/po_spec.rb
grosser-fast_gettext-0.4.9 spec/fast_gettext/translation_repository/po_spec.rb
fast_gettext-0.4.17 spec/fast_gettext/translation_repository/po_spec.rb
fast_gettext-0.4.16 spec/fast_gettext/translation_repository/po_spec.rb