code: private LinkedHashMap<String, String> getAvailableLocales(CmsResource resource) {
  
          LinkedHashMap<String, String> result = null;
          List<Locale> locales = null;
          try {
              if (CmsResourceTypeXmlPage.isXmlPage(resource)) {
                  locales = CmsXmlPageFactory.unmarshal(getCmsObject(), resource, getRequest()).getLocales();
              } else if (CmsResourceTypeXmlContent.isXmlContent(resource)) {
                  locales = CmsXmlContentFactory.unmarshal(getCmsObject(), resource, getRequest()).getLocales();
              } else if (CmsResourceTypeXmlContainerPage.isContainerPage(resource)) {
                  locales = CmsXmlContainerPageFactory.unmarshal(getCmsObject(), resource).getLocales();
              }
          } catch (CmsException e) {
              LOG.warn(e.getLocalizedMessage(), e);
          }
          if (locales != null) {
              Locale wpLocale = OpenCms.getWorkplaceManager().getWorkplaceLocale(getCmsObject());
              result = new LinkedHashMap<String, String>();
              for (Locale locale : locales) {
                  result.put(locale.toString(), locale.getDisplayName(wpLocale));
              }
          }
          return result;
      }
docs: Returns the available locales mapped to there display name for the given resource
  or <code>null</code> in case of non xml-content/xml-page resources.<p>
  
  @param resource the resource
  
  @return the available locales