Translate the following English sentence to French:
"That is how Martín Carpena won the affection of all the people of Malaga."
C' est ainsi que Martín Carpena avait gagné l' affection de tous les habitants de Malaga.