Heavy rains and storms have battered South Africa and neighbouring Mozambique for weeks, claiming more than 30 lives.