anytype-ts
anytype-ts copied to clipboard
Add Dictionary Management and Multi-Language Support
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
-
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.
-
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
-
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.
-
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.
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
};
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.
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.
C'mon guys, please, English is not yet the only language spoken in the world