Wait so you honestly think they’re going 30,000 km on battery power
Obviously not, as the article I linked to mentions the range is limited in electric mode.
battery power is not going to power the whole entire sub and magically move the sub quietly through the water,
It will, but the range is limited. Electricity and batteries aren't magic. We also use them to move cars.
that’s how nuclear subs work.
You should read the article I linked to above. Current nuclear submarines often aren't perfectly silent. In fact, they can be louder than a modern diesel sub running in battery only mode.
Which is likely why the French, who do have nuclear subs, chose to build a diesel sub anyway while simultaneously also working on quieter nuclear subs.