From 54c001dd6417ad6c4390a1c36029e3f78a25e08c Mon Sep 17 00:00:00 2001 From: Burak Ozdemir Date: Tue, 15 Jan 2019 02:54:50 +0300 Subject: [PATCH] added turkish language, replace multiple spaces instead of limiting by 2 --- src/ReadTime.php | 2 +- src/resources/lang/tr/read-time.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 src/resources/lang/tr/read-time.php diff --git a/src/ReadTime.php b/src/ReadTime.php index 45e4f37..53df638 100644 --- a/src/ReadTime.php +++ b/src/ReadTime.php @@ -141,7 +141,7 @@ protected function cleanContent($content): string */ protected function cleanReadTimeString($string): string { - return trim(str_replace(' ', ' ', $string)); + return trim(preg_replace('/\s+/u', ' ', $string)); } /** diff --git a/src/resources/lang/tr/read-time.php b/src/resources/lang/tr/read-time.php new file mode 100644 index 0000000..f1e3fc7 --- /dev/null +++ b/src/resources/lang/tr/read-time.php @@ -0,0 +1,10 @@ + true, + 'min' => 'dk', + 'minute' => 'dakika', + 'sec' => 'sn', + 'second' => 'saniye', + 'read' => 'okuma süresi' +];