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

Error: File already exists when trying to make a new note #20

Closed
Moonbase59 opened this issue Jul 21, 2021 · 2 comments
Closed

Error: File already exists when trying to make a new note #20

Moonbase59 opened this issue Jul 21, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@Moonbase59
Copy link

Moonbase59 commented Jul 21, 2021

This is one to think about: Let’s take the word 'human'. In English, this can be a noun as well as an adjective, in German it’s an adjective.

I’m bilingual and switch between English and German quite a lot, so it sometimes happens a word is in both languages, but I still want to make a note of it. When trying this with 'human', the plugin detects the file Human.md already present in my Dictionary folder and simply gives an error message Error: File already exists.

This poses two problems:

  • What if I wish to overwrite the original with a new version (say, from another synonym provider)?
  • How to distinguish dictionary notes in multiple languages?

I’d propose the following solutions:

  • For existing notes in the dictionary folder, either
    • overwrite the existing file (potentially dangerous if someone manually edited it!), or
    • show a modal asking if it should be overwritten.
  • For multiple language dictionaries:
    • Let the user template the dictionary name. So if she wanted the dictionary split into multiple language Dictionaries, maybe use something like Dictionary ({{language}}) and fill in the currently selected dictionary language upon note creation. This would then use folder names like Dictionary (German) or Dictionary (English (US)), in my example.
      Since the two-letter ISO 639 and RFC 5646 codes are quite popular, these might also be used and generate something like Dictionary (en-US) or Dictionary (de-DE). Maybe even with a second template variable like {{lang}} or something?
      If no template variable was used in the dictionary name, assume a "one-for-all" folder. This would be the case for most users that only use one language.
@phibr0
Copy link
Owner

phibr0 commented Jul 21, 2021

These are good improvements. I will start working on these next week!

@phibr0 phibr0 added the enhancement New feature or request label Jul 21, 2021
@phibr0 phibr0 self-assigned this Jul 21, 2021
@phibr0 phibr0 closed this as completed in 32ca1f0 Jul 24, 2021
@Moonbase59
Copy link
Author

Moonbase59 commented Jul 24, 2021

Well, not a bad idea. I totally forgot about the prefix and suffix possibilities. So we can at least have one dictionary with the entries sorted. I’ll probably use it as a prefix, though. Good you replace it in there, too ;-)

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

No branches or pull requests

2 participants