Accurate alternative to 'lang' attribute in tweet object



Hi everyone,

I am asking about ‘lang’ attribute in tweet objects, I think it needs more enhancement to be more accurate, here are some scenarios:

1- if user tweets a url or image it should be null.

2- If user’s profile language is not English and he tweets a tweet in English or any different language it puts the profile language which is absolutely wrong.

3- If the tweets is in mix of two languages it should be the most used one not the default profile language.

I tried to compare lang with python code using langdetect library and I figure out it is much more accurate

from langdetect import detect

detected_lang = detect(tweet['text'])

I hope this will help developers who works in multi language applications

Thank you.