fix translation
This commit is contained in:
1 parent
dc614c2545
commit
2a24232609
7 files changed
+13
-10
No files matched your search
+1
-1
@@ -47,7 +47,7 @@ return [
|
|||||||
'decade' => 'عشر سنوات',
|
'decade' => 'عشر سنوات',
|
||||||
'century' => 'مئة عام'
|
'century' => 'مئة عام'
|
||||||
],
|
],
|
||||||
'pharse' => [
|
'phrase' => [
|
||||||
'am' => 'ق ظ',
|
'am' => 'ق ظ',
|
||||||
'pm' => 'ب ظ',
|
'pm' => 'ب ظ',
|
||||||
'ante_meridiem' => 'صباحي',
|
'ante_meridiem' => 'صباحي',
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@ return [
|
|||||||
'decade' => 'decade',
|
'decade' => 'decade',
|
||||||
'century' => 'century'
|
'century' => 'century'
|
||||||
],
|
],
|
||||||
'pharse' => [
|
'phrase' => [
|
||||||
'am' => 'am',
|
'am' => 'am',
|
||||||
'pm' => 'pm',
|
'pm' => 'pm',
|
||||||
'ante_meridiem' => 'ante meridiem',
|
'ante_meridiem' => 'ante meridiem',
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@ return [
|
|||||||
'decade' => 'دهه',
|
'decade' => 'دهه',
|
||||||
'century' => 'قرن'
|
'century' => 'قرن'
|
||||||
],
|
],
|
||||||
'pharse' => [
|
'phrase' => [
|
||||||
'am' => 'ق ظ',
|
'am' => 'ق ظ',
|
||||||
'pm' => 'ب ظ',
|
'pm' => 'ب ظ',
|
||||||
'ante_meridiem' => 'قبل از ظهر',
|
'ante_meridiem' => 'قبل از ظهر',
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ return [
|
|||||||
'yaer' => 'سال',
|
'yaer' => 'سال',
|
||||||
'century' => 'قرن'
|
'century' => 'قرن'
|
||||||
],
|
],
|
||||||
'pharse' => [
|
'phrase' => [
|
||||||
'am' => 'ق ظ',
|
'am' => 'ق ظ',
|
||||||
'pm' => 'ب ظ',
|
'pm' => 'ب ظ',
|
||||||
'ante_meridiem' => 'قبل از ظهر',
|
'ante_meridiem' => 'قبل از ظهر',
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ trait Comparison
|
|||||||
*/
|
*/
|
||||||
public function isWeekend()
|
public function isWeekend()
|
||||||
{
|
{
|
||||||
return in_array($this->dayOfWeek, static::$weekEndsAt);
|
return in_array($this->dayOfWeek, static::$weekendDays);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ trait Formatting
|
|||||||
return ( $pYear . '-' . $pMonth . '-' . $pDay . ' ' . parent::format( 'H:i:s P' ) );
|
return ( $pYear . '-' . $pMonth . '-' . $pDay . ' ' . parent::format( 'H:i:s P' ) );
|
||||||
|
|
||||||
case 'r':
|
case 'r':
|
||||||
return ( substr(self::$messages['weekdays'][$gWeek], 0, 2 ) . '، ' . $pDay . ' ' . substr(self::$messages['year_months'][$pMonth], 0, 6 ) . ' ' . $pYear . ' ' . parent::format( 'H:i:s P' ) );
|
return ( substr(self::$messages['weekdays'][$pWeek], 0, 2 ) . '، ' . $pDay . ' ' . substr(self::$messages['year_months'][$pMonth], 0, 6 ) . ' ' . $pYear . ' ' . parent::format( 'H:i:s P' ) );
|
||||||
|
|
||||||
case 'U':
|
case 'U':
|
||||||
return $timestamp;
|
return $timestamp;
|
||||||
@@ -216,7 +216,10 @@ trait Formatting
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$output = $this->characterFormat($char, $timestamp, $pYear, $pMonth, $pDay, $pWeek);
|
$output = $this->characterFormat($char, $timestamp, $pYear, $pMonth, $pDay, $pWeek);
|
||||||
$result .= (string) new Notowo($output, static::getLocale() == 'en' ? 'en' : 'fa' );
|
if(is_numeric($output)) {
|
||||||
|
$output = (string) new Notowo($output, static::getLocale() == 'en' ? 'en' : 'fa' );
|
||||||
|
}
|
||||||
|
$result .= $output;
|
||||||
|
|
||||||
$index++;
|
$index++;
|
||||||
}
|
}
|
||||||
@@ -312,7 +315,6 @@ trait Formatting
|
|||||||
public function formatGregorian($format) {
|
public function formatGregorian($format) {
|
||||||
|
|
||||||
return $this->datetime()->format($format);
|
return $this->datetime()->format($format);
|
||||||
return $this->datetime()->format($format);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -385,7 +387,7 @@ trait Formatting
|
|||||||
static::DECADE_PER_CENTURY,
|
static::DECADE_PER_CENTURY,
|
||||||
];
|
];
|
||||||
$difference = $this->diffSeconds($v);
|
$difference = $this->diffSeconds($v);
|
||||||
$result .= static::$messages['phrase'][$difference < 0 ? 'later' : 'ago'];
|
$absolute = static::$messages['phrase'][$difference < 0 ? 'later' : 'ago'];
|
||||||
|
|
||||||
$difference = abs($difference);
|
$difference = abs($difference);
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ class FormatTest extends TestCase
|
|||||||
|
|
||||||
public function testFormatDifference()
|
public function testFormatDifference()
|
||||||
{
|
{
|
||||||
|
Verta::setLocale('fa');
|
||||||
$target = Verta::parse('1398-10-10 21:30:50');
|
$target = Verta::parse('1398-10-10 21:30:50');
|
||||||
|
|
||||||
$datetime = Verta::parse('1398-10-10 21:30:50');
|
$datetime = Verta::parse('1398-10-10 21:30:50');
|
||||||
@@ -115,7 +116,7 @@ class FormatTest extends TestCase
|
|||||||
|
|
||||||
public function testFormatWord()
|
public function testFormatWord()
|
||||||
{
|
{
|
||||||
$datetime = Verta::parse('1398-10-11 21:32:35')->formatWord('l dS F');
|
$datetime = Verta::parse('1398-10-11 21:32:35')->formatWord('l d S F');
|
||||||
|
|
||||||
$this->assertEquals('چهارشنبه یازده ام دی', $datetime);
|
$this->assertEquals('چهارشنبه یازده ام دی', $datetime);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user