update translate script to support mac