Language selector merge tags

POM Translate builds one label for each language in a navigation, shortcode, or floating selector. A markup template combines literal text, allowed HTML, and merge tags written as {%tag_name%}.

Choose the label data

Merge tag Output Can be empty?
local_label Language name in that language No; falls back to the language code
label_english Language name in English No; falls back to local_label
custom_label Label entered in POM Translate settings Yes, for an additional language
local_country Country name in the language itself Yes
country_label_english Country name in English Yes
code Locale definition code No
slug Locale definition slug No
country_iso Uppercase country identifier No, but its derived fallback may not describe a country
flag_image Prepared local SVG <img> Yes
flag_html Emoji inside an aria-hidden <span> Yes
flag_emoji Emoji numeric entities without a wrapper Yes

Understand template processing

POM Translate sanitizes the template with the WordPress post-HTML policy, escapes text values, and then replaces supported tags. Unknown merge tags are removed. A completely empty rendered label falls back to the language code in a <strong> element.

Literal separators are not conditional. For example, ({%local_country%}) leaves () when a locale has no local country name. Use optional values only after checking every enabled language.

Flag output is prepared only when the selected template requests a flag tag. The template controls the inside of each language link; it does not control the destination URL, list structure, dropdown button, or other selector containers.

Build and verify a template

Start with Combine merge tags safely, then choose a pattern from Selector label recipes. Configure it under Settings → POM Translate → Language switcher in the markup field for the intended selector surface.

Inspect every enabled locale after saving. Confirm that the visible text is meaningful, optional data does not leave punctuation behind, the longest label fits its layout, and every link still reaches the expected localized route.