Skip to content
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

The settings page does not support internationalization #13802

Closed
fly-bue opened this issue Jun 12, 2024 · 3 comments · Fixed by #13819
Closed

The settings page does not support internationalization #13802

fly-bue opened this issue Jun 12, 2024 · 3 comments · Fixed by #13819
Labels
localization issues related to localization/internalization/nls
Milestone

Comments

@fly-bue
Copy link

fly-bue commented Jun 12, 2024

Bug Description:

I found that internationalization was not implemented in the preference-tree-widget.ts and preference-node-renderer.ts files, and I tried to solve this problem. As follows:

  // preference-tree-widget.ts
  protected override toNodeName(node: TreeNode): string {
   const visibleChildren = this.model.currentRows.get(node.id)?.visibleChildren;
       // todo
        const baseName = nls.localizeByDefault(this.labelProvider.getName(node));
        const printedNameWithVisibleChildren = this.model.isFiltered && visibleChildren !== undefined
            ? `${baseName} (${visibleChildren})`
            : baseName;
        return printedNameWithVisibleChildren;
    }

  // preference-node-renderer.ts
 protected createDomNode(): HTMLElement {
        const wrapper = document.createElement('ul');
        wrapper.className = 'settings-section';
        wrapper.id = `${this.preferenceNode.id}-editor`;
        const isCategory = Preference.TreeNode.isTopLevel(this.preferenceNode);
        const hierarchyClassName = isCategory ? HEADER_CLASS : SUBHEADER_CLASS;
        // todo
        const name = nls.localizeByDefault(this.labelProvider.getName(this.preferenceNode));
        const label = document.createElement('li');
        label.classList.add('settings-section-title', hierarchyClassName);
        label.textContent = name;
        wrapper.appendChild(label);
        return wrapper;
    }

image
When does the team plan to support internationalization of the settings page?

Steps to Reproduce:

image

Additional Information

Operating System: Windows 11
Theia Version: master

@msujew
Copy link
Member

msujew commented Jun 12, 2024

Hey @fly-bue,

the main issue is that these names are dynamically generated from the IDs/names of the preferences. They're not real named groups. VS Code also struggles with this, and AFAIK also doesn't translate the names of the preference groups.

However, we can maintain a list of translations for known groups. Note that the preferences contributed by plugins won't have a translated group name.

@msujew msujew added the localization issues related to localization/internalization/nls label Jun 12, 2024
@fly-bue
Copy link
Author

fly-bue commented Jun 12, 2024

Thanks for the reply.I found that some translations are already implemented in this repo, but they are not used in Theia settings page yet.

@msujew
Copy link
Member

msujew commented Jun 12, 2024

I see. Seems like VS Code has actually started translating those preference groups. That wasn't there the last time I worked on the feature. I'll implement this soon.

@sgraband sgraband added this to the 1.52.0 milestone Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
localization issues related to localization/internalization/nls
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants