diff --git a/src/GoogleTranslate.php b/src/GoogleTranslate.php index 7bdc36d..832cd3a 100644 --- a/src/GoogleTranslate.php +++ b/src/GoogleTranslate.php @@ -336,7 +336,7 @@ protected function isValidLocale(string $lang) : bool return (bool) preg_match('/^([a-z]{2})(-[A-Z]{2})?$/', $lang); } - public function getLanguages($assoc = false) { + public static function getLanguages($assoc = false) { $file = __DIR__.'/languages.json'; $contents = file_get_contents($file); $languages = json_decode($contents, $assoc); @@ -344,8 +344,8 @@ public function getLanguages($assoc = false) { return $languages; } - public function getLanguage(string $lang) { - $languages = $this->getLanguages(true); + public static function getLanguage(string $lang) { + $languages = static::getLanguages(true); return $languages[$lang] ?? null; }