Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Anonymous (not verified) on
Hello, I am building a bilingual website. I changed the language display here and there:
../admin/config/regional/language/edit/en
English to en
../admin/config/regional/language/edit/de
Deutsch to de
Now, English is shown as en but Deutsch is still shown as Deutsch. I ran cron and cleared the cache but it didn't help. Does anybody know why the language display of my language switcher is still wrong?
Comments
Not for me
Hello,
I did same exercise to regenerate this use case.
I have successfully changed Display to 'de'
English is working
Well, me too. English is working. I changed English to en and it is displayed correctly. Deutsch is still Deutsch though I changed it to de.
try it on local
Try it on one more local setup just for testing, on my machine its working and i have changed it to de
Yes, you're right.
It works with a brand new installation. That is strange. Well, thank you very much.
This is due to configuration
This is due to configuration translation is not written correctly. I had the same issue which I solved by manually editing
/config/sync/language/en/language.entity.en.yml
file to change the language label to en then did adrush config-import
to fix itWhere is that file?
I cannot locate it in my installation.
I just installed Drupal another time and the problem recurred. English is displayed as EN while Deutsch is wrong displayed as Deutsch.
You need to run drush config
You need to run
drush config-export
to get these files in the configuration sync folderNever used Drush
I have never used Drush. Do I have to install it? Or do I just open that Terminal and type in the command? In order to use Composer or Drush online, I have to rent a whole server, my webhosting service told me. That's why I prefer to manually install everything! At the moment, I work locally.
Ok, no problem. In this case,
Ok, no problem. In this case, go to
/admin/config/development/configuration/full/export
and export a full zip.Extract the zip, you'll find the files I mentioned among them. Edit the file, compress the folders again, then do and import.
Hope that helps.
There must be another problem
Thank you. The files seem to be right.
There must be another problem. It's not the language alone. Please see my other post here:
My last suggestion is to
My last suggestion is to enable Configuration translation module from core and check the labels there. I had the exact same issue and I fixed it this way. Good luck.
Well, it's the second language installed.
I exported the full configuration.
I edited the wrong configuration
and imported the edited configuration. I ran cron and cleared the cache. Nothing changed. The problem reoccurred.
I installed Drupal again. Just enabled Content Translation. Edited the language names
and was able to change these. It worked well. The desired language names show up. I enabled Configuration Translation and translated the language names. The translated language names don't show up. This is the bug. It isn't possible to display the translated language names.
I guess this issue is reported here:
Thanks
I fixed it that way too!
Any news?
This problem stills happening, even with the updated versions of Drupal and the modules.
Any news?
No news
It still happens but I fixed it following Ismail Cherri's suggestion:
EU Cookie Compliance
Since I installed the EU Cookie Compliance module, the language names of my language switcher are wrong again. They used to be 'de' (for German, default) and 'en' (for English). Now, English appears as 'English' and I cannot change it using the configuration translation. The website design is broken now since it displays 'de' for German and 'English' for English. Please help!
=-=
The above should be raised as an issue in the EU cookie compliance module issue queue if it's changing default behavior.