From 38bc22377a66d24d3ebda915afa09e83cf3d8581 Mon Sep 17 00:00:00 2001 From: Norbert Orzechowicz Date: Mon, 26 Oct 2015 10:52:13 +0100 Subject: [PATCH] Fixed typo in TR translations and added spec --- spec/Coduo/PHPHumanizer/DateTimeSpec.php | 19 +++++++++++++++++++ .../Resources/translations/difference.tr.yml | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/spec/Coduo/PHPHumanizer/DateTimeSpec.php b/spec/Coduo/PHPHumanizer/DateTimeSpec.php index 7734a18..cb1bba6 100644 --- a/spec/Coduo/PHPHumanizer/DateTimeSpec.php +++ b/spec/Coduo/PHPHumanizer/DateTimeSpec.php @@ -117,4 +117,23 @@ function it_humanizes_precise_difference_between_dates_for_de_locale() $this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'de')->shouldReturn($example[2]); } } + + + function it_humanizes_precise_difference_between_dates_for_tr_locale() + { + $examples = array( + array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 dakika, 45 saniye önce'), + array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 saat, 40 dakika önce'), + array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 gün, 15 dakika sonra'), + array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 gün, 2 saat sonra'), + array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 yıl, 2 gün, 4 saat sonra'), + array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 gün, 10 saat sonra'), + array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 gün, 1 saat, 40 dakika önce'), + array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 yıl, 1 gün sonra'), + ); + + foreach ($examples as $example) { + $this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'tr')->shouldReturn($example[2]); + } + } } diff --git a/src/Coduo/PHPHumanizer/Resources/translations/difference.tr.yml b/src/Coduo/PHPHumanizer/Resources/translations/difference.tr.yml index 5bca49a..a283f2d 100644 --- a/src/Coduo/PHPHumanizer/Resources/translations/difference.tr.yml +++ b/src/Coduo/PHPHumanizer/Resources/translations/difference.tr.yml @@ -6,7 +6,7 @@ second: future: "{1} %count% saniye sonra|[2,Inf] %count% saniye sonra" minute: past: "{1} %count% dakika önce|[2,Inf] %count% dakika önce" - future: "{1} %count% dakika sonra|[2,Inf] %count% minutes dakika sonra" + future: "{1} %count% dakika sonra|[2,Inf] %count% dakika sonra" hour: past: "{1} %count% saat önce|[2,Inf] %count% saat önce" future: "{1} %count% saat sonra|[2,Inf] %count% saat sonra"