I told parents at 12 weeks, it was difficult to conceal it any longer plus I wanted them to be first to know (aside close family) as it does affect them a lot.
I personally am not taking maternity leave. When the baby comes, I'm having two weeks off then getting straight back in it. I have two weeks pre-booked with parents as holiday (so half pay which is what I get for holiday) which is when we're expecting the baby (next week!) and if it's late, any extra time will be taken at unpaid. They've known since 12 weeks, I periodically remind them, plus have written a formal letter to them outlining my plans. I will still therefore pay NI, tax etc as I'm technically still earning, although I've got a maternity allowance form incase I need any unpaid time off.
My friend, who's due in 11 weeks, is having maternity leave. To get the maternity allowance, she had to have worked 26 weeks in the last year and a half, (she's only ever been self employed, I think any employment counts too) and has to have paid at least 13 NI contributions. She hadn't actually done that as she had an small earnings exemption certificate, so she asked for that to be revoked, and has paid the extra 2 weeks she needed plus a couple extra. Paying the extra £4.10 gets her over a hundred pounds a week
She told the parents very early (she showed at 7 weeks) but has only just decided what she's doing about maternity leave - she's having 6 months off. She's told them with a good 2 or 3 months notice still from when they'd need cover. However she's asked to keep the child on her books if the parent likes, which they've agreed, as it's holiday-only cover, it's only 4 weeks the parent has to find cover for.
She is keeping her certificate but letting ofsted know (esp. as numbers will change) and she's postponing her NCMA membership.