A monolithic frontend that ships all language variants in one bundle gets heavy fast. When the product serves ten or more locales — especially RTL ones mixed with LTR — the bundle size and layout logic become a maintenance drag.
The JSON-layout approach
Instead of compiled templates per locale, the backend returns a layout descriptor:
{
"direction": "ltr",
"sections": [
{"type": "hero", "title_key": "home.hero", "cta_key": "home.cta"},
{"type": "grid", "columns": 3, "items_key": "home.featured"}
]
}
The frontend renders each section from a component registry, and direction is applied at the root <div dir={direction}> — no per-component RTL overrides.
Handling Uzbek and Cyrillic
Uzbek can appear in Latin script (oʻzbek) or Cyrillic (ўзбек). A multi-locale site like Mostbet has to decide at the routing layer which script variant to serve, usually from a cookie set during onboarding. Serving both under the same URL invites duplicate-content issues; /uz-latn/ and /uz-cyrl/ with hreflang tags is the cleaner pattern.
Fallback chain
If a translation key is missing for uz, fall back to ru (most UZ users read both), then en. The chain is configured per locale, not globally:
const FALLBACK: Record<string, string[]> = {
uz: ['ru', 'en'],
kk: ['ru', 'en'],
tr: ['en'],
};
Takeaway
Server-driven UI lets you ship locale-specific layouts without redeploying the app. The tradeoff is a tighter contract between backend and frontend — break the schema and the whole page blanks.
Top comments (0)