Skip to content

Commit

Permalink
#3303 Implemented a fallback for missing variable label translations
Browse files Browse the repository at this point in the history
  • Loading branch information
tilovillwock committed Oct 23, 2024
1 parent 39ba60e commit 74b68f1
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,11 @@ private ObjectNode getPidMetadataOfVariable(
ObjectNode variableObj = objectMapper.createObjectNode();
variableObj.put("studyDOI", dataPackage.getDoi());
variableObj.put("variableName", variable.getName());
variableObj.put("variableLabel", variable.getLabel().getEn());
if (variable.getLabel().getEn() == null || variable.getLabel().getEn().isEmpty()) {
variableObj.put("variableLabel", variable.getLabel().getDe());
} else {
variableObj.put("variableLabel", variable.getLabel().getEn());
}
variableObj.put("pidProposal", pidPrefix + project.getId() + "_" + variable.getName() + ":"
+ project.getRelease().getVersion());
variableObj.put("landingPage", landingPageBaseUrl
Expand Down

0 comments on commit 74b68f1

Please sign in to comment.