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

sachinsuryavanshi’s picture

Hello,

I did same exercise to regenerate this use case.

I have successfully changed Display to 'de'

  • Clear Browser cache
  • Try again
Anonymous’s picture

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.

sachinsuryavanshi’s picture

Try it on one more local setup just for testing, on my machine its working and i have changed it to de

Anonymous’s picture

It works with a brand new installation. That is strange. Well, thank you very much.

Ismail Cherri’s picture

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 a drush config-import to fix it

Anonymous’s picture

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.

Ismail Cherri’s picture

You need to run drush config-export to get these files in the configuration sync folder

Anonymous’s picture

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.

Ismail Cherri’s picture

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.

Anonymous’s picture

Thank you. The files seem to be right.

language.entity.de.yml

uuid: 12e76d77-baca-491e-a061-76b63145013a
langcode: de
status: true
dependencies: {  }
id: de
label: DE
direction: ltr
weight: 1
locked: false
language.entity.en.yml
uuid: a9f42cee-7324-4a2a-af82-e38536edd83a
langcode: en
status: true
dependencies: {  }
_core:
  default_config_hash: lBXDpdDPXQtrfTJQhr6MjRJJEEyYSoRJ0acdvHLsWeA
id: en
label: EN
direction: ltr
weight: 0
locked: false

There must be another problem. It's not the language alone. Please see my other post here:

Site name wrong displayed

Ismail Cherri’s picture

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.

Anonymous’s picture

  • I installed Drupal with German as main language. English as additional language. English was wrong translated.
  • I installed Drupal with English as main language. German as additional language. German was wrong translated.

I exported the full configuration.

../admin/config/development/configuration/full/export

I edited the wrong configuration

../language/your-additional-language/language.entity.your-additional-language

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

../admin/config/regional/language/edit/your-language

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:

https://www.drupal.org/node/1879930
Anonymous’s picture

I fixed it that way too!

gustavo.marcante’s picture

This problem stills happening, even with the updated versions of Drupal and the modules.
Any news?

Anonymous’s picture

It still happens but I fixed it following Ismail Cherri's suggestion: 

My last suggestion is to enable Configuration translation module from core and check the labels there.

Anonymous’s picture

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!

VM’s picture

The above should be raised as an issue in the EU cookie compliance module issue queue if it's changing default behavior.