diff -u b/core/modules/file/src/Entity/File.php b/core/modules/file/src/Entity/File.php --- b/core/modules/file/src/Entity/File.php +++ b/core/modules/file/src/Entity/File.php @@ -286,10 +286,9 @@ * disabled, the raw filename of the file. */ public function getTransliteratedFilename() { - // If the transliteration option is enabled, transliterate the filename. if (\Drupal::config('system.file')->get('filename_transliteration')) { - $langcode = $this->languageManager()->getCurrentLanguage()->getId(); + $langcode = $this->language()->getId(); // Transliterate and sanitize the destination filename. $filename = \Drupal::transliteration()