The Princess Royal will commemorate the sacrifices of black South Africans and other races who played a vital First World War role as military labourers when she visits the country.