A powerful JSON structure designed for multilingual content management. Store, manage, and serve content in multiple languages with elegant simplicity.
Everything you need to build multilingual applications with structured content
Clean, standardized JSON format that's easy to parse, validate, and integrate with any application or API.
Native language key support for all content fields. Store translations using standard language codes like 'en', 'zh-hans', etc.
Scalar field values (string, number, boolean) that don't require translation. Perfect for metadata like price, date, status, and other universal data.
Support for arrays of multilingual content objects like comments, related posts, and other grouped content structures.
Built-in pointer system for references to authors, categories, and related content with relevance scoring.
Superior to traditional POT/PO files - single unified structure, native JSON format, direct database storage, and no compilation steps required.
Example Lect object structure for a multilingual blog post
{
"_type": "blog_post",
"_pointers": {
"author": "user_123",
"category": "category_456"
},
"date": "2025-06-22T02:30:00Z",
"published": true,
"featured": false,
"view_count": 0,
"title": {
"en": "Introduction to LionRockJS",
"zh-hans": "LionRockJS简介"
},
"excerpt": {
"en": "Learn the basics of this powerful CMS framework",
"zh-hans": "学习这个强大的CMS框架"
},
"content": {
"en": "<p>LionRockJS is a modern content management system...</p>",
"zh-hans": "<p>LionRockJS是一个现代的内容管理系统...</p>"
},
"comments": [
{
"date": "2025-06-22T03:00:00Z",
"approved": true,
"author_name": {
"en": "John Doe"
},
"email": {
"en": "[email protected]"
},
"content": {
"en": "Great article! Very helpful."
}
}
],
"related_posts": [
{
"_pointers": {
"post": "post_789"
},
"relevance_score": 0.85
}
]
}
Understanding when to use scalar attributes vs multilingual objects
{
// Universal scalar values (no translation needed)
"price": 29.99,
"currency": "USD",
"date": "2025-06-22T02:30:00Z",
"published": true,
"featured": false,
"view_count": 1247,
"rating": 4.5,
"status": "active",
"category_id": "tech_123"
}
{
// Content that needs translation
"title": {
"en": "Product Launch",
"zh-hans": "产品发布",
"es": "Lanzamiento del Producto"
},
"description": {
"en": "Amazing new features",
"zh-hans": "令人惊叹的新功能",
"es": "Características increíbles"
}
}
Numbers, dates, booleans, IDs, status codes, and other universal data that means the same across all languages
Text content, descriptions, titles, and any human-readable content that needs translation
Arrays of multilingual content objects for complex data structures
{
"comments": [
{
"date": "2025-06-22T03:00:00Z",
"approved": true,
"author_name": {
"en": "John Doe",
"zh-hans": "约翰·多伊"
},
"content": {
"en": "Great article!",
"zh-hans": "太棒了!"
}
},
{
"date": "2025-06-22T04:15:00Z",
"approved": true,
"author_name": {
"en": "Maria Garcia",
"es": "María García"
},
"content": {
"en": "Very helpful tutorial",
"es": "Tutorial muy útil"
}
}
]
}
{
"related_posts": [
{
"_pointers": {
"post": "post_789"
},
"relevance_score": 0.85,
"title": {
"en": "Advanced Features",
"zh-hans": "高级功能"
}
},
{
"_pointers": {
"post": "post_456"
},
"relevance_score": 0.72,
"title": {
"en": "Getting Started Guide",
"zh-hans": "入门指南"
}
}
]
}
Collections are arrays containing multiple objects, each with their own multilingual fields
Each item in the collection can have different language combinations as needed
Mix attributes (scalars) and multilingual objects within each collection item
A comprehensive comparison between Lect objects and traditional GNU gettext POT/PO files for multilingual content management
{
"welcome_message": {
"en": "Welcome to our website",
"fr": "Bienvenue sur notre site web",
"zh-hans": "欢迎访问我们的网站"
},
"learn_more": {
"en": "Learn more about our services",
"fr": "En savoir plus sur nos services",
"zh-hans": "了解更多我们的服务"
}
}
# POT file (template)
#: src/home.js:10
msgid "Welcome to our website"
msgstr ""
# PO file (French translation)
#: src/home.js:10
msgid "Welcome to our website"
msgstr "Bienvenue sur notre site web"
# Separate files needed:
# messages.pot, fr.po, zh.po...
// Direct manipulation
content.title.fr = "Nouveau titre";
await database.save(content);
// Access pattern
const message = content.welcome_message[currentLanguage];
Simple, direct manipulation with no compilation step needed
# Extract translatable strings
xgettext src/*.js -o messages.pot
# Update existing translations
msgmerge fr.po messages.pot -o fr.po
# Compile for runtime
msgfmt fr.po -o fr.mo
// Access pattern
const message = gettext("welcome_message");
Multi-step workflow with extraction, merging, and compilation
Lect: Database-native
POT/PO: File-based
Lect: Direct object access
POT/PO: Compiled binary lookup
Lect: JSON editors, APIs
POT/PO: Poedit, Weblate, Crowdin
Lect: Nested JSON objects
POT/PO: Linear key-value pairs
Many modern applications use a hybrid approach - POT/PO files for UI localization and JSON-based formats like Lect for content management. This gives you the professional translation workflow for static UI elements and the flexibility of structured data for dynamic content.
Start using Lect objects in your next project and unlock the power of seamless multilingual content management.