The impression what is commonly spoken is very much biased by this assumption. Many just don't speak one language all day long.
As a Kenyan I found this read quite delightful, containing a lot I didn't know of the history of a language we speak.
> Nyerere personally translated two of William Shakespeare’s plays into Swahili to demonstrate the capacity of Swahili to bear the expressive weight of great literary works.
What happens when few people meet? How do you agree which language to use?
When someone advertises that they will speak in public do they announce in what language?
Since I never lived in a country with multiple languages, I wonder how it is done, especially when multiple people are involved. The convention/algorithm here can be interesting from networking point of view.
With 2 people probably some sort of recognition/negotiation is involved first? Maybe person A says "Hello", while person B says "Guten tag" and then the first person knows that they can try to use English or German. But what happens where the group is larger? Also what happens when person A doesnt speak language B and person B doesnt speak language A? How do they negotiate some other language C, since they know few? (obviously some language might be the default) Probably there is some social convention to do that too -> and Im curious how it works, because it sounds like an interesting topic. Do people list the languages that they speak? Or do they have some other clever trick. Still my speculations dont explain how this dynamics work for larger groups, what is an even more complicated topic.
The rest of your comment, where you basically wrote that you can recognize what language to use on basis of how a person looks sounds very patronizing, if not racist.
Majority of Kenyans and East-africans are multi-lingual and they will speak on average 3 languages (English, Kiswahili, the mother-tongue and most likely an additional local language.) if they are Bantu, they will also understand 3 or more other languages and same if they are Nilotic or Cushitic.
If your are foreigner, visiting for tourism - you will very much unlikely understand Kenyans! and if you are a foreigner of they type " i lived in Kenya for 10 years" most likely in a posh residence in Nairobi or Mombasa -- Kenyans are likely to have spoken to you in English throughout! Do not mistake that for the idea that Kenyans only speak in English - remember i said majority are multilingual and given that we have over 42 different languages - the language that mostly unites us is Swahili - it is also deemed less elitist.
The language is spoken across the entire East africa - (Tanzania, Kenya, Uganda, Mozambique (Swahili name - Msumbiji), Burundi, Rwanda and Eastern DRC Congo.)
The article is an excerpt from a more detailed book and I agree with most it - but the author could have done a better job at investigating the origin of the language and early spread. It has borrowed heavily from Bantu, Arabic (countless words) and Portuguese (e.g. Pesa - money in Swahili, Meza - a table in Swahili).