Upgrade to 3.3.1

This commit is contained in:
Bastian Allgeier
2019-11-26 11:04:08 +01:00
parent 23c67beafb
commit 3a82406bed
156 changed files with 437 additions and 121 deletions

View File

@@ -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.
*