Mastodon has an automatic language detector.
If you start writing a post on the website interface, the language indicator will light up if it thinks you have the wrong language setting. When you click on the lit-up indicator it will suggest which language you should use instead.
The reason it doesn't set language automatically is because the detector is too unreliable for short posts (and Mastodon is by its nature full of short posts).
More info on language settings at https://fedi.tips/setting-your-language-preferences-on-mastodon-and-filtering-out-posts-in-other-languages

Setting your language preferences on Mastodon, filtering out posts in other languages, filtering search results by language | Fedi.Tips – An Unofficial Guide to Mastodon and the Fediverse
An unofficial guide to using Mastodon and the Fediverse
fedi.tips
Link author:
Fedi.Tips@FediTips@social.growyourown.services