Get Version


→ ‘tranexp nor eng’


Translates words or phrases from one language to another, using tranexp website


sudo gem install tranexp

The basics

Has a command-line and API.

Caches results in a local YAML file to make subsequent requests for same query faster.

REQUIRES: ‘HOME’ environment variable set to a folder.

Command Line

To translate some text from Danish to English:

cat some_danish_text.txt | tranexp dan eng

echo "jeg ville like en flaske vin" | tranexp nor
I would like a bottle of wine

That is, you pass the input text via STDIN. The default target language is English (‘eng’).


To translate some text from English to Norwegian:

translate =
english = translate.translate("metoder", Tranexp::Http::Norwegian, Tranexp::Http::English)
english = translate.translate("metoder", "nor", "eng")

Or use the dynamic helper:



Tranexp supports translations between the following languages:

  "English" => "eng",
  "BrazilianPortuguese" => "pob",
  "Bulgarian" => "bul",
  "Croatian" => "cro",
  "Czech" => "che",
  "Danish" => "dan",
  "Dutch" => "dut",
  "Spanish" => "spa",
  "Finnish" => "fin",
  "French" => "fre",
  "German" => "ger",
  "Greek" => "grk",
  "Hungarian" => "hun",
  "Icelandic" => "ice",
  "Italian" => "ita",
  "Japanese" => "jpn",
  "Latin American Spanish" => "spl",
  "Norwegian" => "nor",
  "Filipino" => "tag",
  "Polish" => "pol",
  "Portuguese" => "poe",
  "Romanian" => "rom",
  "Russian" => "rus",
  "Serbian" => "sel",
  "Slovenian" => "slo",
  "Swedish" => "swe",
  "Welsh" => "wel",
  "Turkish" => "tur",
  "Latin" => "ltt"


How to submit patches

Read the 8 steps for fixing other people’s code and for section 8b: Submit patch to Google Groups, use the Google Group above.

You can fetch the source from either:

git clone git://
git clone git://

Build and test instructions

cd tranexp
rake test
rake install_gem


This code is free to use under the terms of the MIT license.


Comments are welcome. Send an email to Dr Nic Williams via the forum

Dr Nic Williams, 21st April 2008
Theme extended from Paul Battley