Metaphorical code-switching
Metaphorical code-switching refers to the tendency in a bilingual or multilingual community to switch codes (language or language variety) in conversation in order to discuss a topic that would normally fall into another conversational domain. "An important distinction is made from situational switching, where alternation between varieties redefines a situation, being a change in governing norms, and metaphorical switching, where alternation enriches a situation, allowing for allusion to more than one social relationship within the situation." For example, at a family dinner, where you would expect to hear a more colloquial, less prestigious variety of language (called "L variety" in studies of diglossia), family members might switch to a highly prestigious form (H variety) in order to discuss school or work.
Source: Wikipedia — Metaphorical code-switching (CC BY-SA 4.0)