Implement translate function completely