Hi, I switched my language to Hungarian and noticed that where I used to have a one-click option to add a translation suggestion to the current entry while on the Explain sidebar while on English, stuff no longer gets this for Hungarian. At first I thought it was the accented characters, but now I suspect it may be the typographic quotation marks. But I’m not sure.
EDIT: looking at it some more, it’s neither of what I suspected
I checked the quotation marks in the response returned by the server and they looked like the normal (non-typographic) ones for Hungarian and English alike.
Now that I checked the JS source, it seems a few varieties of “translates to” are actually hard-coded, so it won’t work for other languages without a lot of additional work. The joy of AI: it’s real hard to get structured, easy-to-parse responses.
Yep, this is correct. Nice detective work! I’m hard-coding the patterns to detect which words seem to be translations. Because of this, the buttons to quickly add a translation are only supported for English explanations at the moment.
I know it’s a bit more cumbersome but for other languages I suggest opening the editor view and manually copying and pasting the translations from the explanation into to a new translation field.
How reliably would it work if you asked the AI to markup the translations with e.g. >>>translation<<<? Or if you would simply mark everything inside quotation marks as candidate translation, because people can always choose not to click them?
Sorry for resurrecting this, but I’ve been working with ChatGPT and the API a little more recently, and I thought maybe this can be solved in a language-agnostic way by using JSON output, something along the lines:
Return a detailed Tagalog explanation of the selected phrase and return it as a JSON object as:{"selection":"nakaimik","translation":"speachless","analysis":"...", "translations":["I was left speachless"]} where the translation is the main translation to show on top, and the translations are alternative translations that appear in the analysis, to be highlighted.
It’s just a proof of concept, but when I tried this in the “Ask AI” thing, it gave a reasonable response:
{
"selection": "binitawan",
"translation": "released",
"analysis": "Sa konteksto ng pangungusap, ang salitang 'binitawan' ay nangangahulugang ang isang tao ay humawak o kumapit sa isang bagay o tao at pagkatapos ay pinakawalan ito. Sa sitwasyong ito, ang nagsasalita ay hawak ng isang tao at pagkatapos ay bigla siyang pinakawalan pagdating nila sa student council room. Ang salitang 'binitawan' ay maaaring isalin bilang 'released', 'let go', o 'set free' depende sa konteksto.",
"translations": ["released", "let go", "set free"]
}
… then the alternative translations can be highlighted in the analysis text. This may work for some languages and for some of the more obedient models, not for others.