I have decided to create a separate import for groups and dictionaries, because in some edge cases with a shared import, users would have to deal with 3 separate dialog windows with complicated selections one after the other.
The dictionary import will offer the option to completely replace a dictionary with the imported data (for full dictionary exports or when a free dictionary was converted to the export file format), and another option to expand an existing dictionary with the words in the export file. Making the former case requires no additional work as it is the same as normal dictionary updates. The latter is rather for a community working on a single dictionary, so they can share the few words they changed in the past month or some other short time. It is a more complicated problem but will be very similar to how groups are imported when there are differences in word definitions in the exported file and the current dictionary. Users will be able to select which differing words to import from the export file, adding new entries or changing old ones. This can affect already added words in existing groups. Dictionary expansion can’t deal with the case when words get deleted, so people working on dictionaries will have to do full export/imports from time to time, but it is easier if they don’t have to do it all the time.
Writing the group import is more complicated, because it is usually not the intention of users to change the dictionary, but I still want to allow it. First the same dialog will be shown that is used for expanding the dictionary (only when needed), but in this case I can’t avoid showing a similar dialog again. Once the dictionary is updated (or kept unchanged – it is important to be able to do this easily as well), a dialog will be shown for words that cannot be imported directly because of some conflict with existing groups or because their definition was not added in the first step. Users will be able to either select a replacement word in problem cases or choose to skip importing that word.
This much complexity can’t be avoided when the data is in such a complex relation. Hopefully in general cases, users won’t see any dialogs. There is no need for them if the dictionaries match and the groups don’t already contain conflicting definitions. Unfortunately, we are always dealing with the same kind of data, so the dialogs must be very similar, even identical at times, which can confuse users. I don’t know how to help with this, but if users complain I will come up with a solution.
The export part was relatively easy to do, but now that it is finished I can’t delay writing the import any further. The difficulty lies in handling the case when the dictionary at the time of export differs from the dictionary at the time of import. As I wrote earlier, the new program update will show a dialog if there is conflicting data in user groups and study lists. Let’s say there is an entry “馬穴 / バケツ – bucket, pail”, which is in some group. The new dictionary has no kanji part, just “バケツ / バケツ – bucket, pail”. In this case the user will have to select if the old entry should be kept (that is, added to the dictionary, as the program has no idea that it is the same word as the new one), it should be replaced by some word in the new dictionary, or deleted (not just from the dictionary, but from user groups as well!) This feature is already written and (to my current knowledge) working.
What happens, if the user exported his or her group with the old dictionary, and now tries to import it back with the new one? It depends. My first reaction would be that the program should tell the user that there are words in the imported group not in the current dictionary, and offer either replacing them with something else, adding them as a new entry or skip the words during the import. This is very similar to the dialog shown on dictionary and program update. But what if this is only the programmer’s point of view? I’m not sure whether this is what the user would expect. He or she just tried to import a group and never wanted to alter the dictionary as well.
There are just limited uses of export/import (although important for some). What I could think of are:
- Sharing word and kanji groups among users. – You made a great group that everyone should study, or you found a great collection of words in some textbook etc. Should I allow changes to the dictionary during import?
- Data backup and restore. – This was never an intended use of the export feature, but I’m sure some users will think that it is a good idea. Same question applies.
- Dictionary writing in some third language with a group of people. – I’m not sure whether anyone does this, but I’m writing my own dictionary alone and one day I might think of kidnapping slaves to help me. 🙂
- Converting some free dictionary to the zkanji format. – This could mean replacing all words in the current user dictionary, or just adding the differences.
The last option is a combination of 2 and 3. In case the dictionary must replace the old one, it makes sense to import it to a brand new dictionary, and then import the groups. If only appending of differences is necessary, it is like writing a dictionary with others. The point is, all of these might require a different kind of dialog, as not only the task is different, but also user expectations are. I’m not sure how to do this yet, because this is mainly a usability problem and not a technical one.