Skip to content

Commit 0d565ab

Browse files
authored
include base tags for directionalCombo in taginfo output (#222)
1 parent 17e6bac commit 0d565ab

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/build.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ function generateTranslations(fields, presets, tstrings, searchableFieldIDs) {
488488

489489
function generateTaginfo(presets, fields, deprecated, discarded, tstrings, projectInfo) {
490490

491-
const packageInfo = JSON.parse(fs.readFileSync('./package.json'));
491+
const packageInfo = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
492492

493493
if (!projectInfo.name) projectInfo.name = packageInfo.name;
494494
if (!projectInfo.description) projectInfo.description = packageInfo.description;
@@ -559,6 +559,13 @@ function generateTaginfo(presets, fields, deprecated, discarded, tstrings, proje
559559
const keys = field.keys || (field.key && [field.key]) || [];
560560
const isRadio = (field.type === 'radio' || field.type === 'structureRadio');
561561

562+
if (field.type === 'directionalCombo') {
563+
// for directionalCombo, only :left and :right are included in field.keys,
564+
// so we need to explicitly add the two other possibilities.
565+
const base = field.key.replace(/:both$/, '');
566+
keys.push(base, `${base}:both`);
567+
}
568+
562569
keys.forEach(key => {
563570
let tag = { key: key };
564571

0 commit comments

Comments
 (0)