When did south africa became a republic and why did