diff --git a/lib/dotiw/locale/it.yml b/lib/dotiw/locale/it.yml new file mode 100644 index 0000000..69146f2 --- /dev/null +++ b/lib/dotiw/locale/it.yml @@ -0,0 +1,24 @@ +it: + datetime: + dotiw: + seconds: + one: un secondo + other: "%{count} secondi" + minutes: + one: un minuto + other: "%{count} minuti" + hours: + one: una ora + other: "%{count} ore" + days: + one: un giorno + other: "%{count} giorni" + weeks: + one: una settimana + other: "%{count} settimane" + months: + one: un mese + other: "%{count} mesi" + years: + one: un anno + other: "%{count} anni" diff --git a/spec/lib/dotiw_spec.rb b/spec/lib/dotiw_spec.rb index 1b2f185..b3bbc15 100755 --- a/spec/lib/dotiw_spec.rb +++ b/spec/lib/dotiw_spec.rb @@ -81,6 +81,11 @@ expect(distance_of_time_in_words(START_TIME, START_TIME + 5.days, true, :locale => :es)).to eq("5 días") end + it "deve parlare l'italiano" do + expect(distance_of_time_in_words(START_TIME, START_TIME + 1.days, true, :locale => :it)).to eq("un giorno") + expect(distance_of_time_in_words(START_TIME, START_TIME + 5.days, true, :locale => :it)).to eq("5 giorni") + end + fragments = [ [START_TIME, START_TIME + 5.days + 3.minutes, "5 days and 3 minutes"], [START_TIME, START_TIME + 1.minute, "1 minute"],