code: protected Locale getLocale(String destination, List<CmsProperty> properties) {
  
          String localeName = CmsProperty.get(CmsPropertyDefinition.PROPERTY_LOCALE, properties).getValue();
  
          if (localeName != null) {
              // locale was already set on the files properties
              return OpenCms.getLocaleManager().getAvailableLocales(localeName).get(0);
          }
          // locale not set in properties, read default locales
          return OpenCms.getLocaleManager().getDefaultLocales(m_cms, CmsResource.getParentFolder(destination)).get(0);
      }
docs: Returns the appropriate locale for the given destination.<p>
  
  @param destination the destination path (parent must exist)
  @param properties the properties to check at first
  
  @return the locale