mirror of
https://github.com/getgrav/grav.git
synced 2026-07-07 18:11:45 +02:00
If the language name is region-specific (longer then 2 chars), then return it in a readable way, e.g. English (US) / English (GB)
This commit is contained in:
@@ -744,7 +744,11 @@ class LanguageCodes
|
||||
|
||||
public static function getNativeName($code)
|
||||
{
|
||||
return static::get($code, 'nativeName');
|
||||
if (strlen($code) == 2) {
|
||||
return static::get($code, 'nativeName');
|
||||
} else {
|
||||
return static::get(substr($code, 0, 2), 'nativeName') . ' (' . substr($code, -2) . ')';
|
||||
}
|
||||
}
|
||||
|
||||
public static function getNames(array $keys)
|
||||
|
||||
Reference in New Issue
Block a user