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