code: public static List<String> getAttachmentLocales(CmsObject cms, CmsResource content) {
  
          List<CmsResource> detailOnlyResources = CmsDetailOnlyContainerUtil.getDetailOnlyResources(cms, content);
          Set<String> validLocaleNames = Sets.newHashSet();
          List<String> result = Lists.newArrayList();
          for (Locale locale : OpenCms.getLocaleManager().getAvailableLocales()) {
              validLocaleNames.add(locale.toString());
          }
          validLocaleNames.add(CmsDetailOnlyContainerUtil.LOCALE_ALL);
          for (CmsResource resource : detailOnlyResources) {
              String parent = CmsResource.getParentFolder(resource.getRootPath());
              String parentName = CmsResource.getName(parent);
              parentName = CmsFileUtil.removeTrailingSeparator(parentName);
              if (validLocaleNames.contains(parentName)) {
                  result.add(parentName);
              }
          }
          return result;
  
      }
docs: Gets the list of locales for which attachments / detail-only containers are available.<p>
  
  @param cms the current CMS context
  @param content the content resource
  
  @return the list of locales for which there are attachments