forked from MapComplete/MapComplete
Docs: add better error message when generateTranslations.ts fails
This commit is contained in:
parent
ecf88f332c
commit
e9bcc70049
1 changed files with 4 additions and 0 deletions
|
|
@ -567,6 +567,10 @@ function MergeTranslation(source: any, target: any, language: string, context: s
|
||||||
const sourceV = source[key]
|
const sourceV = source[key]
|
||||||
const targetV = target[keyRemapping?.get(key) ?? key]
|
const targetV = target[keyRemapping?.get(key) ?? key]
|
||||||
|
|
||||||
|
if(targetV === undefined){
|
||||||
|
throw `Merging translations failed; targetV is undefined for context ${context}; but we are trying to add ${sourceV} (${key}) to it`
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof sourceV === "string") {
|
if (typeof sourceV === "string") {
|
||||||
if (sourceV === "") {
|
if (sourceV === "") {
|
||||||
console.log("Ignoring empty string in the translations")
|
console.log("Ignoring empty string in the translations")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue