Skip to content

Commit

Permalink
Merge pull request #2825 from briannesbitt/fix/issue-2824-ms-before
Browse files Browse the repository at this point in the history
Change before Malay translation to "sebelum"
  • Loading branch information
kylekatarnls authored Jul 23, 2023
2 parents eeb761b + f4df5c0 commit 0dfb27d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Carbon/Lang/ms.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
'ago' => ':time yang lepas',
'from_now' => ':time dari sekarang',
'after' => ':time kemudian',
'before' => ':time lepas',
'before' => ':time sebelum',
'diff_now' => 'sekarang',
'diff_today' => 'Hari',
'diff_today_regexp' => 'Hari(?:\\s+ini)?(?:\\s+pukul)?',
Expand Down
21 changes: 16 additions & 5 deletions tests/CarbonPeriod/MacroTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,25 @@

class MacroTest extends AbstractTestCase
{
protected function tearDown(): void
private function setStaticProperty(string $class, string $property, $value): void
{
$reflection = new ReflectionClass($this->periodClass);
$reflection = new ReflectionClass($class);

if (PHP_VERSION >= 7.4) {
$reflection->setStaticPropertyValue($property, $value);

$macrosProperty = $reflection->getProperty('macros');
return;
}

$macrosProperty->setAccessible(true);
$macrosProperty->setValue([]);
$property = $reflection->getProperty($property);

$property->setAccessible(true);
$property->setValue($value);
}

protected function tearDown(): void
{
$this->setStaticProperty($this->periodClass, 'macros', []);

parent::tearDown();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Localization/MsBnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ class MsBnTest extends LocalizationTestCase
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true)
'1 saat kemudian',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond())
'1 saat lepas',
'1 saat sebelum',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true)
'1 saat lepas',
'1 saat sebelum',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true)
'1 saat',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true)
Expand Down
4 changes: 2 additions & 2 deletions tests/Localization/MsMyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ class MsMyTest extends LocalizationTestCase
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true)
'1 saat kemudian',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond())
'1 saat lepas',
'1 saat sebelum',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true)
'1 saat lepas',
'1 saat sebelum',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true)
'1 saat',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true)
Expand Down
4 changes: 2 additions & 2 deletions tests/Localization/MsSgTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ class MsSgTest extends LocalizationTestCase
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true)
'1 saat kemudian',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond())
'1 saat lepas',
'1 saat sebelum',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true)
'1 saat lepas',
'1 saat sebelum',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true)
'1 saat',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true)
Expand Down
4 changes: 2 additions & 2 deletions tests/Localization/MsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ class MsTest extends LocalizationTestCase
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true)
'1 saat kemudian',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond())
'1 saat lepas',
'1 saat sebelum',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true)
'1 saat lepas',
'1 saat sebelum',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true)
'1 saat',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true)
Expand Down

0 comments on commit 0dfb27d

Please sign in to comment.