Upgrade to 3.3.1
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Kirby\Cms;
|
||||
|
||||
use Exception;
|
||||
use Kirby\Data\Data;
|
||||
use Kirby\Toolkit\Str;
|
||||
|
||||
/**
|
||||
* Wrapper around Kirby's localization files,
|
||||
@@ -149,6 +150,21 @@ class Translation
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the PHP locale of the translation
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function locale(): string
|
||||
{
|
||||
$default = $this->code;
|
||||
if (Str::contains($default, '_') !== true) {
|
||||
$default .= '_' . strtoupper($this->code);
|
||||
}
|
||||
|
||||
return $this->get('translation.locale', $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the human-readable translation name.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user