latitudegames / AIDungeon

Infinite adventures await!
http://www.aidungeon.io/
MIT License
3.18k stars 555 forks source link

[FEAT] Translation #253

Open bartman081523 opened 4 years ago

bartman081523 commented 4 years ago

🚀 Feature Request

What problem is this feature looking to solve? the app is not accessible in other languages than english Describe the solution you'd like automatically translate prompts and answers to prompts Describe alternatives you've considered manually translate the promps through google translator

linkerMaz commented 4 years ago

Is it possible to optimize the code for other languages? and what is the difficulty of translating into different languages?

nukebloodaxe commented 4 years ago

Be aware I'm not one of the programmers on his project, but there are several problems I can envisage: It's a lexicographical engine, trained on a dataset in English. The best way to make a version for other languages would be to have it trained on data in the native languages concerned so that the grammar and language structure is relatively correct. However, that would be assuming there was such a dataset in the language concerned; I'm not terribly sure how many D&D adventures there are in Japanese, for example; However, if you fed it enough published works for the Isekai genre, then it should populate correctly [this is my personal field of experimentation with the English dataset right now.]

A very dirty way of getting around this would be to parse the input string via the Google/Yahoo translate API and translate it to English, generate the AI response, and translate that back into the user's language via the same API. I assure you it would be horrible, but it would "work"; I used this in conjunction with a Japanese translation/overlay system that used the Yahoo API, it was capable of replacing the text in Japanese games as they were being played.

Interestingly, the voiceover in the paid version does read back in the native language concerned, I suspect the code to handle some of this is already present.