MCPcopy Index your code
hub / github.com/zaproxy/zaproxy / loadLocale

Method loadLocale

zap/src/main/java/org/parosproxy/paros/Constant.java:877–900  ·  view source on GitHub ↗
(ControlOverrides overrides)

Source from the content-addressed store, hash-verified

875 }
876
877 private Locale loadLocale(ControlOverrides overrides) {
878 try {
879 String lang = null;
880 if (overrides != null) {
881 lang = overrides.getOrderedConfigs().get(OptionsParamView.LOCALE);
882 }
883 if (lang == null || lang.isEmpty()) {
884 XMLConfiguration config = new ZapXmlConfiguration(FILE_CONFIG);
885 config.setAutoSave(false);
886
887 lang = config.getString(OptionsParamView.LOCALE, OptionsParamView.DEFAULT_LOCALE);
888 if (lang.length() == 0) {
889 lang = OptionsParamView.DEFAULT_LOCALE;
890 }
891 }
892
893 String[] langArray = lang.split("_");
894 return new Locale.Builder().setLanguage(langArray[0]).setRegion(langArray[1]).build();
895
896 } catch (Exception e) {
897 System.out.println("Failed to load locale " + e);
898 }
899 return Locale.ENGLISH;
900 }
901
902 private void setUpLogging() throws IOException {
903 backupLegacyLog4jConfig();

Callers 1

Calls 7

getMethod · 0.65
isEmptyMethod · 0.65
getOrderedConfigsMethod · 0.45
getStringMethod · 0.45
lengthMethod · 0.45
buildMethod · 0.45
printlnMethod · 0.45

Tested by

no test coverage detected