Repository: briannesbitt/Carbon (php)

Issue:
[Translation tool] ms
|English|ms|comments|
|--|--|--|
|2 hours before|2 jam lepas|This should rather be '2 jam sebelum' because 'lepas' means 'after'. Refer: The [official dictionary](https://prpm.dbp.gov.my/Cari1?keyword=sebelum)|


Pull request:
Change before Malay translation to "sebelum"
Fix #2824

Patch:
diff --git a/src/Carbon/Lang/ms.php b/src/Carbon/Lang/ms.php
index 36934eeb..c9e80854 100644
--- a/src/Carbon/Lang/ms.php
+++ b/src/Carbon/Lang/ms.php
@@ -48,7 +48,7 @@ return [
     '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)?',


Test patch:
diff --git a/tests/CarbonPeriod/MacroTest.php b/tests/CarbonPeriod/MacroTest.php
index 21f9d7b1..dc0ce1df 100644
--- a/tests/CarbonPeriod/MacroTest.php
+++ b/tests/CarbonPeriod/MacroTest.php
@@ -25,14 +25,25 @@ use Tests\CarbonPeriod\Fixtures\MixinTrait;
 
 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();
     }
diff --git a/tests/Localization/MsBnTest.php b/tests/Localization/MsBnTest.php
index c971be35..ee3b7869 100644
--- a/tests/Localization/MsBnTest.php
+++ b/tests/Localization/MsBnTest.php
@@ -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)
diff --git a/tests/Localization/MsMyTest.php b/tests/Localization/MsMyTest.php
index 75e05721..e0b5726d 100644
--- a/tests/Localization/MsMyTest.php
+++ b/tests/Localization/MsMyTest.php
@@ -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)
diff --git a/tests/Localization/MsSgTest.php b/tests/Localization/MsSgTest.php
index f213060a..c1b14051 100644
--- a/tests/Localization/MsSgTest.php
+++ b/tests/Localization/MsSgTest.php
@@ -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)
diff --git a/tests/Localization/MsTest.php b/tests/Localization/MsTest.php
index c650c243..f84f378e 100644
--- a/tests/Localization/MsTest.php
+++ b/tests/Localization/MsTest.php
@@ -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)