code: public void actionCopyElementLocale() throws JspException {
  
          try {
              setEditorValues(getElementLocale());
              if (!hasValidationErrors()) {
                  // save content of the editor only to the temporary file
                  writeContent();
                  CmsObject cloneCms = getCloneCms();
                  CmsUUID tempProjectId = OpenCms.getWorkplaceManager().getTempFileProjectId();
                  cloneCms.getRequestContext().setCurrentProject(getCms().readProject(tempProjectId));
                  // remove eventual release & expiration date from temporary file to make preview work
                  cloneCms.setDateReleased(getParamTempfile(), CmsResource.DATE_RELEASED_DEFAULT, false);
                  cloneCms.setDateExpired(getParamTempfile(), CmsResource.DATE_EXPIRED_DEFAULT, false);
              }
          } catch (CmsException e) {
              // show error page
              showErrorPage(this, e);
          }
      }
docs: Performs the copy locale action.<p>
  
  @throws JspException if something goes wrong