Skip to content

Commit 8bc3f09

Browse files
committed
Trim enumStrings/enumValues
Translators have a tendency to add spacing after the commands which breaks things
1 parent 142a64e commit 8bc3f09

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/FactSystem/FactMetaData.cc

+7-1
Original file line numberDiff line numberDiff line change
@@ -1553,10 +1553,16 @@ bool FactMetaData::_parseEnum(const QJsonObject& jsonObject, DefineMap_t defineM
15531553

15541554
QString strings = jsonObject.value(_enumStringsJsonKey).toString();
15551555
rgDescriptions = defineMap.value(strings, strings).split(",", Qt::SkipEmptyParts);
1556+
for (auto& desc: rgDescriptions) {
1557+
desc = desc.trimmed();
1558+
}
15561559

15571560
QString values = jsonObject.value(_enumValuesJsonKey).toString();
15581561
rgValues = defineMap.value(values, values).split(",", Qt::SkipEmptyParts);
1559-
1562+
for (auto& value: rgValues) {
1563+
value = value.trimmed();
1564+
}
1565+
15601566
if (rgDescriptions.count() != rgValues.count()) {
15611567
errorString = QStringLiteral("Enum strings/values count mismatch - strings:values %1:%2").arg(rgDescriptions.count()).arg(rgValues.count());
15621568
return false;

0 commit comments

Comments
 (0)