Skip to content

Commit

Permalink
[JN-1586] fix i18n call (#1414)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorlbark authored Jan 22, 2025
1 parent aebdeb1 commit 57d2336
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import bio.terra.pearl.core.service.portal.PortalEnvironmentService;
import bio.terra.pearl.core.service.portal.PortalService;
import java.util.HashMap;
import org.apache.commons.lang3.StringUtils;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;

Expand All @@ -29,6 +30,10 @@ public I18nController(
@Override
public ResponseEntity<Object> listLanguageTexts(
String language, String portalShortcode, String environmentName) {
if (StringUtils.isEmpty(environmentName)) {
environmentName = "live";
}

PortalEnvironment portalEnv =
portalEnvironmentService
.findOne(portalShortcode, EnvironmentName.valueOfCaseInsensitive(environmentName))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import bio.terra.pearl.core.service.portal.PortalEnvironmentService;
import bio.terra.pearl.core.service.portal.PortalService;
import java.util.HashMap;
import org.apache.commons.lang3.StringUtils;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;

Expand All @@ -29,6 +30,10 @@ public I18nController(
@Override
public ResponseEntity<Object> listLanguageTexts(
String language, String portalShortcode, String environmentName) {
if (StringUtils.isEmpty(environmentName)) {
environmentName = "live";
}

PortalEnvironment portalEnv =
portalEnvironmentService
.findOne(portalShortcode, EnvironmentName.valueOfCaseInsensitive(environmentName))
Expand Down

0 comments on commit 57d2336

Please sign in to comment.