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

Added Indonesian language #52

Merged
merged 3 commits into from
Nov 6, 2015
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ Currently we support following languages:
* [Norwegian](src/Coduo/PHPHumanizer/Resources/translations/difference.no.yml)
* [Afrikaans] (src/Coduo/PHPHumanizer/Resources/translations/difference.af.yml)
* [Bulgarian] (src/Coduo/PHPHumanizer/Resources/translations/difference.bg.yml)
* [Indonesian] (src/Coduo/PHPHumanizer/Resources/translations/difference.id.yml)

# Credits

Expand Down
35 changes: 35 additions & 0 deletions src/Coduo/PHPHumanizer/Resources/translations/difference.id.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
just_now:
past: "[0,Inf] baru saja"
future: "[0,Inf] baru saja"
second:
past: "{1} %count% detik yang lalu|[2,Inf] %count% detik yang lalu"
future: "{1} %count% detik dari sekarang|[2,Inf] %count% detik dari sekarang"
minute:
past: "{1} %count% menit yang lalu|[2,Inf] %count% menit yang lalu"
future: "{1} %count% menit dari sekarang|[2,Inf] %count% menit dari sekarang"
hour:
past: "{1} %count% jam yang lalu|[2,Inf] %count% jam yang lalu"
future: "{1} %count% jam dari sekarang|[2,Inf] %count% jam dari sekarang"
day:
past: "{1} %count% hari yang lalu|[2,Inf] %count% hari yang lalu"
future: "{1} %count% hari dari sekarang|[2,Inf] %count% hari dari sekarang"
week:
past: "{1} %count% minggu yang lalu|[2,Inf] %count% minggu yang lalu"
future: "{1} %count% minggu dari sekarang|[2,Inf] %count% minggu dari sekarang"
month:
past: "{1} %count% bulan yang lalu|[2,Inf] %count% bulan yang lalu"
future: "{1} %count% bulan dari sekarang|[2,Inf] %count% bulan dari sekarang"
year:
past: "{1} %count% tahun yang lalu|[2,Inf] %count% tahun yang lalu"
future: "{1} %count% tahun dari sekarang|[2,Inf] %count% tahun dari sekarang"

compound:
second: "{1} %count% detik|[2,Inf] %count% detik"
minute: "{1} %count% menit|[2,Inf] %count% menit"
hour: "{1} %count% jam|[2,Inf] %count% jam"
day: "{1} %count% hari|[2,Inf] %count% hari"
week: "{1} %count% minggu|[2,Inf] %count% minggu"
month: "{1} %count% bulan|[2,Inf] %count% bulan"
year: "{1} %count% tahun|[2,Inf] %count% tahun"
past: "%value% yang lalu"
future: "%value% dari sekarang"
3 changes: 3 additions & 0 deletions src/Coduo/PHPHumanizer/Resources/translations/oxford.id.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
only_two: "%first% dan %second%"
comma_separated: "%list%, dan %last%"
comma_separated_with_limit: "{1} %list%, dan 1 lainnya|[2,Inf] %list%, dan %count% lainnya"
7 changes: 7 additions & 0 deletions tests/Coduo/PHPHumanizer/Tests/CollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ public function oxfordCollectionProvider()
array(array("Michal", "Norbert", "Lukasz"), 2, 'ru', 'Michal, Norbert и ещё 1'),
array(array("Michal", "Norbert", "Lukasz", "Pawel"), 2, 'ru', 'Michal, Norbert и ещё 2'),
array(array("Michal", "Norbert", "Lukasz", "Pawel"), null, 'ru', 'Michal, Norbert, Lukasz и Pawel'),

// Indonesian
array(array("Michal"), null, 'id', 'Michal'),
array(array("Michal", "Norbert"), null, 'id', 'Michal dan Norbert'),
array(array("Michal", "Norbert", "Lukasz"), 2, 'id', 'Michal, Norbert, dan 1 lainnya'),
array(array("Michal", "Norbert", "Lukasz", "Pawel"), 2, 'id', 'Michal, Norbert, dan 2 lainnya'),
array(array("Michal", "Norbert", "Lukasz", "Pawel"), null, 'id', 'Michal, Norbert, Lukasz, dan Pawel'),
);
}
}
29 changes: 29 additions & 0 deletions tests/Coduo/PHPHumanizer/Tests/DateTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,25 @@ public function humanizeDataProvider()
array("2014-05-01", "2014-04-01", '1 месяц назад', 'ru'),
array("2015-05-01", "2014-04-01", '1 год назад', 'ru'),
array("2014-05-01", "2016-04-01", 'через 2 года', 'ru'),

// Indonesian
array("2014-04-26 13:00:00", "2014-04-26 13:00:00", 'baru saja', 'id'),
array("2014-04-26 13:00:00", "2014-04-26 13:00:05", '5 detik dari sekarang', 'id'),
array("2014-04-26 13:00:00", "2014-04-26 12:59:00", '1 menit yang lalu', 'id'),
array("2014-04-26 13:00:00", "2014-04-26 12:45:00", '15 menit yang lalu', 'id'),
array("2014-04-26 13:00:00", "2014-04-26 13:15:00", '15 menit dari sekarang', 'id'),
array("2014-04-26 13:00:00", "2014-04-26 14:00:00", '1 jam dari sekarang', 'id'),
array("2014-04-26 13:00:00", "2014-04-26 15:00:00", '2 jam dari sekarang', 'id'),
array("2014-04-26 13:00:00", "2014-04-26 12:00:00", '1 jam yang lalu', 'id'),
array("2014-04-26", "2014-04-25", '1 hari yang lalu', 'id'),
array("2014-04-26", "2014-04-24", '2 hari yang lalu', 'id'),
array("2014-04-26", "2014-04-28", '2 hari dari sekarang', 'id'),
array("2014-04-01", "2014-04-15", '2 minggu dari sekarang', 'id'),
array("2014-04-15", "2014-04-07", '1 minggu yang lalu', 'id'),
array("2014-01-01", "2014-04-01", '3 bulan dari sekarang', 'id'),
array("2014-05-01", "2014-04-01", '1 bulan yang lalu', 'id'),
array("2015-05-01", "2014-04-01", '1 tahun yang lalu', 'id'),
array("2014-05-01", "2016-04-01", '2 tahun dari sekarang', 'id'),
);
}

Expand Down Expand Up @@ -235,6 +254,16 @@ public function preciseDifferenceDataProvider()
array("2014-04-26 13:00:00", "2014-04-28 23:00:00", 'через 2 дня, 10 часов', 'ru'),
array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 день, 1 час, 40 минут назад', 'ru'),
array("2014-04-26 13:00:00", "2016-04-27 13:00:00", 'через 2 года, 1 день', 'ru'),

// Indonesian
array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 menit, 45 detik yang lalu', 'id'),
array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 jam, 40 menit yang lalu', 'id'),
array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 hari, 15 menit dari sekarang', 'id'),
array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 hari, 2 jam dari sekarang', 'id'),
array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 tahun, 2 hari, 4 jam dari sekarang', 'id'),
array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 hari, 10 jam dari sekarang', 'id'),
array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 hari, 1 jam, 40 menit yang lalu', 'id'),
array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 tahun, 1 hari dari sekarang', 'id'),
);
}
}