diff --git a/CHANGELOG.md b/CHANGELOG.md index a16fa8cb..5070f048 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## ['UNRELEASED'] +## [UNRELEASED] + +### Fixed + +- Increased the maximum length of the language column to support longer locale codes ## [1.22.1] - 2025-10-10 diff --git a/inc/labeltranslation.class.php b/inc/labeltranslation.class.php index 9f4b48e6..4ea37984 100644 --- a/inc/labeltranslation.class.php +++ b/inc/labeltranslation.class.php @@ -63,7 +63,7 @@ public static function installBaseData(Migration $migration, $version) `id` INT {$default_key_sign} NOT NULL auto_increment, `itemtype` VARCHAR(30) NOT NULL, `items_id` INT {$default_key_sign} NOT NULL, - `language` VARCHAR(5) NOT NULL, + `language` VARCHAR(10) NOT NULL, `label` VARCHAR(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `itemtype` (`itemtype`), @@ -90,6 +90,10 @@ public static function installBaseData(Migration $migration, $version) $migration->addKey($table, 'items_id'); } + if ($DB->fieldExists($table, 'language')) { + $migration->changeField($table, 'language', 'language', "VARCHAR(10) NOT NULL"); + } + return true; }