Language Codes in Content Management — CMS Localization
How content management systems handle language codes for multilingual content, including field-level localization and translation workflows.
Detailed Explanation
Language Codes in CMS Architecture
Content management systems need a robust language code strategy to manage multilingual content effectively. The choice of language code format affects database schema, API design, and editorial workflow.
Content Localization Models
1. Field-Level Localization
Each content field can have values in multiple languages:
{
"id": "article-123",
"title": {
"en": "Getting Started",
"ja": "はじめに",
"de": "Erste Schritte"
},
"body": {
"en": "Welcome to our platform...",
"ja": "プラットフォームへようこそ...",
"de": "Willkommen auf unserer Plattform..."
}
}
2. Document-Level Localization
Each language version is a separate document with a shared reference:
// English version
{ "id": "article-123-en", "locale": "en", "ref": "article-123", "title": "Getting Started" }
// Japanese version
{ "id": "article-123-ja", "locale": "ja", "ref": "article-123", "title": "はじめに" }
Database Schema Patterns
Separate translation table:
CREATE TABLE articles (
id SERIAL PRIMARY KEY,
slug VARCHAR(255) UNIQUE,
created_at TIMESTAMP DEFAULT NOW()
);
CREATE TABLE article_translations (
id SERIAL PRIMARY KEY,
article_id INTEGER REFERENCES articles(id),
locale VARCHAR(10) NOT NULL, -- BCP 47 tag
title TEXT NOT NULL,
body TEXT NOT NULL,
UNIQUE(article_id, locale)
);
Locale Code Conventions in Popular CMS Platforms
| CMS | Format | Example |
|---|---|---|
| WordPress | ISO 639-1 + country | en_US, ja |
| Drupal | ISO 639-1 | en, ja, zh-hans |
| Contentful | BCP 47 | en-US, ja-JP |
| Strapi | ISO 639-1 + country | en, ja-JP |
| Sanity | IANA subtag | en, nb, ja |
Translation Workflow Considerations
- Identify source locale — usually
enoren-US - Track translation status per field and locale (draft, in-review, published)
- Handle fallback — show source language if translation is missing
- Validate locale codes against BCP 47 at content creation time
- Support regional variants —
pt-BRvspt-PTmay need different content
Use Case
CMS developers and content architects need to choose the right language code format when designing multilingual content systems. This affects API responses, admin interfaces, translation vendor integration, and the overall editorial workflow for managing content in multiple languages.
Try It — Language Code Reference
Related Topics
ISO 639-1 Overview — Two-Letter Language Codes
Standards
BCP 47 Language Tags — The Web Standard for Locale Identifiers
Standards
Language Codes in Translation Files — i18n File Organization
Internationalization
Locale Negotiation in Web Apps — Choosing the Right Language
Web Development
Language Codes in SEO (hreflang) — Multilingual SEO Guide
SEO