Skip to content
Engineering
Back to writing Engineering

The bilingual content model that scales

Localized objects, fallback rules, and GROQ patterns we use in production.

⁦Why⁩ ⁦not⁩ ⁦separate⁩ ⁦documents⁩ ⁦per⁩ ⁦language⁩?

⁦Duplicated⁩ ⁦documents⁩ ⁦double⁩ ⁦editorial⁩ ⁦overhead.⁩ ⁦A⁩ ⁦single⁩ ⁦document⁩ ⁦with⁩ { ⁦en⁩, ⁦ar⁩ } ⁦fields⁩ ⁦keeps⁩ ⁦publishing⁩ ⁦atomic⁩: ⁦one⁩ ⁦approval⁩, ⁦one⁩ ⁦deploy⁩, ⁦one⁩ ⁦source⁩ ⁦of⁩ ⁦truth.⁩

⁦Fallback⁩ ⁦policy⁩

⁦English⁩ ⁦is⁩ ⁦required⁩ ⁦in⁩ ⁦the⁩ ⁦schema⁩; ⁦Arabic⁩ ⁦is⁩ ⁦optional⁩ ⁦at⁩ ⁦publish⁩ ⁦time.⁩ ⁦At⁩ ⁦render⁩, ⁦pick⁩(⁦lang⁩) ⁦returns⁩ ⁦ar⁩ ⁦when⁩ ⁦present⁩ ⁦and⁩ ⁦non-empty⁩, ⁦otherwise⁩ ⁦en.⁩ ⁦Never⁩ ⁦show⁩ ⁦empty⁩ ⁦strings.⁩

⁦Slug⁩ ⁦strategy⁩

⁦Use⁩ ⁦one⁩ ⁦English⁩ ⁦slug⁩ ⁦per⁩ ⁦post⁩ ⁦for⁩ ⁦both⁩ /⁦en/⁩ ⁦and⁩ /⁦ar/⁩ ⁦URLs⁩ ⁦so⁩ ⁦language⁩ ⁦switching⁩ ⁦keeps⁩ ⁦the⁩ ⁦same⁩ ⁦article.⁩ ⁦Localized⁩ ⁦title⁩ ⁦and⁩ ⁦body⁩ ⁦still⁩ ⁦live⁩ ⁦in⁩ ⁦slug.ar⁩ ⁦fields⁩ ⁦when⁩ ⁦needed.⁩