use template for function translation