anytype-ts icon indicating copy to clipboard operation
anytype-ts copied to clipboard

Add Dictionary Management and Multi-Language Support

Open n0one42 opened this issue 1 year ago • 4 comments
trafficstars

Have you read a contributing guide?

  • [X] I have read CONTRIBUTING.md
  • [X] I have searched the existing requests and didn't find any that were similar
  • [X] I have considered creating a pull request instead and want to proceed

Clear and concise description of the problem

  1. Dictionary Management Menu:

    • View Dictionary Entries: Add a menu option to view all dictionary entries.
    • Edit Dictionary Entries: Allow users to edit existing dictionary entries.
    • Remove Dictionary Entries: Enable users to remove words from the dictionary.
  2. Multi-Language Support:

    • Language Selection: Provide an option to select the language for the dictionary.
    • Language-Specific Dictionaries: Maintain separate dictionaries for each language selected.
    • Auto-Detect Language: Implement a feature to auto-detect the language of the text being entered and use the appropriate dictionary.

Suggested solution

  1. Dictionary Management Menu:

    • View Dictionary Entries: Add a menu option to view all dictionary entries.
    • Edit Dictionary Entries: Allow users to edit existing dictionary entries.
    • Remove Dictionary Entries: Enable users to remove words from the dictionary.
  2. Multi-Language Support:

    • Language Selection: Provide an option to select the language for the dictionary.
    • Language-Specific Dictionaries: Maintain separate dictionaries for each language selected.
    • Auto-Detect Language: Implement a feature to auto-detect the language of the text being entered and use the appropriate dictionary.

Alternative

No response

Additional context

Justification:

  • Improved User Experience: Enhancing dictionary management capabilities will provide users with more control over their dictionaries, leading to a better user experience.
  • Language Flexibility: Multi-language support is crucial for users who work with multiple languages. It will ensure accurate spell checking and text suggestions in the appropriate language.
  • Consistency and Accuracy: The ability to manage dictionary entries and switch between languages will improve the consistency and accuracy of text inputs.

Impact:

  • Developers: These enhancements will require modifications to the existing dictionary management system and the addition of new features for multi-language support.
  • Users: Users will benefit from a more robust and flexible dictionary system, improving their overall productivity and satisfaction with the software.

Thank you for considering this enhancement request. I believe these features will significantly improve the functionality and usability of the Anytype app.

n0one42 avatar May 19 '24 09:05 n0one42

Maybe this could help as an Idea:

sudo pacman -S hunspell hunspell-en_us hunspell-de

spellCheckConfig.js

const spellchecker = require('spellchecker');

// Function to initialize dictionaries
function initSpellChecker() {
  spellchecker.setDictionary('en_US', '/usr/share/hunspell/en_US.aff', '/usr/share/hunspell/en_US.dic');
  spellchecker.setDictionary('de_DE', '/usr/share/hunspell/de_DE.aff', '/usr/share/hunspell/de_DE.dic');
}

// Function to switch spell check language
function setSpellCheckLanguage(language) {
  switch (language) {
    case 'en':
      spellchecker.setDictionary('en_US', '/usr/share/hunspell/en_US.aff', '/usr/share/hunspell/en_US.dic');
      break;
    case 'de':
      spellchecker.setDictionary('de_DE', '/usr/share/hunspell/de_DE.aff', '/usr/share/hunspell/de_DE.dic');
      break;
    default:
      console.error('Unsupported language');
  }
}

module.exports = {
  initSpellChecker,
  setSpellCheckLanguage
};

n0one42 avatar May 20 '24 08:05 n0one42

I found out that there is an ~/.config/anytype/Dictionaries/ folder. However, adding an additional dictionary did not did what it should. Renaming my dictionary the same name as the en-US one, did work which means it must be coded somewhere to always use only the en-US-10-1.bdic. Pls implement at least a dropdown or such to select the wanted dict. Multi Dicts would be still greater.

n0one42 avatar May 24 '24 06:05 n0one42

Second on the dictionary management. Think it's more of a priority that if you allow users to add custom words to the dictionary then there needs to be a way to remove the custom words added as well.

iamWing avatar Jun 07 '24 00:06 iamWing

C'mon guys, please, English is not yet the only language spoken in the world

LucaPranay avatar Aug 20 '25 13:08 LucaPranay