code: private static Locale determineUsersSystemLocale() {
          Locale userloc = null;
          final Locale systloc = Constant.getSystemsLocale();
          // first, try full match
          for (String ls : LocaleUtils.getAvailableLocales()) {
              String[] langArray = ls.split("_");
              if (langArray.length == 1) {
                  if (systloc.getLanguage().equals(langArray[0])) {
                      userloc = systloc;
                      break;
                  }
              }
  
              if (langArray.length == 2) {
                  if (systloc.getLanguage().equals(langArray[0]) && systloc.getCountry().equals(langArray[1])) {
                      userloc = systloc;
                      break;
                  }
              }
  
              if (langArray.length == 3) {
                  if (systloc.getLanguage().equals(langArray[0]) && systloc.getCountry().equals(langArray[1])
                          && systloc.getVariant().equals(langArray[2])) {
                      userloc = systloc;
                      break;
                  }
              }
          }
  
          if (userloc == null) {
              // second, try partial language match
              for (String ls : LocaleUtils.getAvailableLocales()) {
                  String[] langArray = ls.split("_");
                  if (systloc.getLanguage().equals(langArray[0])) {
                      userloc = createLocale(langArray);
                      break;
                  }
              }
          }
  
          return userloc;
      }
docs: Determines the {@link Locale} of the current user's system.
  <p>
  It will match the {@link Constant#getSystemsLocale()} with the available locales from ZAP's translation files.
  <p>
  It may return {@code null}, if the user's system locale is not in the list of available translations of ZAP.
  
  @return the {@code Locale} that best matches the user's locale, or {@code null} if none found