feat(i18n): add multilingual OG tag support (closes #11)
- Add language column to #__mokoog_tags (default * for all languages) - Updated unique key to include language - SQL migration 01.02.00 for upgrades - og:locale output from current Joomla language (en-GB to en_GB) - Language-aware OG data loading: exact match preferred over wildcard Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -16,10 +16,11 @@ CREATE TABLE IF NOT EXISTS `#__mokoog_tags` (
|
||||
`meta_description` VARCHAR(200) NOT NULL DEFAULT '',
|
||||
`robots` VARCHAR(100) NOT NULL DEFAULT '',
|
||||
`canonical_url` VARCHAR(512) NOT NULL DEFAULT '',
|
||||
`language` CHAR(7) NOT NULL DEFAULT '*',
|
||||
`published` TINYINT(1) NOT NULL DEFAULT 1,
|
||||
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `idx_content` (`content_type`, `content_id`),
|
||||
UNIQUE KEY `idx_content_lang` (`content_type`, `content_id`, `language`),
|
||||
KEY `idx_published` (`published`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--
|
||||
-- MokoOpenGraph 01.02.00 — Add multilingual OG tag support
|
||||
--
|
||||
|
||||
ALTER TABLE `#__mokoog_tags`
|
||||
ADD COLUMN `language` CHAR(7) NOT NULL DEFAULT '*' AFTER `canonical_url`;
|
||||
|
||||
ALTER TABLE `#__mokoog_tags`
|
||||
DROP INDEX `idx_content`,
|
||||
ADD UNIQUE KEY `idx_content_lang` (`content_type`, `content_id`, `language`);
|
||||
Reference in New Issue
Block a user