Open
Description
This works (kotlin):
fun String.apertiumTranslated(): String {
val charset = Charset.forName("UTF-8")
val process = Runtime.getRuntime().exec("apertium en-eo")
val stdin = process.outputStream
stdin.write(this.toByteArray(charset))
stdin.flush()
stdin.close()
process.waitFor()
return process.inputStream.readBytes().toString(charset)
}
Question: Replace function body so the translation runs entirely in-process.
Sounds trivial. I spent 30 minutes getting a large FOSS game to run just fine in a natively unsupported language - translated on-the-fly through Apertium, then hours researching that question. I even cloned caffeine in the hopes reading source might be clearer. I give up. The only path that's documented and contains no "legacy" or "sourceforge" dead-ends wouldn't satisfy the "in-process" wish.
I'm not looking for a ready-cooked solution. I just want to raise awareness that your jungle can be extremely confusing for outsiders.