Skip to content

Switch workspace variant when app language changes #19288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

madsrasmussen
Copy link
Contributor

@madsrasmussen madsrasmussen commented May 9, 2025

Fixes #16853

@Copilot Copilot AI review requested due to automatic review settings May 9, 2025 12:48
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the document workspace editor to switch the workspace variant dynamically when the app language changes.

  • Added logic to obtain the active segment from the split view.
  • Created a new variant ID based on the new app language and active segment, and switched the variant accordingly.

@@ -32,6 +33,11 @@ export class UmbDocumentWorkspaceEditorElement extends UmbLitElement {
this.observe(this.#appLanguage?.appLanguageCulture, (appCulture) => {
this.#appCulture = appCulture;
this.#generateRoutes();
// If the global app language changes, we update the first split view editor to the new app language.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to only update if the left side panel was the old App Language?
Or update all splitViews that had the same Culture as the old?

Cause what if I ended up having it in reversed order?
And what if I was working with segments and wanted to change culture?

@madsrasmussen madsrasmussen marked this pull request as draft May 21, 2025 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot turn pages smoothly
2 participants