Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Indonesian translations #505

Merged
merged 2 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 134 additions & 0 deletions config/locales/id.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
id:
ice_cube:
pieces_connector: ' / '
not: 'kecuali %{target}'
not_on: 'kecuali %{target}'
date:
formats:
default: '%e %B %Y'
times:
other: '%{count} kali'
one: '%{count} kali'
until: 'sampai %{date}'
days_of_week: '%{segments} %{day}'
days_of_month:
other: 'hari ke %{segments} dalam satu bulan'
one: 'hari ke %{segments} dalam satu bulan'
days_of_year:
other: 'hari ke %{segments} dalam satu tahun'
one: 'hari ke %{segments} dalam satu tahun'
at_hours_of_the_day:
other: pada jam %{segments} dalam satu hari
one: pada jam %{segments} dalam satu hari
on_minutes_of_hour:
other: pada menit ke %{segments} dalam satu jam
one: pada menit ke %{segments} dalam satu jam
at_seconds_of_minute:
other: pada %{segments} detik
one: pada %{segments} detik
on_seconds_of_minute:
other: pada detik ke %{segments} dalam satu menit
one: pada detik ke %{segments} dalam satu menit
each_second:
one: Setiap detik
other: Setiap %{count} detik
each_minute:
one: Setiap menit
other: Setiap %{count} menit
each_hour:
one: Setiap jam
other: Setiap %{count} jam
each_day:
one: Setiap hari
other: Setiap %{count} hari
each_week:
one: Setiap minggu
other: Setiap %{count} minggu
each_month:
one: Setiap bulan
other: Setiap %{count} bulan
each_year:
one: Setiap tahun
other: Setiap %{count} tahun
'on': pada %{sentence}
in: 'pada %{target}'
integer:
negative: '%{ordinal} sampai akhir'
literal_ordinals:
1: pertama
-1: terakhir
-2: kedua sampai terakhir
ordinal: '%{number}%{ordinal}'
ordinals:
default:
on_weekends: pada akhir pekan
on_weekdays: pada hari kerja
days_on:
- Hari minggu
- Hari senin
- Hari selasa
- Hari rabu
- Hari kamis
- Hari jumat
- Hari sabtu
on_days: pada %{days}
array:
last_word_connector: ' dan '
two_words_connector: ' dan '
words_connector: ', '
string:
format:
day: '%{rest} %{current}'
day_of_week: '%{rest} %{current}'
day_of_month: '%{rest} %{current}'
day_of_year: '%{rest} %{current}'
hour_of_day: '%{rest} %{current}'
minute_of_hour: '%{rest} %{current}'
until: '%{rest} %{current}'
count: '%{rest} %{current}'
default: '%{rest} %{current}'
date:
abbr_day_names:
- Min
- Sen
- Sel
- Rab
- Kam
- Jum
- Sab
abbr_month_names:
-
- Jan
- Feb
- Mar
- Apr
- Mei
- Jun
- Jul
- Agu
- Sep
- Okt
- Nov
- Des
day_names:
- Minggu
- Senin
- Selasa
- Rabu
- Kamis
- Jumat
- Sabtu
month_names:
-
- Januari
- Februari
- Maret
- April
- Mei
- Juni
- Juli
- Agustus
- September
- Oktober
- November
- Desember
210 changes: 210 additions & 0 deletions spec/examples/to_s_id_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
require File.dirname(__FILE__) + "/../spec_helper"

describe IceCube::Schedule, "to_s" do
before :each do
I18n.locale = :id
end

after :all do
I18n.locale = :en
end

it "should represent its start time by default" do
t0 = Time.local(2013, 2, 14)
expect(IceCube::Schedule.new(t0).to_s).to eq("14 Februari 2013")
end

it "should have a useful base to_s representation for a secondly rule" do
expect(IceCube::Rule.secondly.to_s).to eq("Setiap detik")
expect(IceCube::Rule.secondly(2).to_s).to eq("Setiap 2 detik")
end

it "should have a useful base to_s representation for a minutely rule" do
expect(IceCube::Rule.minutely.to_s).to eq("Setiap menit")
expect(IceCube::Rule.minutely(2).to_s).to eq("Setiap 2 menit")
end

it "should have a useful base to_s representation for a hourly rule" do
expect(IceCube::Rule.hourly.to_s).to eq("Setiap jam")
expect(IceCube::Rule.hourly(2).to_s).to eq("Setiap 2 jam")
end

it "should have a useful base to_s representation for a daily rule" do
expect(IceCube::Rule.daily.to_s).to eq("Setiap hari")
expect(IceCube::Rule.daily(2).to_s).to eq("Setiap 2 hari")
end

it "should have a useful base to_s representation for a weekly rule" do
expect(IceCube::Rule.weekly.to_s).to eq("Setiap minggu")
expect(IceCube::Rule.weekly(2).to_s).to eq("Setiap 2 minggu")
end

it "should have a useful base to_s representation for a monthly rule" do
expect(IceCube::Rule.monthly.to_s).to eq("Setiap bulan")
expect(IceCube::Rule.monthly(2).to_s).to eq("Setiap 2 bulan")
end

it "should have a useful base to_s representation for a yearly rule" do
expect(IceCube::Rule.yearly.to_s).to eq("Setiap tahun")
expect(IceCube::Rule.yearly(2).to_s).to eq("Setiap 2 tahun")
end

it "should work with various sentence types properly" do
expect(IceCube::Rule.weekly.to_s).to eq("Setiap minggu")
expect(IceCube::Rule.weekly.day(:monday).to_s).to eq("Setiap minggu pada Hari senin")
expect(IceCube::Rule.weekly.day(:monday, :tuesday).to_s).to eq("Setiap minggu pada Hari senin dan Hari selasa")
expect(IceCube::Rule.weekly.day(:monday, :tuesday, :wednesday).to_s).to eq("Setiap minggu pada Hari senin, Hari selasa dan Hari rabu")
end

it "should show saturday and sunday as weekends" do
expect(IceCube::Rule.weekly.day(:saturday, :sunday).to_s).to eq("Setiap minggu pada akhir pekan")
end

it "should not show saturday and sunday as weekends when other days are present also" do
expect(IceCube::Rule.weekly.day(:sunday, :monday, :saturday).to_s).to eq(
"Setiap minggu pada Hari minggu, Hari senin dan Hari sabtu"
)
end

it "should reorganize days to be in order" do
expect(IceCube::Rule.weekly.day(:tuesday, :monday).to_s).to eq(
"Setiap minggu pada Hari senin dan Hari selasa"
)
end

it "should show weekdays as such" do
expect(IceCube::Rule.weekly.day(
:monday, :tuesday, :wednesday,
:thursday, :friday
).to_s).to eq("Setiap minggu pada hari kerja")
end

it "should not show weekdays as such when a weekend day is present" do
expect(IceCube::Rule.weekly.day(
:sunday, :monday, :tuesday, :wednesday,
:thursday, :friday
).to_s).to eq("Setiap minggu pada Hari minggu, Hari senin, Hari selasa, Hari rabu, Hari kamis dan Hari jumat")
end

it "should show start time for an empty schedule" do
schedule = IceCube::Schedule.new Time.local(2010, 3, 20)
expect(schedule.to_s).to eq("20 Maret 2010")
end

it "should work with a single date" do
schedule = IceCube::Schedule.new Time.local(2010, 3, 20)
schedule.add_recurrence_time Time.local(2010, 3, 20)
expect(schedule.to_s).to eq("20 Maret 2010")
end

it "should work with additional dates" do
schedule = IceCube::Schedule.new Time.local(2010, 3, 20)
schedule.add_recurrence_time Time.local(2010, 3, 20)
schedule.add_recurrence_time Time.local(2010, 3, 21)
expect(schedule.to_s).to eq("20 Maret 2010 / 21 Maret 2010")
end

it "should order dates that are out of order" do
schedule = IceCube::Schedule.new Time.local(2010, 3, 20)
schedule.add_recurrence_time Time.local(2010, 3, 19)
expect(schedule.to_s).to eq("19 Maret 2010 / 20 Maret 2010")
end

it "should remove duplicated start time" do
schedule = IceCube::Schedule.new t0 = Time.local(2010, 3, 20)
schedule.add_recurrence_time t0
expect(schedule.to_s).to eq("20 Maret 2010")
end

it "should remove duplicate rtimes" do
schedule = IceCube::Schedule.new Time.local(2010, 3, 19)
schedule.add_recurrence_time Time.local(2010, 3, 20)
schedule.add_recurrence_time Time.local(2010, 3, 20)
expect(schedule.to_s).to eq("19 Maret 2010 / 20 Maret 2010")
end

it "should work with rules and dates" do
schedule = IceCube::Schedule.new Time.local(2010, 3, 19)
schedule.add_recurrence_time Time.local(2010, 3, 20)
schedule.add_recurrence_rule IceCube::Rule.weekly
expect(schedule.to_s).to eq("20 Maret 2010 / Setiap minggu")
end

it "should work with rules and times and exception times" do
schedule = IceCube::Schedule.new Time.local(2010, 3, 20)
schedule.add_recurrence_rule IceCube::Rule.weekly
schedule.add_recurrence_time Time.local(2010, 3, 20)
schedule.add_exception_time Time.local(2010, 3, 20) # ignored
schedule.add_exception_time Time.local(2010, 3, 21)
expect(schedule.to_s).to eq("Setiap minggu / kecuali 20 Maret 2010 / kecuali 21 Maret 2010")
end

it "should work with a single rule" do
schedule = IceCube::Schedule.new Time.local(2010, 3, 20)
schedule.add_recurrence_rule IceCube::Rule.weekly.day_of_week(monday: [1])
expect(schedule.to_s).to eq(schedule.rrules[0].to_s)
end

it "should be able to say the last Thursday of the month" do
rule_str = IceCube::Rule.monthly.day_of_week(thursday: [-1]).to_s
expect(rule_str).to eq("Setiap bulan pada terakhir Kamis")
end

it "should be able to say what months of the year something happens" do
rule_str = IceCube::Rule.yearly.month_of_year(:june, :july).to_s
expect(rule_str).to eq("Setiap tahun pada Juni dan Juli")
end

it "should be able to say the second to last monday of the month" do
rule_str = IceCube::Rule.monthly.day_of_week(thursday: [-2]).to_s
expect(rule_str).to eq("Setiap bulan pada kedua sampai terakhir Kamis")
end

it "should join the first and last weekdays of the month" do
rule_str = IceCube::Rule.monthly.day_of_week(thursday: [1, -1]).to_s
expect(rule_str).to eq("Setiap bulan pada pertama Kamis dan terakhir Kamis")
end

it "should be able to say the days of the month something happens" do
rule_str = IceCube::Rule.monthly.day_of_month(1, 15, 30).to_s
expect(rule_str).to eq("Setiap bulan pada hari ke pertama, 15 dan 30 dalam satu bulan")
end

it "should be able to say what day of the year something happens" do
rule_str = IceCube::Rule.yearly.day_of_year(30).to_s
expect(rule_str).to eq("Setiap tahun pada hari ke 30 dalam satu tahun")
end

it "should be able to say what hour of the day something happens" do
rule_str = IceCube::Rule.daily.hour_of_day(6, 12).to_s
expect(rule_str).to eq("Setiap hari pada jam 6 dan 12 dalam satu hari")
end

it "should be able to say what minute of an hour something happens - with special suffix minutes" do
rule_str = IceCube::Rule.hourly.minute_of_hour(10, 11, 12, 13, 14, 15).to_s
expect(rule_str).to eq("Setiap jam pada menit ke 10, 11, 12, 13, 14 dan 15 dalam satu jam")
end

it "should be able to say what seconds of the minute something happens" do
rule_str = IceCube::Rule.minutely.second_of_minute(10, 11).to_s
expect(rule_str).to eq("Setiap menit pada detik ke 10 dan 11 dalam satu menit")
end

it "should be able to reflect until dates" do
schedule = IceCube::Schedule.new(Time.now)
schedule.rrule IceCube::Rule.weekly.until(Time.local(2012, 2, 3))
expect(schedule.to_s).to eq("Setiap minggu sampai 3 Februari 2012")
end

it "should be able to reflect count" do
schedule = IceCube::Schedule.new(Time.now)
schedule.add_recurrence_rule IceCube::Rule.weekly.count(1)
expect(schedule.to_s).to eq("Setiap minggu 1 kali")
end

it "should be able to reflect count (proper pluralization)" do
schedule = IceCube::Schedule.new(Time.now)
schedule.add_recurrence_rule IceCube::Rule.weekly.count(2)
expect(schedule.to_s).to eq("Setiap minggu 2 kali")
end
end