rdoeffinger / Dictionary

"QuickDic" offline Dictionary App for Android. Provided downloadable dictionaries are based on Wiktionaries but can also be created from other sources (see DictionaryPC). Remember to use --recursive when cloning! Fork of project that used to be hosted at code.google.com/p/quickdic-dictionary.
Apache License 2.0
325 stars 69 forks source link

Exporting entry to AnkiDroid via share - wrong field assignment #37

Open Heineken opened 8 years ago

Heineken commented 8 years ago

When I export an entry (e.g. "to set up") to AnkiDroid via "Share it" appears there in two fields, e.g. "Front" and "Back".

This is good as apparently Quickdic transmits and AnkiDroid recognizes two separate fields (e.g. "Front" & "Back"). [It's not just the first word that is separated from the rest as a test with a two words entry (e.g. "Costa Rica") shows. However those entries are always blue link entries and no content is shared.]

However the fields' content is not quite correct as "Front" contains only the "main word" ("set") while "Back" contains both sides/languages of the actual entry.

Hence I need to do some tedious copying and pasting in AnkiDroid which would be unnecessary if the shared data were assigned correctly.

According to my observations this issue cannot be fixed in AnkiDroid.

I propose to populate the shared data with: "entry left language SEPARATOR entry right language".

rdoeffinger commented 8 years ago

The data shared contains to parts: a subject ("set") and the text/actual data (left and right entries). The actual data has the format you propose, with the "tab" character used as separator. One disadvantage is though that many apps do not support or in any way show the tab character, but otherwise what QuickDic sends seems to match what you request...

Heineken commented 8 years ago

Hey, I haven't forgotten about this one. Still vexing. So, going by how I see it in AnkiDroid the format is slightly different: category \t left_side right_side. With "category" denoting the term by which the entries are grouped (and found). If I assume right, then the \t could be moved. Anyway I don't expect/need "category" to be transmitted if I click on an entry and select share. Or maybe AnkiDroid ignores the \t and just clips off the first word in which case it would be good to keep the "category".

2nd related issue for me: as I do the transfer QuickDic>AnkiDroid often I selected AnkiDroid as standard app. This is a problem when I share text from another app. Apparently QuickDic doesn't use a dedicated Data Type. Probably there is none for vocabulary data, in that case there is no solution.

Anyway I have to admit that i can't even say that the problem persists with the latest version of AnkiDroid as I am stuck to an older version due to a feature they removed.

rdoeffinger commented 8 years ago

AnkiDroid admittedly has a special API for this, but supporting it is a bit too much pain (especially since it seems to require compiling in some of their code), see https://github.com/ankidroid/Anki-Android/wiki/AnkiDroid-API From that code snippet, you also see that with the standard SEND they just use the "subject" as the front, and the main text as the back. And from what you say, they the just throw away the tab that was in the main text (or it is actually there and just not visible, I've seen that in some other editors). I don't think it makes logically much sense to put the whole right side in the subject (at least if it is more than a couple of words). Currently I see no sufficiently non-ugly and low-effort method to fix this, at least not from QuickDic side.

Heineken commented 8 years ago

OK, so QuickDic puts the "category" in the subject then left \t right and the tab is ignored. This structure could easily be changed, right? The structure is logical, but this is irrelevant if we aim for a certain behaviour in AnkiDroid. But I guess, there are other recipients for this info where the structure makes sense the way it is.

Now as you mention it, I've noted some weird behaviour when editing.

Thanks for inquiring, anyway!