Upgrade to 3.2.0
This commit is contained in:
@@ -10,19 +10,29 @@ use Kirby\Toolkit\F;
|
||||
* Provides a factory method to convert an array
|
||||
* to a collection of Translation objects and load
|
||||
* method to load all translations from disk
|
||||
*
|
||||
* @package Kirby Cms
|
||||
* @author Bastian Allgeier <bastian@getkirby.com>
|
||||
* @link https://getkirby.com
|
||||
* @copyright Bastian Allgeier GmbH
|
||||
* @license https://getkirby.com/license
|
||||
*/
|
||||
class Translations extends Collection
|
||||
{
|
||||
public function start(string $code)
|
||||
public function start(string $code): void
|
||||
{
|
||||
F::move($this->parent->contentFile('', true), $this->parent->contentFile($code, true));
|
||||
}
|
||||
|
||||
public function stop(string $code)
|
||||
public function stop(string $code): void
|
||||
{
|
||||
F::move($this->parent->contentFile($code, true), $this->parent->contentFile('', true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $translations
|
||||
* @return self
|
||||
*/
|
||||
public static function factory(array $translations)
|
||||
{
|
||||
$collection = new static;
|
||||
@@ -35,6 +45,11 @@ class Translations extends Collection
|
||||
return $collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $root
|
||||
* @param array $inject
|
||||
* @return self
|
||||
*/
|
||||
public static function load(string $root, array $inject = [])
|
||||
{
|
||||
$collection = new static;
|
||||
|
Reference in New Issue
Block a user