SteelReed

Search

Search posts, questions…

Middle

How do you design a schema for multi-language content?

Short answer

Two approaches: a JSON column holding translations ({"vi": "...", "en": "..."}), compact with no JOIN; or a separate translation table with full constraints, indexes and per-language search. Either way you need a fallback for missing translations.

no en rowproductid, priceproduct_translationPK product_id, localeRequest locale = enFallback: vi

3 points to say:

  1. JSON: compact, no JOIN, new languages need no schema change; but hard to constrain and search per locale.
  2. Translation table: PK (entity_id, locale), full constraints and per-language indexes.
  3. Always have a fallback for missing translations; only translate display fields.

Keep reading the deep dive

Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.