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

Fix not finding the theme menu when opening the project due to translation #464

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

esthem
Copy link

@esthem esthem commented Feb 16, 2023

Someone added Chinese language support before, and I found that it gave me an error when opening the project, so I fixed it and added some translation content.

in app/main-process/projectWindow.js

before

function ProjectWindow(filePath) {
    const getThemeFromMenu = () => Menu.getApplicationMenu().items.find(
        e => e.label.toLowerCase() === '&view'
    ).submenu.items.find(
        e => e.label.toLowerCase() === 'theme'
    ).submenu.items.find(
        e => e.checked
    ).label.toLowerCase();

after

function ProjectWindow(filePath) {
    const getThemeFromMenu = () => Menu.getApplicationMenu().items.find(
        e => e.label.toLowerCase() === i18n._('&View').toLowerCase()
    ).submenu.items.find(
        e => e.label.toLowerCase() === i18n._('Theme').toLowerCase()
    ).submenu.items.find(
        e => e.checked
    ).label.toLowerCase();

And added i18n support for some places, see code for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant