- Issue created by @quietone
alexpott spotted this while reviewing this section from core/modules/views/src/Plugin/views/PluginBase.phpas part of π Fix 'Drupal.Semantics.FunctionT.NotLiteralString' coding standard Active .
if ($flags & LanguageInterface::STATE_SITE_DEFAULT) {
$name = $languages[LanguageInterface::LANGCODE_SITE_DEFAULT]->getName();
// The language name may have already been translated, no need to
// translate it again.
// @see Drupal\Core\Language::filterLanguages().
if (!$name instanceof TranslatableMarkup) {
// phpcs:ignore Drupal.Semantics.FunctionT.NotLiteralString
$name = $this->t($name);
}
The comment copied here for convenience,
This is highly suspect code. I think it is not necessary. Given the code in \Drupal\Core\Language\LanguageManager::filterLanguages() which this points to incorrectly. I think we should file a follow-up to look at this code. I think it is dead code.
I also think there is a bug in \Drupal\Core\Language\LanguageManager::filterLanguages() because I managed to make it return> $l['site_default']->getName(); = Drupal\Core\StringTranslation\TranslatableMarkup {#6621 markup: "Standardsprache der Website (German)", }
And it should not ever mix languages like that but this is not in scope here.
TBA
Investigate the code and decide on what to do
Active
11.0 π₯
Last updated