code: protected Locale getDefaultLocale(CmsObject cms, String resource) {
  
          Locale locale = OpenCms.getLocaleManager().getDefaultLocale(cms, resource);
          if (locale == null) {
              List<Locale> locales = OpenCms.getLocaleManager().getAvailableLocales();
              if (locales.size() > 0) {
                  locale = locales.get(0);
              } else {
                  locale = Locale.ENGLISH;
              }
          }
          return locale;
      }
docs: Returns the default locale in the content of the given resource.<p>
  
  @param cms the cms context
  @param resource the resource path to get the default locale for
  
  @return the default locale of the resource