(   )
                          (    )
                           (    )
                          (    )
                            )  )
                           (  (                  /\
                            (_)                 /  \  /\
                    ________[_]________      /\/    \/  \
           /\      /\        ______    \    /   /\/\  /\/\
          /  \    //_\       \    /\    \  /\/\/    \/    \
   /\    / /\/\  //___\       \__/  \    \/
  /  \  /\/    \//_____\       \ |[]|     \
 /\/\/\/       //_______\       \|__|      \
/      \      /XXXXXXXXXX\                  \
        \    /_I_II  I__I_\__________________\
               I_I|  I__I_____[]_|_[]_____I
               I_II  I__I_____[]_|_[]_____I
               I II__I  I     XXXXXXX     I
            ~~~~~"   "~~~~~~~~~~~~~~~~~~~~~~~~

Sun, 10 Jun 2018

CLI Translation Utility

I came across a great command line translation utility 'translate shell' [0]. It provides a script 'trans', which is written in pure bash and gives an interface to the most popular online translation sites (by default it will use Google translate). Here is an example of it translating one of my recent French langyage posts. The translation is pretty accurate, at least enough to convey the meaning. It has loads of options and I could see it being used to facilitate a gopher-based translation site.

slugmax@ [/meta/s/slugmax] > cat /meta/s/slugmax/docs/phlog/static/foo Un histoire drôle - il y a deux semaines que j'ai prend un rendez-vous avec mon medecin famille, et j'étais fier de moi parce que je parlais en français tout le temps sur l'appel. La receptioniste m'a dit que le rendez-vous a été le «jeudi prochain». Il a été mardi, donc j'ai pensé que j'ai eu neuf jours jusqu'à mon rendez-vous. Alors, le jeudi prochain, neuf jours plus tard, je suis allé à mon medecin, et la receptioniste m'a dit que le rendez-vous a été la semaine derniere! Évidemment, si on aimerais dire «next thursday» en français, on dit «jeudi prochain», même si on veut dire deux jours a l'avenir. Soupir.

slugmax@ [/meta/s/slugmax] > trans --no-warn file:///meta/s/slugmax/docs/phlog/static/foo A funny story - two weeks ago I took a appointment with my family doctor, and I was proud of myself because that I spoke French all the time on the call. The receptionist told me that the appointment was on "thursday next". It was Tuesday, so I thought I had nine days until my appointment. So, next Thursday, nine days later, I went to my doctor, and the receptionist told me that the appointment was the last week! Obviously, if we would like to say "next thursday" in French, we say "next Thursday", even if we mean two days the future. Sigh.

posted at: 21:50 | path: / | permalink | cli, commandline, language, translation