Skip to content

Commit

Permalink
Merge pull request #67 from nwatth/thai-translation
Browse files Browse the repository at this point in the history
Thai translation
  • Loading branch information
Norbert Orzechowicz committed Dec 7, 2015
2 parents b364572 + cc2e2d7 commit 7c7e79d
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ Currently we support following languages:
* [Spanish] (src/Coduo/PHPHumanizer/Resources/translations/difference.es.yml)
* [Ukrainian] (src/Coduo/PHPHumanizer/Resources/translations/difference.uk.yml)
* [Danish] (src/Coduo/PHPHumanizer/Resources/translations/difference.da.yml)
* [Thai] (src/Coduo/PHPHumanizer/Resources/translations/difference.th.yml)

# Credits

Expand Down
35 changes: 35 additions & 0 deletions src/Coduo/PHPHumanizer/Resources/translations/difference.th.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
just_now:
past: "[0,Inf] เมื่อสักครู่"
future: "[0,Inf] เร็วๆนี้"
second:
past: "[1,Inf] %count% วินาทีที่แล้ว"
future: "[1,Inf] อีก %count% วินาที"
minute:
past: "[1,Inf] %count% นาทีที่แล้ว"
future: "[1,Inf] อีก %count% นาที"
hour:
past: "[1,Inf] %count% ชั่วโมงที่แล้ว"
future: "[1,Inf] อีก %count% ชั่วโมง"
day:
past: "[1,Inf] %count% วันที่แล้ว"
future: "[1,Inf] อีก %count% วัน"
week:
past: "[1,Inf] %count% สัปดาห์ที่แล้ว"
future: "[1,Inf] อีก %count% สัปดาห์"
month:
past: "[1,Inf] %count% เดือนที่แล้ว"
future: "[1,Inf] อีก %count% เดือน"
year:
past: "[1,Inf] %count% ปีที่แล้ว"
future: "[1,Inf] อีก %count% ปี"

compound:
second: "[1,Inf] %count% วินาที"
minute: "[1,Inf] %count% นาที"
hour: "[1,Inf] %count% ชั่วโมง"
day: "[1,Inf] %count% วัน"
week: "[1,Inf] %count% สัปดาห์"
month: "[1,Inf] %count% เดือน"
year: "[1,Inf] %count% ปี"
past: "%value%ที่แล้ว"
future: "อีก %value%"
3 changes: 3 additions & 0 deletions src/Coduo/PHPHumanizer/Resources/translations/oxford.th.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
only_two: "%first% และ %second%"
comma_separated: "%list% และ %last%"
comma_separated_with_limit: "{1} %list% และอีก 1|[2,Inf] %list% และอีก %count%"
7 changes: 7 additions & 0 deletions tests/Coduo/PHPHumanizer/Tests/CollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ public function oxfordCollectionProvider()
array(array("Michal", "Norbert", "Lukasz"), 2, 'uk', 'Michal, Norbert і ще 1'),
array(array("Michal", "Norbert", "Lukasz", "Pawel"), 2, 'uk', 'Michal, Norbert і ще 2'),
array(array("Michal", "Norbert", "Lukasz", "Pawel"), null, 'uk', 'Michal, Norbert, Lukasz та Pawel'),

// Thai
array(array("Michal"), null, 'th', 'Michal'),
array(array("Michal", "Norbert"), null, 'th', 'Michal และ Norbert'),
array(array("Michal", "Norbert", "Lukasz"), 2, 'th', 'Michal, Norbert และอีก 1'),
array(array("Michal", "Norbert", "Lukasz", "Pawel"), 2, 'th', 'Michal, Norbert และอีก 2'),
array(array("Michal", "Norbert", "Lukasz", "Pawel"), null, 'th', 'Michal, Norbert, Lukasz และ 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 @@ -212,6 +212,25 @@ public function humanizeDataProvider()
array("2014-05-01", "2014-04-01", "1 måned siden", "da"),
array("2015-05-01", "2014-04-01", "1 år siden", "da"),
array("2014-05-01", "2016-04-01", "2 år fra nu", "da"),

// Thai
array("2014-04-26 13:00:00", "2014-04-26 13:00:00", 'เมื่อสักครู่', 'th'),
array("2014-04-26 13:00:00", "2014-04-26 13:00:05", 'อีก 5 วินาที', 'th'),
array("2014-04-26 13:00:00", "2014-04-26 12:59:00", '1 นาทีที่แล้ว', 'th'),
array("2014-04-26 13:00:00", "2014-04-26 12:45:00", '15 นาทีที่แล้ว', 'th'),
array("2014-04-26 13:00:00", "2014-04-26 13:15:00", 'อีก 15 นาที', 'th'),
array("2014-04-26 13:00:00", "2014-04-26 14:00:00", 'อีก 1 ชั่วโมง', 'th'),
array("2014-04-26 13:00:00", "2014-04-26 15:00:00", 'อีก 2 ชั่วโมง', 'th'),
array("2014-04-26 13:00:00", "2014-04-26 12:00:00", '1 ชั่วโมงที่แล้ว', 'th'),
array("2014-04-26", "2014-04-25", '1 วันที่แล้ว', 'th'),
array("2014-04-26", "2014-04-24", '2 วันที่แล้ว', 'th'),
array("2014-04-26", "2014-04-28", 'อีก 2 วัน', 'th'),
array("2014-04-01", "2014-04-15", 'อีก 2 สัปดาห์', 'th'),
array("2014-04-15", "2014-04-07", '1 สัปดาห์ที่แล้ว', 'th'),
array("2014-01-01", "2014-04-01", 'อีก 3 เดือน', 'th'),
array("2014-05-01", "2014-04-01", '1 เดือนที่แล้ว', 'th'),
array("2015-05-01", "2014-04-01", '1 ปีที่แล้ว', 'th'),
array("2014-05-01", "2016-04-01", 'อีก 2 ปี', 'th'),
);
}

Expand Down Expand Up @@ -380,6 +399,16 @@ public function preciseDifferenceDataProvider()
array("2014-04-26 13:00:00", "2014-04-28 23:00:00", "2 dage, 10 timer fra nu", "da"),
array("2014-04-26 13:00:00", "2014-04-25 11:20:00", "1 dag, 1 time, 40 minutter siden", "da"),
array("2014-04-26 13:00:00", "2016-04-27 13:00:00", "2 år, 1 dag fra nu", "da"),

// Thai
array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 นาที, 45 วินาทีที่แล้ว', 'th'),
array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 ชั่วโมง, 40 นาทีที่แล้ว', 'th'),
array("2014-04-26 13:00:00", "2014-04-27 13:15:00", 'อีก 1 วัน, 15 นาที', 'th'),
array("2014-04-26 13:00:00", "2014-05-03 15:00:00", 'อีก 7 วัน, 2 ชั่วโมง', 'th'),
array("2014-04-26 13:00:00", "2015-04-28 17:00:00", 'อีก 1 ปี, 2 วัน, 4 ชั่วโมง', 'th'),
array("2014-04-26 13:00:00", "2014-04-28 23:00:00", 'อีก 2 วัน, 10 ชั่วโมง', 'th'),
array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 วัน, 1 ชั่วโมง, 40 นาทีที่แล้ว', 'th'),
array("2014-04-26 13:00:00", "2016-04-27 13:00:00", 'อีก 2 ปี, 1 วัน', 'th'),
);
}
}

0 comments on commit 7c7e79d

Please sign in to comment.