code: protected CmsResource getResource(CmsObject cms, I_CmsWidgetParameter param) {
  
          I_CmsXmlContentValue value = (I_CmsXmlContentValue)param;
          CmsFile file = value.getDocument().getFile();
          String resourceName = cms.getSitePath(file);
          if (CmsWorkplace.isTemporaryFile(file)) {
              StringBuffer result = new StringBuffer(resourceName.length() + 2);
              result.append(CmsResource.getFolderPath(resourceName));
              result.append(CmsResource.getName(resourceName).substring(1));
              resourceName = result.toString();
          }
          try {
              List<CmsResource> listsib = cms.readSiblings(resourceName, CmsResourceFilter.ALL);
              for (int i = 0; i < listsib.size(); i++) {
                  CmsResource resource = listsib.get(i);
                  // get the default locale of the resource
                  Locale locale = getDefaultLocale(cms, cms.getSitePath(resource));
                  if (locale.equals(value.getLocale())) {
                      // get the property for the right locale
                      return resource;
                  }
              }
          } catch (CmsVfsResourceNotFoundException e) {
              // may hapen if editing a new resource
              if (LOG.isDebugEnabled()) {
                  LOG.debug(e.getLocalizedMessage(), e);
              }
          } catch (CmsException e) {
              if (LOG.isErrorEnabled()) {
                  LOG.error(e.getLocalizedMessage(), e);
              }
          }
          return file;
      }
docs: Returns the right resource, depending on the locale.<p>
  
  @param cms the cms context
  @param param the widget parameter
  
  @return the resource to get/set the categories for