Lang Forge creates five custom tables on activation. All table names use the WordPress table prefix (typically wp_). Understanding the schema is important for writing custom queries, building reports, and debugging translation issues.
wp_lf_translations
Stores the relationship between posts and their translations. This is the core table that links posts across languages.
CREATE TABLE wp_lf_translations (
id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
element_id bigint(20) unsigned NOT NULL,
element_type varchar(60) NOT NULL DEFAULT 'post',
translation_group bigint(20) unsigned NOT NULL,
language_code varchar(10) NOT NULL,
source_language_code varchar(10) DEFAULT NULL,
PRIMARY KEY (id),
UNIQUE KEY element_language (element_id, element_type, language_code),
KEY translation_group (translation_group),
KEY language_code (language_code)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;| Column | Type | Nullable | Description |
|---|---|---|---|
id | bigint | No | Auto-increment primary key |
element_id | bigint | No | WordPress post ID |
element_type | varchar(60) | No | Post type slug (e.g., post, page, product) |
translation_group | bigint | No | Groups translations of the same content together |
language_code | varchar(10) | No | Language code (e.g., en, ru) |
source_language_code | varchar(10) | Yes | Language of the original post (nullable) |
-- Find all translations of post #42
SELECT t2.element_id, t2.language_code
FROM wp_lf_translations t1
JOIN wp_lf_translations t2 ON t1.translation_group = t2.translation_group
WHERE t1.element_id = 42;
-- Find posts that have no English translation
SELECT t1.element_id, t1.language_code
FROM wp_lf_translations t1
WHERE t1.translation_group NOT IN (
SELECT translation_group FROM wp_lf_translations WHERE language_code = 'en'
)
AND t1.language_code = 'ru';
-- Count translations per language for a post type
SELECT language_code, COUNT(*) as post_count
FROM wp_lf_translations
WHERE element_type = 'post'
GROUP BY language_code;wp_lf_strings
Stores registered strings and their translations.
CREATE TABLE wp_lf_strings (
id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
string_domain varchar(160) NOT NULL DEFAULT 'default',
string_name varchar(160) NOT NULL,
string_value text NOT NULL,
string_language varchar(10) NOT NULL,
status tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (id),
UNIQUE KEY string_key (string_domain, string_name, string_language),
KEY string_domain (string_domain),
KEY string_language (string_language)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;wp_lf_translation_memory (PRO)
Stores previously translated segments for reuse.
CREATE TABLE wp_lf_translation_memory (
id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
source_text text NOT NULL,
source_hash varchar(64) NOT NULL,
translated_text text NOT NULL,
source_lang varchar(10) NOT NULL,
target_lang varchar(10) NOT NULL,
context varchar(255) DEFAULT '',
usage_count int(11) NOT NULL DEFAULT 1,
created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id),
UNIQUE KEY source_target (source_hash, source_lang, target_lang),
KEY langs (source_lang, target_lang),
KEY usage_count (usage_count)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;wp_lf_glossary (Free)
Brand terminology dictionary for translation consistency.
CREATE TABLE wp_lf_glossary (
id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
source_term varchar(255) NOT NULL,
translated_term varchar(255) NOT NULL DEFAULT '',
source_lang varchar(10) NOT NULL,
target_lang varchar(10) NOT NULL,
description text DEFAULT '',
do_not_translate tinyint(1) NOT NULL DEFAULT 0,
case_sensitive tinyint(1) NOT NULL DEFAULT 0,
created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id),
UNIQUE KEY term_pair (source_term(191), source_lang, target_lang),
KEY source_lang (source_lang),
KEY target_lang (target_lang)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;wp_lf_analytics (PRO)
Tracks translation events for the analytics dashboard.
CREATE TABLE wp_lf_analytics (
id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
event_type varchar(50) NOT NULL,
post_id bigint(20) unsigned DEFAULT 0,
language_code varchar(10) NOT NULL DEFAULT '',
user_id bigint(20) unsigned DEFAULT 0,
created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
meta text DEFAULT '',
PRIMARY KEY (id),
KEY event_type (event_type, created_at),
KEY language_code (language_code, created_at),
KEY user_id (user_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;—