Guys, I'm gonna be straight with you - the sooner you tell them the better, but here's the thing: you gotta do it *strategically*. I know that sounds calculated, but trust me. Document everything from this point forward. Seriously. Keep emails, notes about what you discussed, who was in the room. I'm naturally skeptical of stuff so I always tell people to cover their ass legally, and this is one of those situations where it matters. Most places are fine with it, but you want a paper trail just in case anyone later claims they "didn't know" about accommodations you needed or tries to shaft you on maternity leave options.
As for the actual conversation, schedule it with your manager when you can have privacy and they're not rushed. Don't do it in passing or right before they're heading into a meeting. Be matter-of-fact about it - you're telling them you're pregnant, you plan to work as long as you can, and then you want to discuss how the company handles maternity leave and what accommodations might be needed as you progress. This isn't asking for favors, it's communicating about your situation. Most managers have dealt with this before and it's... fine. The ones who get weird about it are usually the problem employers anyway, honestly.
One more thing though - before you tell work, double-check what your actual legal protections are in your area. Laws vary wildly depending on where you are, and I always verify stuff myself rather than trusting what people say. Some places have stronger protections than others, and knowing your rights beforehand makes that conversation way less stressful because you're not second-guessing yourself.