vocascan / vocascan-frontend

A highly configurable vocabulary trainer
https://vocascan.com
Apache License 2.0
29 stars 8 forks source link

Use csv to Import and Export Vocabs #112

Open engahmadkadi opened 2 years ago

engahmadkadi commented 2 years ago

As a user of vocascan, I'd like to have the feature of importing and exporting vocabularies as csv files.

I can imagine that many starts to learn by creating tables and have it already there and would like to import it into the application. So having this feature eases and make it faster to start learning using vocascan.

The csv file could easily be exported from excel or openoffice table as such. Looking at the structure of json that vocascan uses, this excel table should contains three columns something like:

Learned language Translation Description, note, or example
Apfel apple Augapfel
Pfanne pan in die Pfanne hauen

The importing dialog could ask to know which separator is used in this csv file, or the app detects it automatically. The exporting dialog of the entered vocabularies should also give the option to the user to select which separator to use for exporting.

Open question: what if the vocabulary have many translation, same as in the dialog of adding new vocabulary in the app? How should this be handled?

I hope this makes sense. Comments and discussions are welcomed.

Thanks and regards, Ahmad

luwol03 commented 2 years ago

Hey,

there is already an export/import functionality with json. CSV is already in our board as Export target, but has no priority ATM. If you'd like to use this already because you have your vocabs in csv you can build a little script that converts it to json. (For the format of the json, just export a simple package and check the format.)

luwol03

noctera commented 2 years ago

Such import algorithms are always a little delicate. If you want to import a specific csv or json file, it needs specific attributes and a specific construction in order to detect everything and import it correctly. A csv would only be another option next to Json to export vocabularies, in my eyes.

Yes, you could import vocabularies, by importing self written csv files, but therefore we have the function to create vocabularies in the app. In my opinion this doesn't save much time.

I think the point you meant with this issue is, that you can import csv files that you exported from other vocabulary trainers or downloaded from the internet. But as I have already mentioned there isn't a real standard, so every exported csv file is constructed differently and has other attributes, which would cause errors in our importing process. To solve this we would have to look at the csv structure of every vocabulary trainer export and develop specific functions to import them in Vocascan

Noctera

engahmadkadi commented 2 years ago

Thanks for the discussion.

What I had in mind once I proposed this issue is only an easy csv file that contains three columns, very same to the table in issue description.

Converting a self maintained table or a downloaded one from the internet to such simple structure could easily be achieved by few steps in the spreadsheet, like merging, renaming or deleting.

Having that in mind, there shouldn't be consideration to an arbitrary structure, only a simple structure that you feel it's enough. It was for me as really simple person the case, that I only needed those three columns for my own vocabularies tables.

I put myself in the shoes of a person who would like to create such a list and found it straightforward to open a spreadsheet editor, after few copy-pastes and other clicks, save the file in csv format, rather than writing a script to do the job of creating json. Even at this point, I can think of this script itself, would read the vocabs list from such a csv file.

Ahmad

noctera commented 2 years ago

Oh excuse me, I have thought a little bit too difficult here. Such a csv option, as you have described it, shouldn't be too much of a problem. And I see your point. Converting a csv file to the json structure is by far too time consuming. The json option was only added, because it was the easiest option to import and export vocabularies back then. We just wanted to have the ability to transport the vocabularies to a different account (while we had in mind, that we would open the cloud soon). But new import types will be added for sure, if we find the right time.

Noctera

luwol03 commented 2 years ago

The problem of such a simple structure is, that this won't work for different card types we plan.

engahmadkadi commented 2 years ago

Alright. I see.