Skip to content

Allows to translate "No Guesses Found" when no suggestion are available #170

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

Open
popod opened this issue Aug 15, 2023 · 1 comment
Open

Comments

@popod
Copy link

popod commented Aug 15, 2023

Using the labels option does not works because it replace all selections too.

contextMenu({
  labels: {
    dictionarySuggestions: 'Aucune proposition trouvée'
})

show

@progmars
Copy link

progmars commented Dec 6, 2024

Interested in this as well.

The dirty workaround I found:

    menu: (actions, props, browserWindow, dictionarySuggestions) => {
      // workaround for "No Guesses Found"
      // https://github.com/sindresorhus/electron-context-menu/issues/170
      const empty = dictionarySuggestions.find((s) => s.enabled === false);
      if (empty) {
        empty.label = "My custom translated 'no guesses found' message";
      }
      return [
        ...dictionarySuggestions,
      // add all actions.xyz back as needed to rebuild the entire menu

Seems somewhat overkill.

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

No branches or pull requests

2 participants