For translations of text (sentences, not single words) I use gnome-translate, which is based on libtranslate, a library that can query several online translation services (Google Translate, Babelfish, etc.). There is also a command line tool using this library which I use occasionally too. It doesn't always work flawlessly though; especially when those online services change their website layout it sometimes breaks...
What I also use, for single words, is a local dictd with several freedict translation libraries installed (those translation dictionaries can be found in Ubuntu's package management as packages that have a name starting with "dict-freedict-"). DICT is a standard protocol for querying dictionaries over a network, and dictd is the default server implementation for it in Ubuntu. Once you have installed dictd + the dictionaries you want, you can query them with the default Dictionary tool in Ubuntu. (The advantage of using a local dictd server is that you don't have to be online.)