- Issue created by @kristiaanvandeneynde
- π§πͺBelgium kristiaanvandeneynde Antwerp, Belgium
Changing title to be more specific
- Status changed to Closed: works as designed
over 1 year ago 10:54pm 6 December 2023 - π©πͺGermany sleitner
setConfigOverrideLanguage does only change the config language. It doesn't change the interface and content language.
- Status changed to Active
over 1 year ago 9:21am 7 December 2023 - π§πͺBelgium kristiaanvandeneynde Antwerp, Belgium
Yes I know, yet the documentation specifies "current language" rather than "default language', which is ambiguous.
- π©πͺGermany sleitner
Do you have the problem without using
\Drupal::languageManager()->setConfigOverrideLanguage()
? - π§πͺBelgium kristiaanvandeneynde Antwerp, Belgium
Yes, as I wrote in the first paragraph of the issue summary :)
Drupal core is moving towards using a βmainβ branch. As an interim step, a new 11.x branch has been opened β , as Drupal.org infrastructure cannot currently fully support a branch named
main
. New developments and disruptive changes should now be targeted for the11.x
branch. For more information, see the Drupal core minor version schedule β and the Allowed changes during the Drupal core release cycle β .- π©πͺGermany sleitner
Everything you are translating with
|t
,t()
,TranslatableMarkup
is translated with the current interface language.
Look in/admin/config/regional/language/detection
how the interface language is negotiated. If you have custom language negotiators installed or custom settings insettings.php
or simular, these might interfere your interface language as well.The
config language
,content language
andurl language
are independent from this and have their own negotiators.If you set the config language with
setConfigOverrideLanguage()
, you only change the config language for reading and writing to the translated config settings https://www.drupal.org/docs/drupal-apis/configuration-api/simple-configu... β - π©πͺGermany stmh
There is currently no way to modify the interface language similar to what you can do with overriding the config language.
Think of a twig template for rendering content (of a specific content language) for e.g. a PDF (which has some static, translated interface-strings in it using the t-filter), and you want to use a different language from the current interface language. E.g. my interface language is en, but the content is de, and I want the rendered PDF in interface language de.