Skip to content

Commit

Permalink
feat: added null check and added default english locale #2226
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhar16 committed Sep 1, 2022
1 parent 242a345 commit b0aff37
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions server/src/main/java/org/gluu/oxtrust/LanguageBean.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.gluu.oxtrust;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import javax.enterprise.context.SessionScoped;
Expand All @@ -15,6 +16,7 @@
import org.gluu.oxtrust.security.Identity;
import org.gluu.oxtrust.service.JsonConfigurationService;
import org.gluu.oxtrust.service.PersonService;
import org.gluu.model.LocaleSupported;

/**
* Created by eugeniuparvan on 3/6/17.
Expand All @@ -37,13 +39,17 @@ public class LanguageBean implements Serializable {
@Inject
private JsonConfigurationService jsonConfigurationService;

//private static Map<String, Object> countries;
private List<org.gluu.model.LocaleSupported> adminUiLocaleSupported;
private List<LocaleSupported> adminUiLocaleSupported;



public List<org.gluu.model.LocaleSupported> getCountriesInMap() {
adminUiLocaleSupported = jsonConfigurationService.getOxTrustappConfiguration().getAdminUiLocaleSupported();
if(adminUiLocaleSupported == null) {
adminUiLocaleSupported = new ArrayList<LocaleSupported>();
adminUiLocaleSupported.add(new LocaleSupported("en","English"));
}

return adminUiLocaleSupported;

}
Expand Down

0 comments on commit b0aff37

Please sign in to comment.