intfiction.org

The Interactive Fiction Community Forum
It is currently Sun Dec 17, 2017 6:19 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 15 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Fri Aug 25, 2017 10:18 am 
Offline
User avatar

Joined: Sun May 21, 2017 4:59 pm
Posts: 42
Location: Michigan
Hey there,

I've started working out the process for binding existing tools together to let people play automagically translated IF games. I use dumbfrotz which is great for piping input and output to https://github.com/DavidGriffith/frotz/blob/master/DUMB

I also use trans, a command line tool for linux that uses Google Translate (or bing or whatever) to translate between languages. https://www.ostechnix.com/use-google-tr ... ine-linux/

Once I have them both in place I can issue a command like this:
Code:
# ./dumbfrotz ./Advent.z5 |./trans :fr -b


Which starts outputting the text like this:

Code:
Bienvenue dans Adventure!
(Tapez HELP pour obtenir des instructions et des informations.)
.
AVENTURE
The Interactive Original
Par Will Crowther (1976) et Don Woods (1977)
Reconstruit en trois étapes par:
Did you mean: Donald Ekman, David M. Padgett (1993) and Graham Nelson (1994)
Donald Ekman, David M. Baggett (1993) et Graham Nelson (1994)
[In memoriam Stephen Bishop (1820? -1857): GN]

Sortie 9 / Numéro de série 060321 / Informer v6.30 Bibliothèque 6/11 S

À la fin de la route
Vous êtes debout au bout d'une route avant un petit bâtiment en brique. Autour
vous êtes une forêt. Un petit ruisseau sort du bâtiment et descend un ravin.
> look
*** PLUS *** At End Of Road Score: 36 Départs: 0
.
> get all
>> At End Of Road Score: 36 Départs: 1
.
Forêt: C'est à peine portable.
Route: C'est à peine portable.
Stream: vous n'avez rien à transporter l'eau.
bien maison: c'est à peine portable
.

As you can see, you still have to type the commands in english, but I think this could be worked out if I design a user interface in something that lets me pass French/Spanish/Etc to trans, then the generated english to dumbfrotz, then get the english from dumbfrotz and pass that to trans, spitting back out the French/Spanish/Etc again. And, of course, being computer translated introduces all the problems involved with that.

Perhaps in the final UI I should have "Original English" in one pane and "Translation" in another...

Thoughts? Suggestions?


Attachments:
File comment: I can't guarantee that the dumbfrotz I've compiled on my machine will work on yours. But here's my dumbfrotz, trans, and some example stuff.
transfrotz.zip [156.27 KiB]
Downloaded 12 times
Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Aug 25, 2017 11:58 pm 
Offline
User avatar

Joined: Sun May 21, 2017 4:59 pm
Posts: 42
Location: Michigan
With this command you can start reading in French and also typing commands in French... of course whether the translation makes any sense to the parser is iffy:
Code:
# pipexec [ DFROTZ ./dumbfrotz ./Advent.z5 ] [ TRANS ./trans :fr -b ] [ ETRANS ./trans fr:en -b ] "{DFROTZ:1>TRANS:0}" "{ETRANS:1>DFROTZ:0}"


It appears that if you type things you mean to be in ENGLISH and untranslated as all caps, then trans spits it out untranslated. That could help if you're having a particularly hard time getting it to understand a translation-mangled command.


Last edited by howtophil on Thu Aug 31, 2017 4:10 pm, edited 1 time in total.

Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Aug 27, 2017 11:20 am 
Offline

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2275
Location: US - Central
I have actually experimentally played a couple of ASM games in their online library that were automatically translated from Russian since they are played in the browser and Chrome can do translate a webpage. It's not perfect, and sometimes commands presented creatively in the system can confound it, but this is an interesting possibility.

(ASM is a choice engine, so there isn't any typing input that needs to be translated. The only opportunity is when the author presents a text-entry field which usually just does a variable substitution.)

_________________
http://hanonondricek.wixsite.com/pyramidif
https://pyramidif.itch.io


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Aug 27, 2017 7:45 pm 
Offline
User avatar

Joined: Sun May 21, 2017 4:59 pm
Posts: 42
Location: Michigan
HanonO wrote:
sometimes commands presented creatively in the system can confound it


This is part of why I'm considering making a dual-pane front end to what I've got here. One with the original English and the other with the translation. That way it's a little easier to muddle through when one can't make the translated commands work.

Probably made in Gambas. So, this will be pretty-much a Linux-only project. Luckily I have experience making small, specific-use distros of Linux. I could make a "Transfrotz" distro that boots off USB.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Aug 28, 2017 2:07 pm 
Offline

Joined: Fri Jul 23, 2010 5:20 pm
Posts: 257
This is a pretty neat idea! Of course Google Translate is never perfect but it could go a long way. UI-wise, maybe don't show both at the same time, but give the option to show the original sentence (on hover for instance). I like the mechanism of caps meaning one language and not caps the other.

I thought frotz had problems printing accents, though, because its output isn't utf-8. Did you find a way to work around that?

Cheers!

_________________
http://hlabrande.fr/if


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Aug 28, 2017 7:23 pm 
Offline
User avatar

Joined: Sun May 21, 2017 4:59 pm
Posts: 42
Location: Michigan
mulehollandaise wrote:
This is a pretty neat idea! Of course Google Translate is never perfect but it could go a long way. UI-wise, maybe don't show both at the same time, but give the option to show the original sentence (on hover for instance). I like the mechanism of caps meaning one language and not caps the other.

I thought frotz had problems printing accents, though, because its output isn't utf-8. Did you find a way to work around that?

Cheers!


Hmmm... I'm a fan of side-by-side panes, but possibly an on hover at some point. I figure with side-by-side it's easier to get context, and also easier to code to have something "right now."

As far as frotz and accents. You see, dumbfrotz is a stripped down version of frotz that spits out plain text without all the UI elements. Dumbfotz is spitting out plain english, the trans script is taking that english and sending it to google translate, then the trans script is spitting out the translated text with accents (not frotz), then when you type back it's the other way around. Dumbfrotz never sees or prints anything other than english and the trans script sits on top of it via pipes (or when i make a UI via filehandle abstractions), but the non-english language never touches dumbfrotz.

So the "way around" is that it's the trans script printing accents, not frotz.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Aug 29, 2017 1:28 am 
Offline

Joined: Fri Jul 23, 2010 5:20 pm
Posts: 257
Ah, of course! So it works for non-English speaking people who want to play games in English, but not the other way around. (But that's already very interesting!)
Guess we have to wait for Frotz to support utf-8 for the other way around.

_________________
http://hlabrande.fr/if


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Aug 29, 2017 10:18 am 
Offline
User avatar

Joined: Sun May 21, 2017 4:59 pm
Posts: 42
Location: Michigan
mulehollandaise wrote:
Ah, of course! So it works for non-English speaking people who want to play games in English, but not the other way around. (But that's already very interesting!)
Guess we have to wait for Frotz to support utf-8 for the other way around.


Yeah, that's the general idea I had. The fan mail at the opening of episode 6 of the "Eaten By A Grue" podcast got me thinking about it.

There's so much IF in the z-machine format written in English, a whole new world of games could be opened for Spanish/French/Russian/Etc speakers if there was an instant-translate tool available.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Aug 29, 2017 10:42 am 
Offline
User avatar

Joined: Sun May 21, 2017 4:59 pm
Posts: 42
Location: Michigan
HanonO wrote:
I have actually experimentally played a couple of ASM games in their online library that were automatically translated from Russian since they are played in the browser and Chrome can do translate a webpage. It's not perfect, and sometimes commands presented creatively in the system can confound it, but this is an interesting possibility.

(ASM is a choice engine, so there isn't any typing input that needs to be translated. The only opportunity is when the author presents a text-entry field which usually just does a variable substitution.)


I actually tried this out with my Inform 7 game (WIP) "Getting To Work And Other Bullshit" and it turns out that Chrome will live-translate games in the quixe interpreter (probably works in parchment as well):


Attachments:
Chrome Transslating Quixe.gif
Chrome Transslating Quixe.gif [ 1.21 MiB | Viewed 565 times ]


Last edited by howtophil on Mon Oct 16, 2017 7:33 pm, edited 2 times in total.
Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Aug 29, 2017 11:24 am 
Offline

Joined: Tue Jul 28, 2015 1:05 pm
Posts: 1009
This is vaguely related, but I have a profanity filter that works on twine games, but it breaks if there is a passage name that is also a link that is a profanity itself (one of the Nanobots games does this, maybe insect hospital), since apparently changing the link name messes it up.

_________________
-My IFDB name is Mathbrush.

Anyone can make interactive fiction; if you've made a game and need a review on IFDB, let me know!


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group