by P. Andreas Schmidt, IVE
This is just an example of two different ways I found to detect the language used in a text. This can be very helpful if you have to deal with messages that are not all in the same language. For example, I use Automate to read some emails to be, but they're not all in English or ... So by using either method, I can determine the language and get it to read it to me correctly.
The first method is by using some online services. E.g. https://ws.detectlanguage.com/. you can sign up for free and get limited detections per day. (I'm not putting mine here, you'll have to sign up yourself to try it out) Google also has something.
The second method uses the free Tasker plugin Tasker Now (https://play.google.com/store/apps/details?id=com.balda.taskernow) by Marco Stornelli.
Both methods also supply you with a confidence score.
Hope this can be of help to someone, in or modern multi language world.