Translate code based on json object