Updated registerCommandTranslator to use the closure