Skip to content

Commit 07edb5e

Browse files
achmiralpacso
andauthored
Add Indonesian translations (#505)
* Add Indonesian translations * Reset locale to :en after tests Co-authored-by: Jon Pascoe <[email protected]>
1 parent ff84b75 commit 07edb5e

File tree

2 files changed

+344
-0
lines changed

2 files changed

+344
-0
lines changed

config/locales/id.yml

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
id:
2+
ice_cube:
3+
pieces_connector: ' / '
4+
not: 'kecuali %{target}'
5+
not_on: 'kecuali %{target}'
6+
date:
7+
formats:
8+
default: '%e %B %Y'
9+
times:
10+
other: '%{count} kali'
11+
one: '%{count} kali'
12+
until: 'sampai %{date}'
13+
days_of_week: '%{segments} %{day}'
14+
days_of_month:
15+
other: 'hari ke %{segments} dalam satu bulan'
16+
one: 'hari ke %{segments} dalam satu bulan'
17+
days_of_year:
18+
other: 'hari ke %{segments} dalam satu tahun'
19+
one: 'hari ke %{segments} dalam satu tahun'
20+
at_hours_of_the_day:
21+
other: pada jam %{segments} dalam satu hari
22+
one: pada jam %{segments} dalam satu hari
23+
on_minutes_of_hour:
24+
other: pada menit ke %{segments} dalam satu jam
25+
one: pada menit ke %{segments} dalam satu jam
26+
at_seconds_of_minute:
27+
other: pada %{segments} detik
28+
one: pada %{segments} detik
29+
on_seconds_of_minute:
30+
other: pada detik ke %{segments} dalam satu menit
31+
one: pada detik ke %{segments} dalam satu menit
32+
each_second:
33+
one: Setiap detik
34+
other: Setiap %{count} detik
35+
each_minute:
36+
one: Setiap menit
37+
other: Setiap %{count} menit
38+
each_hour:
39+
one: Setiap jam
40+
other: Setiap %{count} jam
41+
each_day:
42+
one: Setiap hari
43+
other: Setiap %{count} hari
44+
each_week:
45+
one: Setiap minggu
46+
other: Setiap %{count} minggu
47+
each_month:
48+
one: Setiap bulan
49+
other: Setiap %{count} bulan
50+
each_year:
51+
one: Setiap tahun
52+
other: Setiap %{count} tahun
53+
'on': pada %{sentence}
54+
in: 'pada %{target}'
55+
integer:
56+
negative: '%{ordinal} sampai akhir'
57+
literal_ordinals:
58+
1: pertama
59+
-1: terakhir
60+
-2: kedua sampai terakhir
61+
ordinal: '%{number}%{ordinal}'
62+
ordinals:
63+
default:
64+
on_weekends: pada akhir pekan
65+
on_weekdays: pada hari kerja
66+
days_on:
67+
- Hari minggu
68+
- Hari senin
69+
- Hari selasa
70+
- Hari rabu
71+
- Hari kamis
72+
- Hari jumat
73+
- Hari sabtu
74+
on_days: pada %{days}
75+
array:
76+
last_word_connector: ' dan '
77+
two_words_connector: ' dan '
78+
words_connector: ', '
79+
string:
80+
format:
81+
day: '%{rest} %{current}'
82+
day_of_week: '%{rest} %{current}'
83+
day_of_month: '%{rest} %{current}'
84+
day_of_year: '%{rest} %{current}'
85+
hour_of_day: '%{rest} %{current}'
86+
minute_of_hour: '%{rest} %{current}'
87+
until: '%{rest} %{current}'
88+
count: '%{rest} %{current}'
89+
default: '%{rest} %{current}'
90+
date:
91+
abbr_day_names:
92+
- Min
93+
- Sen
94+
- Sel
95+
- Rab
96+
- Kam
97+
- Jum
98+
- Sab
99+
abbr_month_names:
100+
-
101+
- Jan
102+
- Feb
103+
- Mar
104+
- Apr
105+
- Mei
106+
- Jun
107+
- Jul
108+
- Agu
109+
- Sep
110+
- Okt
111+
- Nov
112+
- Des
113+
day_names:
114+
- Minggu
115+
- Senin
116+
- Selasa
117+
- Rabu
118+
- Kamis
119+
- Jumat
120+
- Sabtu
121+
month_names:
122+
-
123+
- Januari
124+
- Februari
125+
- Maret
126+
- April
127+
- Mei
128+
- Juni
129+
- Juli
130+
- Agustus
131+
- September
132+
- Oktober
133+
- November
134+
- Desember

spec/examples/to_s_id_spec.rb

+210
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
require File.dirname(__FILE__) + "/../spec_helper"
2+
3+
describe IceCube::Schedule, "to_s" do
4+
before :each do
5+
I18n.locale = :id
6+
end
7+
8+
after :all do
9+
I18n.locale = :en
10+
end
11+
12+
it "should represent its start time by default" do
13+
t0 = Time.local(2013, 2, 14)
14+
expect(IceCube::Schedule.new(t0).to_s).to eq("14 Februari 2013")
15+
end
16+
17+
it "should have a useful base to_s representation for a secondly rule" do
18+
expect(IceCube::Rule.secondly.to_s).to eq("Setiap detik")
19+
expect(IceCube::Rule.secondly(2).to_s).to eq("Setiap 2 detik")
20+
end
21+
22+
it "should have a useful base to_s representation for a minutely rule" do
23+
expect(IceCube::Rule.minutely.to_s).to eq("Setiap menit")
24+
expect(IceCube::Rule.minutely(2).to_s).to eq("Setiap 2 menit")
25+
end
26+
27+
it "should have a useful base to_s representation for a hourly rule" do
28+
expect(IceCube::Rule.hourly.to_s).to eq("Setiap jam")
29+
expect(IceCube::Rule.hourly(2).to_s).to eq("Setiap 2 jam")
30+
end
31+
32+
it "should have a useful base to_s representation for a daily rule" do
33+
expect(IceCube::Rule.daily.to_s).to eq("Setiap hari")
34+
expect(IceCube::Rule.daily(2).to_s).to eq("Setiap 2 hari")
35+
end
36+
37+
it "should have a useful base to_s representation for a weekly rule" do
38+
expect(IceCube::Rule.weekly.to_s).to eq("Setiap minggu")
39+
expect(IceCube::Rule.weekly(2).to_s).to eq("Setiap 2 minggu")
40+
end
41+
42+
it "should have a useful base to_s representation for a monthly rule" do
43+
expect(IceCube::Rule.monthly.to_s).to eq("Setiap bulan")
44+
expect(IceCube::Rule.monthly(2).to_s).to eq("Setiap 2 bulan")
45+
end
46+
47+
it "should have a useful base to_s representation for a yearly rule" do
48+
expect(IceCube::Rule.yearly.to_s).to eq("Setiap tahun")
49+
expect(IceCube::Rule.yearly(2).to_s).to eq("Setiap 2 tahun")
50+
end
51+
52+
it "should work with various sentence types properly" do
53+
expect(IceCube::Rule.weekly.to_s).to eq("Setiap minggu")
54+
expect(IceCube::Rule.weekly.day(:monday).to_s).to eq("Setiap minggu pada Hari senin")
55+
expect(IceCube::Rule.weekly.day(:monday, :tuesday).to_s).to eq("Setiap minggu pada Hari senin dan Hari selasa")
56+
expect(IceCube::Rule.weekly.day(:monday, :tuesday, :wednesday).to_s).to eq("Setiap minggu pada Hari senin, Hari selasa dan Hari rabu")
57+
end
58+
59+
it "should show saturday and sunday as weekends" do
60+
expect(IceCube::Rule.weekly.day(:saturday, :sunday).to_s).to eq("Setiap minggu pada akhir pekan")
61+
end
62+
63+
it "should not show saturday and sunday as weekends when other days are present also" do
64+
expect(IceCube::Rule.weekly.day(:sunday, :monday, :saturday).to_s).to eq(
65+
"Setiap minggu pada Hari minggu, Hari senin dan Hari sabtu"
66+
)
67+
end
68+
69+
it "should reorganize days to be in order" do
70+
expect(IceCube::Rule.weekly.day(:tuesday, :monday).to_s).to eq(
71+
"Setiap minggu pada Hari senin dan Hari selasa"
72+
)
73+
end
74+
75+
it "should show weekdays as such" do
76+
expect(IceCube::Rule.weekly.day(
77+
:monday, :tuesday, :wednesday,
78+
:thursday, :friday
79+
).to_s).to eq("Setiap minggu pada hari kerja")
80+
end
81+
82+
it "should not show weekdays as such when a weekend day is present" do
83+
expect(IceCube::Rule.weekly.day(
84+
:sunday, :monday, :tuesday, :wednesday,
85+
:thursday, :friday
86+
).to_s).to eq("Setiap minggu pada Hari minggu, Hari senin, Hari selasa, Hari rabu, Hari kamis dan Hari jumat")
87+
end
88+
89+
it "should show start time for an empty schedule" do
90+
schedule = IceCube::Schedule.new Time.local(2010, 3, 20)
91+
expect(schedule.to_s).to eq("20 Maret 2010")
92+
end
93+
94+
it "should work with a single date" do
95+
schedule = IceCube::Schedule.new Time.local(2010, 3, 20)
96+
schedule.add_recurrence_time Time.local(2010, 3, 20)
97+
expect(schedule.to_s).to eq("20 Maret 2010")
98+
end
99+
100+
it "should work with additional dates" do
101+
schedule = IceCube::Schedule.new Time.local(2010, 3, 20)
102+
schedule.add_recurrence_time Time.local(2010, 3, 20)
103+
schedule.add_recurrence_time Time.local(2010, 3, 21)
104+
expect(schedule.to_s).to eq("20 Maret 2010 / 21 Maret 2010")
105+
end
106+
107+
it "should order dates that are out of order" do
108+
schedule = IceCube::Schedule.new Time.local(2010, 3, 20)
109+
schedule.add_recurrence_time Time.local(2010, 3, 19)
110+
expect(schedule.to_s).to eq("19 Maret 2010 / 20 Maret 2010")
111+
end
112+
113+
it "should remove duplicated start time" do
114+
schedule = IceCube::Schedule.new t0 = Time.local(2010, 3, 20)
115+
schedule.add_recurrence_time t0
116+
expect(schedule.to_s).to eq("20 Maret 2010")
117+
end
118+
119+
it "should remove duplicate rtimes" do
120+
schedule = IceCube::Schedule.new Time.local(2010, 3, 19)
121+
schedule.add_recurrence_time Time.local(2010, 3, 20)
122+
schedule.add_recurrence_time Time.local(2010, 3, 20)
123+
expect(schedule.to_s).to eq("19 Maret 2010 / 20 Maret 2010")
124+
end
125+
126+
it "should work with rules and dates" do
127+
schedule = IceCube::Schedule.new Time.local(2010, 3, 19)
128+
schedule.add_recurrence_time Time.local(2010, 3, 20)
129+
schedule.add_recurrence_rule IceCube::Rule.weekly
130+
expect(schedule.to_s).to eq("20 Maret 2010 / Setiap minggu")
131+
end
132+
133+
it "should work with rules and times and exception times" do
134+
schedule = IceCube::Schedule.new Time.local(2010, 3, 20)
135+
schedule.add_recurrence_rule IceCube::Rule.weekly
136+
schedule.add_recurrence_time Time.local(2010, 3, 20)
137+
schedule.add_exception_time Time.local(2010, 3, 20) # ignored
138+
schedule.add_exception_time Time.local(2010, 3, 21)
139+
expect(schedule.to_s).to eq("Setiap minggu / kecuali 20 Maret 2010 / kecuali 21 Maret 2010")
140+
end
141+
142+
it "should work with a single rule" do
143+
schedule = IceCube::Schedule.new Time.local(2010, 3, 20)
144+
schedule.add_recurrence_rule IceCube::Rule.weekly.day_of_week(monday: [1])
145+
expect(schedule.to_s).to eq(schedule.rrules[0].to_s)
146+
end
147+
148+
it "should be able to say the last Thursday of the month" do
149+
rule_str = IceCube::Rule.monthly.day_of_week(thursday: [-1]).to_s
150+
expect(rule_str).to eq("Setiap bulan pada terakhir Kamis")
151+
end
152+
153+
it "should be able to say what months of the year something happens" do
154+
rule_str = IceCube::Rule.yearly.month_of_year(:june, :july).to_s
155+
expect(rule_str).to eq("Setiap tahun pada Juni dan Juli")
156+
end
157+
158+
it "should be able to say the second to last monday of the month" do
159+
rule_str = IceCube::Rule.monthly.day_of_week(thursday: [-2]).to_s
160+
expect(rule_str).to eq("Setiap bulan pada kedua sampai terakhir Kamis")
161+
end
162+
163+
it "should join the first and last weekdays of the month" do
164+
rule_str = IceCube::Rule.monthly.day_of_week(thursday: [1, -1]).to_s
165+
expect(rule_str).to eq("Setiap bulan pada pertama Kamis dan terakhir Kamis")
166+
end
167+
168+
it "should be able to say the days of the month something happens" do
169+
rule_str = IceCube::Rule.monthly.day_of_month(1, 15, 30).to_s
170+
expect(rule_str).to eq("Setiap bulan pada hari ke pertama, 15 dan 30 dalam satu bulan")
171+
end
172+
173+
it "should be able to say what day of the year something happens" do
174+
rule_str = IceCube::Rule.yearly.day_of_year(30).to_s
175+
expect(rule_str).to eq("Setiap tahun pada hari ke 30 dalam satu tahun")
176+
end
177+
178+
it "should be able to say what hour of the day something happens" do
179+
rule_str = IceCube::Rule.daily.hour_of_day(6, 12).to_s
180+
expect(rule_str).to eq("Setiap hari pada jam 6 dan 12 dalam satu hari")
181+
end
182+
183+
it "should be able to say what minute of an hour something happens - with special suffix minutes" do
184+
rule_str = IceCube::Rule.hourly.minute_of_hour(10, 11, 12, 13, 14, 15).to_s
185+
expect(rule_str).to eq("Setiap jam pada menit ke 10, 11, 12, 13, 14 dan 15 dalam satu jam")
186+
end
187+
188+
it "should be able to say what seconds of the minute something happens" do
189+
rule_str = IceCube::Rule.minutely.second_of_minute(10, 11).to_s
190+
expect(rule_str).to eq("Setiap menit pada detik ke 10 dan 11 dalam satu menit")
191+
end
192+
193+
it "should be able to reflect until dates" do
194+
schedule = IceCube::Schedule.new(Time.now)
195+
schedule.rrule IceCube::Rule.weekly.until(Time.local(2012, 2, 3))
196+
expect(schedule.to_s).to eq("Setiap minggu sampai 3 Februari 2012")
197+
end
198+
199+
it "should be able to reflect count" do
200+
schedule = IceCube::Schedule.new(Time.now)
201+
schedule.add_recurrence_rule IceCube::Rule.weekly.count(1)
202+
expect(schedule.to_s).to eq("Setiap minggu 1 kali")
203+
end
204+
205+
it "should be able to reflect count (proper pluralization)" do
206+
schedule = IceCube::Schedule.new(Time.now)
207+
schedule.add_recurrence_rule IceCube::Rule.weekly.count(2)
208+
expect(schedule.to_s).to eq("Setiap minggu 2 kali")
209+
end
210+
end

0 commit comments

Comments
 (0)