If you want to add language names and flag icons in the header menu, simply go to theme.liquid or theme.css and add the CSS below:
{% style %}
/* ========================= ACTIVE LANGUAGE FLAG ========================= */
.toolbar-button > span:first-child {
display: flex;
align-items: center;
gap: 8px;
}
/* English active */
html[lang=“en”] .toolbar-button > span:first-child::before {
content: “”;
width: 20px;
height: 14px;
display: inline-block;
background: url(“https://cdn.shopify.com/s/files/1/0686/6242/7753/files/en.svg?v=1779864644”) no-repeat center;
background-size: contain;
}
/* Norwegian active */
html[lang=“nb”] .toolbar-button > span:first-child::before {
content: “”;
width: 20px;
height: 14px;
display: inline-block;
background: url(“”) no-repeat center;
background-size: contain;
}
/* ========================= DROPDOWN LANGUAGE FLAGS ========================= */
.locale-options .disclosure-list__label {
display: flex;
align-items: center;
gap: 8px;
}
/* English dropdown */
.locale-options li:first-child .disclosure-list__label::before {
content: “”;
width: 20px;
height: 14px;
display: inline-block;
background: url(“https://cdn.shopify.com/s/files/1/0686/6242/7753/files/en.svg?v=1779864644”) no-repeat center;
background-size: contain;
flex-shrink: 0;
}
/* Norwegian dropdown */
.locale-options li:last-child .disclosure-list__label::before {
content: “”;
width: 20px;
height: 14px;
display: inline-block;
background: url(“”) no-repeat center;
background-size: contain;
flex-shrink: 0;
}
/* Hide active language from dropdown */
/* Hide English when English is active */
html[lang=“en”] .locale-options li:first-child {
display: none;
}
/* Hide Norwegian when Norwegian is active */
html[lang=“nb”] .locale-options li:last-child {
display: none;
}
{% endstyle %}
After adding this, you will be able to see language-specific flag icons in the header menu as well as in the language dropdown list.