arianneorpilla / jidoujisho

A full-featured immersion language learning suite for mobile.
GNU General Public License v3.0
974 stars 62 forks source link

Support structured content Yomichan dictionaries #174

Closed arianneorpilla closed 1 year ago

arianneorpilla commented 1 year ago

Currently the app does not support structured-content. Some users as a result that do not know may import dictionaries and use dictionaries with some content omitted, or some imports may completely fail.

In the meantime, users are advised to stick to plain text dictionaries -- they still make up a majority of the dictionaries out there so there is still definitely a great selection to use.

Supporting structured-content is a multi-faceted problem and will require waiting on some Flutter blockers to resolve, particularly https://github.com/flutter/flutter/issues/110594. Will probably give this some waiting time while on hiatus and if not, will need to reconsider or fork myself.

  1. The structured-content JSON needs to be imported. The app currently ignores structured content JSON. Additionally, it would be useful to support images #129 as implementing this will also implement the features necessary to completely support images.
  2. Dictionary formats need to be able to declare a custom widget. This functionality needs to be limited to Yomichan dictionaries only. Other dictionary formats may require their own widget in the future so a general function for widgets to use might as well be made.
  3. Supporting structured-content means supporting tables, lists and other non-plain text content.
  4. This content needs to be text selectable. Flutter appears to offer programmatic ways to select text via SelectionArea and flutter_html appears to support a lot of the required HTML components out of the box, but it does not expose a TextSelection upon yielding a SelectedContent.
  5. Programmatic setting of the selection is necessary in order to implement the double tap to select a word functionality currently present in text definitions.
  6. Images in definitions should be exportable to the creator. The Card Creator API needs to support an initial image value independent of the media source.
arianneorpilla commented 1 year ago

Implemented in the 2.9.0 preview.