protected long Process_TranslationMemory()
    {
        if (0 == this.languageIds.Count)
        {
            return 0;
        }
        Ektron.Cms.Framework.Localization.LocalizationObject lobjApi = new Ektron.Cms.Framework.Localization.LocalizationObject();
        LocalizableCmsObjectType locType = LocalizableCmsObjectType.Content;
        LocalizationExportJob job = new LocalizationExportJob(transMemJobTitle);

        job.SourceLanguageId = this.languageIds[0];
        job.XliffVersion = this.xliffVersion;

        foreach (long contentId in contentIds)
        {
            long contentType = this.m_refContentApi.EkContentRef.GetContentType(contentId);
            if (Ektron.Cms.Common.EkConstants.IsAssetContentType(contentType, true))
                locType = LocalizableCmsObjectType.DmsAsset;
            job.AddItem(locType, contentId, this.languageIds);
            if (this.languageIds[0] != null)
                lobjApi.MarkNeedsTranslation(locType, contentId, this.languageIds[0]);
        }
        job.TargetLanguageIds = this.languageIds;

        Ektron.Cms.BusinessObjects.Localization.L10nManager businessMgr = new Ektron.Cms.BusinessObjects.Localization.L10nManager(this.m_refContentApi.RequestInformationRef);
        return businessMgr.StartExportForTranslation(job);
    }
Exemple #2
0
 private void Do_UpdateTranslationStatus(string action)
 {
     try
     {
         long intId = Convert.ToInt64(Request.QueryString["id"].ToString());
         int intLangType = Convert.ToInt32(Request.QueryString["LangType"].ToString());
         var loc = new Ektron.Cms.Framework.Localization.LocalizationObject();
         string contType = Request.QueryString["ContType"].ToString();
         long intContType;
         Ektron.Cms.Localization.LocalizableCmsObjectType objType = Ektron.Cms.Localization.LocalizableCmsObjectType.Content;
         if (Int64.TryParse(contType, out intContType))
         {
             if (EkConstants.IsAssetContentType(intContType, false))
             {
                 objType = Ektron.Cms.Localization.LocalizableCmsObjectType.DmsAsset;
             }
             else if (intContType == EkEnumeration.CMSContentType.CatalogEntry.GetHashCode())
             {
                 objType = Ektron.Cms.Localization.LocalizableCmsObjectType.Product;
             }
         }
         switch (action)
         {
             case "translatereadystatus":
                 loc.MarkReadyForTranslation(objType, intId, intLangType);
                 break;
             case "translatenotreadystatus":
                 loc.MarkNotReadyForTranslation(objType, intId, intLangType);
                 break;
             case "translatenotallowstatus":
                 loc.MarkDoNotTranslate(objType, intId, intLangType);
                 break;
             case "translateneedstranslationstatus":
                 loc.MarkNeedsTranslation(objType, intId, intLangType);
                 break;
             case "translateoutfortranslationstatus":
                 loc.MarkOutForTranslation(objType, intId, intLangType);
                 break;
             case "translatetranslatedstatus":
                 loc.MarkTranslated(objType, intId, intLangType);
                 break;
         }
         Response.Redirect((string)("content.aspx?LangType=" + ContentLanguage + "&action=View&id=" + intId), false);
     }
     catch (Exception ex)
     {
         Utilities.ShowError(ex.Message);
     }
 }