What are the concerns when building a multilingual site?

HTML

The short answer

The main concerns are: proper HTML lang attributes, text direction for RTL languages, date/number formatting per locale, URL structure for different languages, handling text expansion (translations are often longer), font support for different scripts, and SEO with hreflang tags.

HTML lang attribute

Always set the language on the <html> tag:

<html lang="en">
<!-- or for a specific region -->
<html lang="pt-BR"></html>
</html>

This tells screen readers how to pronounce content and helps search engines understand the page language.

For content in a different language within the page:

<p>
The French word <span lang="fr">bonjour</span> means
hello.
</p>

Text direction (RTL)

Languages like Arabic, Hebrew, and Persian read right-to-left:

<html lang="ar" dir="rtl"></html>

Use CSS logical properties instead of physical ones:

/* Physical (breaks in RTL) */
margin-left: 16px;
text-align: left;
/* Logical (works in both directions) */
margin-inline-start: 16px;
text-align: start;

Text expansion

English text is often shorter than translations. German can be 30% longer, Finnish even more. Your UI must handle different text lengths:

  • Use flexible layouts (flexbox, grid) that grow with content
  • Avoid fixed-width containers for text
  • Test with longer strings during development

URL structure

Three common approaches:

  • Subdirectory: example.com/en/about, example.com/es/about
  • Subdomain: en.example.com, es.example.com
  • Separate domains: example.com, example.es

Subdirectories are the most common because they are easiest to manage and keep all SEO value on one domain.

SEO — hreflang tags

Tell search engines which page to show for each language:

<link
rel="alternate"
hreflang="en"
href="https://example.com/en/about"
/>
<link
rel="alternate"
hreflang="es"
href="https://example.com/es/about"
/>
<link
rel="alternate"
hreflang="x-default"
href="https://example.com/about"
/>

Locale-aware formatting

// Dates
new Intl.DateTimeFormat('de-DE').format(new Date()); // "5.4.2026"
new Intl.DateTimeFormat('en-US').format(new Date()); // "4/5/2026"
// Numbers
new Intl.NumberFormat('de-DE').format(1234.5); // "1.234,5"
new Intl.NumberFormat('en-US').format(1234.5); // "1,234.5"

Interview Tip

Cover the lang attribute, RTL support, text expansion, and hreflang for SEO. These are the most impactful concerns. Mentioning CSS logical properties for RTL shows modern CSS knowledge.

Why interviewers ask this

This comes up at companies with international products. Interviewers want to see if you have thought about building for a global audience, including accessibility (lang attribute, RTL), SEO (hreflang), and formatting differences.