A U.S. citizen has been sentenced to two and a half years in a Thai prison after translating a banned biography of the country's King online.