Fix client message translation function and add tests