I think it makes no sense to display a link for a page in the current language. This reloads the page when accidentally clicked and adds an extra link to the current page in the markup. At the same time, there may be needed to display the name of the current language with the text only.

Comments

Skymen created an issue. See original summary.

skymen’s picture

Status: Active » Needs review
StatusFileSize
new4.51 KB

I have added this functionality. Please, test it and review.

skymen’s picture

StatusFileSize
new39.58 KB

Picture with changes in UI.
UI

szeidler’s picture

Status: Needs review » Needs work

Hi,

thanks for your contribution. I just had a short glance for now and it looks quite good.

But just one initial thought: We need to implement an update hook that reflects the schema change, so that sites, that previously had enabled the "Hide current language" checkbox will have the correct current_language_mode selected after the update.

szeidler’s picture

Status: Needs work » Needs review
StatusFileSize
new5.19 KB
new1.47 KB

Here's a patch adding an update hook to transform the hide_current_language to current_language_mode with hide_link.

I also changed the default value of the new select field to "default" to match the naming convention we use for the other select, too.

szeidler’s picture

StatusFileSize
new5.18 KB
new565 bytes

Here's an updated patch using dependency injection to follow the recently committed #3091592: Use dependency injection for LanguageManager in LanguageSwitcherLinkProcessor

skymen’s picture

@szeidler Thanks! Patch works good on Drupal 9.0.0-beta2. RTBC+1

skymen’s picture

Status: Needs review » Reviewed & tested by the community

@szeidler As I see you already includes this functionality to beta version. So I think we can close this issue?

skymen’s picture

Assigned: skymen » Unassigned
szeidler’s picture

As I see you already includes this functionality to beta version. So I think we can close this issue?

I might miss a thing here, but this is not yet merged into the dev-branch or a release. I will give it another look soon.

vegardjo’s picture

Tested on Drupal 8.9.6 and works like a charm!

szeidler’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new7.76 KB

Also added tests. Let's see what testbot things. If it goes green we can commit it.

szeidler’s picture

Status: Needs review » Reviewed & tested by the community

  • szeidler committed 72fdbce on 8.x-1.x
    Issue #3122847 by szeidler, Skymen, vegardjo: Add functionality for...
szeidler’s picture

Status: Reviewed & tested by the community » Fixed

This is pushed to 8.x-dev and will be part of the next release.

Thanks for everyone contributed here!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.