implement static localization generation

This commit is contained in:
Dennis Eichhorn 2020-02-08 12:52:42 +01:00
parent 8710adad62
commit 8b2b509c5c

View File

@ -160,6 +160,24 @@ class Localization
return $this->id;
}
/**
* Create localization from language code
*
* @param string $langCode Language code
* @param string $countryCode Country code
*
* @return Localization
*
* @since 1.0.0
*/
public static function fromLanguage(string $langCode, string $countryCode = '*') : self
{
$l11n = new self();
$l11n->loadFromLanguage($langCode, $countryCode);
return $l11n;
}
/**
* Load localization from language code
*