update translate.m to handle either integer or cell array