getLocale() . '.json'); return File::exists($path) ? json_decode(File::get($path), true) : []; }; if (is_null($key)) { return $key; } if (is_string($key)) { $value = $key; $key = mb_strtolower($key); $all = $allDefinedTranslation(); if (!array_key_exists($key, $all)) { $all[$key] = $value; $path = lang_path(app()->getLocale() . '.json'); File::put($path, json_encode($all, JSON_PRETTY_PRINT)); } } return trans($key, $replace, $locale); } }