This is called
code-switching where a speaker either switches between languages or dialects of a single language based upon the listener or the circumstance the speaker is in. It can expand into non-lingual aspects as well.
This happens in several ways:
- Using two distinct languages at the same time. Spanglish: A bi-lingual person uses both Spanish and English words in a single sentence or conversation. Example: "Pero WHY do I have to go a la casa?" instead of "But WHY do I have to go home?"
- Using two dialects of the same language at the same time.
- Moving between dialects based upon who the intended audience is. Typical examples are a "phone" voice vs. everyday conversational voice or changing how you explain something based upon the listeners understanding of the topic or a minority groups dialect at home vs. the majority dialect at work.
- Changing clothing styles to blend into a dominate group.
This list is not exhaustive.
I learned a solid "phone" voice because my mother was in Real Estate before there were answering machines or cell phones, so we could not answer the phone in a conversational style because all three children were expected to answer the phone with a professional voice. My mom even drilled a script into us.
This skill helped me get hired for phone tech support where I then learned to convert "Engineer" to normal human. There was also a marked difference how my black co-workers answered the phone vs. how they spoke to me in the lunch room to each other. When I was the only white person with them I was included but when someone who had not been given a pass or was management showed up their business professional voice was right back on.
I have used Spanglish after living in Colombia for a year back in the '80s. It has faded over time but I sill occasionally interject certain Spanish/Colombian phrases into my English conversations unconsciously. Mostly Spanish swear words

.
Back in high school I transferred out of my district to the "rich" kid school and within 6 months I had changed my wardrobe for school so I didn't get picked on. My stoner-wear camouflage (I hung out with the stoners, but was stone cold sober) from my middle school days stood out among the preppy dominate wardrobe of my new classmates.