Lines 3-12
if( CheckVersion( $DBversion ) ) {
Link Here
|
3 |
$dbh->do(q{ |
3 |
$dbh->do(q{ |
4 |
CREATE TABLE IF NOT EXISTS l10n_source ( |
4 |
CREATE TABLE IF NOT EXISTS l10n_source ( |
5 |
l10n_source_id INT(11) NOT NULL AUTO_INCREMENT, |
5 |
l10n_source_id INT(11) NOT NULL AUTO_INCREMENT, |
6 |
context VARCHAR(100) NULL DEFAULT NULL, |
6 |
`group` VARCHAR(100) NULL DEFAULT NULL, |
7 |
source TEXT NOT NULL, |
7 |
`key` VARCHAR(100) NOT NULL, |
|
|
8 |
`text` TEXT NOT NULL, |
8 |
PRIMARY KEY (l10n_source_id), |
9 |
PRIMARY KEY (l10n_source_id), |
9 |
KEY context_source (context, source(60)) |
10 |
UNIQUE KEY group_key (`group`, `key`), |
|
|
11 |
KEY group_text (`group`, `text`(60)) |
10 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; |
12 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; |
11 |
}); |
13 |
}); |
12 |
|
14 |
|
Lines 25-41
if( CheckVersion( $DBversion ) ) {
Link Here
|
25 |
|
27 |
|
26 |
# Populate l10n_source and l10n_target for itemtypes |
28 |
# Populate l10n_source and l10n_target for itemtypes |
27 |
$dbh->do(q{ |
29 |
$dbh->do(q{ |
28 |
INSERT INTO l10n_source (context, source) |
30 |
INSERT IGNORE INTO l10n_source (`group`, `key`, `text`) |
29 |
SELECT DISTINCT 'itemtype', description FROM itemtypes |
31 |
SELECT DISTINCT 'itemtype', itemtype, description FROM itemtypes |
30 |
}); |
32 |
}); |
31 |
|
33 |
|
32 |
if (TableExists('localization')) { |
34 |
if (TableExists('localization')) { |
33 |
$dbh->do(q{ |
35 |
$dbh->do(q{ |
34 |
INSERT INTO l10n_target (l10n_source_id, language, translation) |
36 |
INSERT IGNORE INTO l10n_target (l10n_source_id, language, translation) |
35 |
SELECT DISTINCT l10n_source_id, lang, translation |
37 |
SELECT DISTINCT l10n_source_id, lang, translation |
36 |
FROM localization |
38 |
FROM localization |
37 |
JOIN itemtypes ON (localization.code = itemtypes.itemtype) |
39 |
JOIN itemtypes ON (localization.code = itemtypes.itemtype) |
38 |
JOIN l10n_source ON (itemtypes.description = l10n_source.source AND l10n_source.context = 'itemtype') |
40 |
JOIN l10n_source ON (itemtypes.itemtype = l10n_source.`key` AND l10n_source.`group` = 'itemtype') |
39 |
WHERE entity = 'itemtypes' |
41 |
WHERE entity = 'itemtypes' |
40 |
}); |
42 |
}); |
41 |
|
43 |
|