Problem/Motivation

If you are logged in to Umami as a user with English configured, the admin interface changes in to Spanish with no regard to your preferred language. And vice versa.

This is problematic as users will have a language they prefer to use for their admin interface, even if working on content in a different language. Changing this with content appears jarring, and may give the impression that is a limitation on Drupal's multilingual capability.

Proposed resolution

Change the configuration so that the admin interface uses the users' configured language, not the language of the content being viewed.
Ensure there are example users with obviously Spanish names who have Spanish as their configured language.
@ckrina has suggested:

  • Author: Gregorio Sánchez
  • Editor: María García

Remaining tasks

All the things.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.

Issue fork drupal-3061489

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Eli-T created an issue. See original summary.

Eli-T’s picture

Issue summary: View changes

Updated issue summary to not be nonsense.

Eli-T’s picture

Issue summary: View changes
betoscopio’s picture

Assigned: Unassigned » betoscopio
FileSize
1.13 KB

Here is a first patch, the configuration needed is saved in the file language.types.yml.
The patch is adding this config file to the install profile.

betoscopio’s picture

Assigned: betoscopio » Unassigned
FileSize
94.19 KB

After the add the the new file to the profile, the site got installed with the options on the picture for language negotiation, except for one:

Language negotiation

After the install, I am missing the URL detection method, for "Content language detection" (marked on red). If i select and save this option, the language negotiation works as expected.

Now I am just speculating, but this seems related with the order that the configuration is imported and other parts of the configuration are created.

shaal’s picture

I updated the views configuration, so when in English - will show homepage/recipes/articles/taxonomy in English, and when in Spanish will show all that content in Spanish.

I have the same issue as above, after changing the language negotiation settings according to the screenshot in #5 (Under content language detection - enable URL and disable Interface)
I run drush cex, copy the changes to Umami's installation file, and then install Umami from scratch with the new installation files, for some reason the language negotiation still missing URL and has Interface marked.

shaal’s picture

Status: Active » Needs work

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

alexpott’s picture

@shaal you're hitting #2613222: Language module shouldn't alter config in sync mode - with that patch the DemoUmamiProfileTest test becomes green.

shaal’s picture

Status: Needs work » Needs review
FileSize
299.76 KB

Thank you, this patch is finally working as it should when I apply the latest patch in #2613222: Language module shouldn't alter config in sync mode

Screenshot:

Berdir’s picture

FWIW, I'm not quite sure I see this as a problem that is (only) about umami. As mentioned before, I do find it quite interesting that multilingual UX becomes an issue through umami, but fixing it just there doesn't really help other installation profiles and more importantly, custom sites have good UX.

I get that umami should be a good out of the box experience, but then we should offer a good experience as well if people actually try to build sites and start with the standard profile.

There also have been issues open about stuff like this for a long time, because configuring it correctly isn't straight forward and people try to configure it in ways that doesn't work. For example #1125428: Language-specific aliases only work with url-based language negotiation, I once worked on that but then my issue turned out to be a different one. One thing that came of a discussion with plach about that issue is that our negotiation UI looks like you can configure dozens of different combinations and it all works, but really, only a few make sense, and things don't really work well if you configure it otherwise. For example, browser negotiation must be after URL negotiation, you kind of need a language prefix for all languages, combining session/user negotiation and url negotiation with prefixes/domains doesn't really make much sense and so on.

In our install profile, we have very similar configuration as this here, we weren't affected by the referenced issue because our multilingual configuration is in a separate, optional module that sets up that configuration in hook_install(). The one thing we do extra compared to this is to also enable browser language negotiation.

So maybe at least as a follow-up, we can open an issue to try and configure things better out of the box, and/or improve our UI to help users configure it correctly?

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

shaal’s picture

Title: Umami changes the admin interface language based on the current page » [P-1] Umami changes the admin interface language based on the current page
Status: Needs review » Postponed

This issue cannot be fixed until #2613222: Language module shouldn't alter config in sync mode is fixed.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

penyaskito’s picture

This needed a reroll. Attached patch. In conjunction with #2613222-39: Language module shouldn't alter config in sync mode works as expected.

Version: 10.1.x-dev » 11.x-dev

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 the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

penyaskito’s picture

Title: [P-1] Umami changes the admin interface language based on the current page » Umami changes the admin interface language based on the current page
Status: Postponed » Needs review

The blocker was merged and released already, so let's see if patch still applies.

needs-review-queue-bot’s picture

Status: Needs review » Needs work

The Needs Review Queue Bot tested this issue.

While you are making the above changes, we recommend that you convert this patch to a merge request. Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)

penyaskito’s picture

needs-review-queue-bot’s picture

Status: Needs review » Needs work
FileSize
3.77 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

penyaskito’s picture

Status: Needs work » Needs review

I've created the "spanish-speakers" author and editor. Had to fix the user creation logic a bit for allowing that. Thought about moving that info from hardcoded to a csv as we do with content, but probably overkill unless we need more custom data in the future.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
FileSize
4.33 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

penyaskito’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs tests

Left a comment on MR.

This feels like a bug though. Is it just Umami it's happening on or a bug with a core module? Believe we should have test coverage for the bug.

penyaskito’s picture

For the +Needs tests tag, I don't think we have that requirement on Umami.

penyaskito’s picture

@smustgrave

This feels like a bug though. Is it just Umami it's happening on or a bug with a core module? Believe we should have test coverage for the bug.

Not a bug, just different configuration defaults than standard profile. We want to demo in Umami that this is possible, but won't make sense to have that as default for e.g. the standard profile.

penyaskito’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests

From slack sounds like @markconroy doesn't think this needs tests

alexpott’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

@Berdir I agree that our language negotiation configuration form needs a lot of work but I don't think that should hold us back making umami a good example.

Committed 0e6acad and pushed to 11.x. Thanks!
Committed 1837cf5 and pushed to 10.3.x. Thanks!

  • alexpott committed 1837cf5b on 10.3.x
    Issue #3061489 by penyaskito, shaal, betoscopio, smustgrave: Umami...

  • alexpott committed 0e6acad4 on 11.x
    Issue #3061489 by penyaskito, shaal, betoscopio, smustgrave: Umami...

Status: Fixed » Closed (fixed)

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