Skip to content

Commit

Permalink
fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielHabenicht committed May 14, 2021
1 parent fb38e6e commit 50b637e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions api/v1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"author": "",
"dependencies": {
"@covopen/covquestions-js": "1.0.5",
"@covopen/covquestions-js": "1.4.2",
"@types/fs-extra": "^8.1.0",
"@types/node": "^13.11.1",
"ajv": "^6.12.0",
Expand All @@ -25,7 +25,7 @@
"rimraf": "^3.0.2",
"ts-node": "^8.8.2",
"typescript": "^3.8.3",
"xmlbuilder2": "^2.1.2"
"xmlbuilder2": "^2.4.1"
},
"devDependencies": {
"@types/jest": "^25.2.1",
Expand Down
11 changes: 10 additions & 1 deletion api/v1/scripts/pre_build_fixate_translations.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as fs from "fs-extra";
import { convert } from "xmlbuilder2";
import * as glob from "fast-glob";
import { readI18nFile, replaceTranslationMap } from "../src/utility";
import { Questionnaire } from "../src/models/Questionnaire.generated";
Expand Down Expand Up @@ -34,6 +33,16 @@ export function pre_build_fixate_translations(dataDir = "./src/data") {
let filteredSourceMap = replaceTranslationMap(sourceMap, source);
let filteredTargetMap = replaceTranslationMap(sourceMap, target);

if (
Object.keys(filteredSourceMap).every(
(t) => filteredSourceMap[t] == undefined
)
) {
console.warn(
"WARNING: The created Translations are empty. Did you use the wrong source language?"
);
}

writeI18nFile(
`${questionnairePath.split(".").slice(0, -1).join(".")}.${lang}.xlf`,
lang,
Expand Down

0 comments on commit 50b637e

Please sign in to comment.