Merge pull request #57 from WinterSilence/patch-5

Translate default text of `NavBar::$screenReaderToggleText`
This commit is contained in:
simialbi 2022-11-15 09:24:29 +01:00 committed by GitHub
commit 0648a246e0
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.
*/
public $screenReaderToggleText = 'Toggle navigation';
public $screenReaderToggleText;
/**
* @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' => [
'controls' => $aria,
'expanded' => 'false',
'label' => $this->screenReaderToggleText,
'label' => $this->screenReaderToggleText ?: Yii::t('yii/bootstrap5', 'Toggle navigation'),
]
])
);