Code-switching
Etymology
A term from mid-20th-century linguistics, joining "code" (a language or variety, from Latin "codex") with "switching." It first described bilingual speakers alternating languages, then broadened to cover shifts in dialect, tone, and self-presentation.
noun · /KOHD-swich-ing/
Shifting between languages, dialects, or ways of speaking and behaving depending on the social setting.
What it names
The everyday act of changing register to fit a room — and, for many, the effort of doing so between cultures.
Example
He found himself code-switching the moment he stepped from the family kitchen into the office.
Related idea
Diglossia describes a whole community keeping two varieties for different formal and informal uses; code-switching is the individual moving between them in the moment.