protected function LanguageSwitchingTest::saveNativeLanguageName in Drupal 10
Same name and namespace in other branches
- 8 core/modules/language/tests/src/Functional/LanguageSwitchingTest.php \Drupal\Tests\language\Functional\LanguageSwitchingTest::saveNativeLanguageName()
- 9 core/modules/language/tests/src/Functional/LanguageSwitchingTest.php \Drupal\Tests\language\Functional\LanguageSwitchingTest::saveNativeLanguageName()
Saves the native name of a language entity in configuration as a label.
Parameters
string $langcode: The language code of the language.
string $label: The native name of the language.
File
- core/
modules/ language/ tests/ src/ Functional/ LanguageSwitchingTest.php, line 456
Class
- LanguageSwitchingTest
- Functional tests for the language switching feature.
Namespace
Drupal\Tests\language\FunctionalCode
protected function saveNativeLanguageName($langcode, $label) {
\Drupal::service('language.config_factory_override')
->getOverride($langcode, 'language.entity.' . $langcode)
->set('label', $label)
->save();
}