Move prompt to lang

Move default prompt text to i18n file.
This commit is contained in:
Piotr Karecki 2019-10-11 20:12:08 +02:00 committed by GitHub
parent c1fe12f732
commit 06b7031131
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -21,7 +21,7 @@ class Repeater extends FormWidgetBase
/** /**
* @var string Prompt text for adding new items. * @var string Prompt text for adding new items.
*/ */
public $prompt = 'Add new item'; public $prompt;
/** /**
* @var bool Items can be sorted. * @var bool Items can be sorted.
@ -97,6 +97,8 @@ class Repeater extends FormWidgetBase
*/ */
public function init() public function init()
{ {
$this->prompt = Lang::get('backend::lang.repeater.add_new_item');
$this->fillFromConfig([ $this->fillFromConfig([
'form', 'form',
'prompt', 'prompt',

View File

@ -239,6 +239,7 @@ return [
'remove_file' => 'Remove file' 'remove_file' => 'Remove file'
], ],
'repeater' => [ 'repeater' => [
'add_new_item' => 'Add new item',
'min_items_failed' => ':name requires a minimum of :min items, only :items were provided', 'min_items_failed' => ':name requires a minimum of :min items, only :items were provided',
'max_items_failed' => ':name only allows up to :max items, :items were provided', 'max_items_failed' => ':name only allows up to :max items, :items were provided',
], ],