Translate default text of NavBar::$screenReaderToggleText

This commit is contained in:
Anton 2022-10-21 04:22:20 +03:00 committed by GitHub
parent db6208a2d7
commit e88c5ebd96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,7 +90,7 @@ class NavBar extends Widget
/** /**
* @var string text to show for screen readers for the button to toggle the navbar. * @var string text to show for screen readers for the button to toggle the navbar.
*/ */
public $screenReaderToggleText = 'Toggle navigation'; public $screenReaderToggleText;
/** /**
* @var string the toggle button content. Defaults to bootstrap 5 default `<span class="navbar-toggler-icon"></span>` * @var string the toggle button content. Defaults to bootstrap 5 default `<span class="navbar-toggler-icon"></span>`
*/ */
@ -229,7 +229,7 @@ class NavBar extends Widget
'aria' => [ 'aria' => [
'controls' => $aria, 'controls' => $aria,
'expanded' => 'false', 'expanded' => 'false',
'label' => $this->screenReaderToggleText, 'label' => $this->screenReaderToggleText ?: Yii::t('yii/bootstrap5', 'Toggle navigation'),
] ]
]) ])
); );