Skip to content

Commit

Permalink
Merge pull request #1080 from neeharikatech/develop
Browse files Browse the repository at this point in the history
Mandatory lang not present handle
  • Loading branch information
Sohandey authored Sep 25, 2023
2 parents e1dc8ae + 8e07d3e commit 6937116
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -551,23 +551,30 @@ public static List<String> getLanguageList() {
return languageList;
}
String section = "";

String optionalLanguages=null;
String mandatoryLanguages=null;
if (isTargetEnvLTS())
section = "/mosip/mosip-config/application-default.properties";
else
section = "/mosip/mosip-config/sandbox/admin-mz.properties";

String mandatoryLanguages = getValueFromActuators(propsKernel.getProperty("actuatorAdminEndpoint"),
section, "mosip.mandatory-languages");
String optionalLanguages = getValueFromActuators(propsKernel.getProperty("actuatorAdminEndpoint"),
try {

optionalLanguages = getValueFromActuators(propsKernel.getProperty("actuatorAdminEndpoint"),
section, "mosip.optional-languages");

logger.info("optionalLanguages from env:" + optionalLanguages);
mandatoryLanguages = getValueFromActuators(propsKernel.getProperty("actuatorAdminEndpoint"),
section, "mosip.mandatoryLanguages from env:" + mandatoryLanguages);
}
catch(Exception e)
{
e.printStackTrace();
}
if (mandatoryLanguages != null && !mandatoryLanguages.isBlank())
languageList.addAll(Arrays.asList(mandatoryLanguages.split(",")));

if (optionalLanguages != null && !optionalLanguages.isBlank())
languageList.addAll(Arrays.asList(optionalLanguages.split(",")));

logger.info("languageList from env:" + languageList);
return languageList;
}

Expand Down

0 comments on commit 6937116

Please sign in to comment.