How to style each language

Free7 min read

All guides

Translated text isn’t the same length or shape as your original. German words overflow buttons, Thai needs more line height, Chinese reads better in another font. Lango7 gives you CSS classes to fix that per language.

The classes

  • lango7-lang-{code} on <body> for every page, including your own language, for example lango7-lang-en or lango7-lang-th.
  • lango7-translated on every translated page, but not on your original pages.

Use the language code shown in Translate → Settings, not the folder name.

Examples

/* Thai and Tamil: more room between lines */
.lango7-lang-th, .lango7-lang-ta { line-height: 1.8; }

/* German: long words in buttons and headings */
.lango7-lang-de .button,
.lango7-lang-de h1,
.lango7-lang-de h2 { hyphens: auto; overflow-wrap: anywhere; }

/* Chinese: a better font */
.lango7-lang-zh-Hans { font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }

/* Hide something on every translated page */
.lango7-translated .english-only-banner { display: none; }

Where to put it

Anywhere your site keeps custom CSS: Appearance → Customize → Additional CSS, your child theme, Bricks (Settings → Custom code) or Elementor Pro (Site Settings → Custom CSS).