fauu / Kamite

Japanese immersion assistant for learners (Windows/Linux)
GNU Affero General Public License v3.0
110 stars 2 forks source link

Auto Lookup/Translate #11

Open Stolka opened 1 year ago

Stolka commented 1 year ago

Can we get an auto translate/lookup feature? I've been using Game2Text up until now, but I really miss that feature. I'm not sure whether this app already has that feature or not, I looked through the documentation, but I couldn't find it. Great documentation btw, it's very detailed. Basically send the text to a currently active lookup target as soon as it gets extracted. As of right now, I need to click the DeepL/jpdb tab to get a translation, it would be very helpful if you could implement it.

Thanks!

fauu commented 1 year ago

This should actually already be possible for a pre-defined lookup target. It's just completely undocumented, because it depends on a feature I haven't finalized yet. But with the following added to the config, it should already auto lookup in DeepL on new text:

events: {
  handlers: [
    { on: chunk-add, command: { kind: misc_lookup, params: """{ "targetSymbol": "DEP" }""" }}
  ]
}

Picking the target depending on which one is selected in the client sounds like a good idea, so I'll probably add that to the lookup command.

Let's leave this issue open until this is officially released.