This articles contains some information and a sample code for a means to export xliff for translation via Ektron API.
There are some legacy APIs that the workarea uses and can be seen here in the SO post. As the post suggests this functionality is mostly reserved for internal operation and CMS business logic so it is not entirely supported to be used in this context. If the solution below cannot be leveraged successfully in your implementation please contact Expert Services for a custom code engagement.
Ektron.Cms.BusinessObjects.Localization.L10nManager l10nMgr = new Ektron.Cms.BusinessObjects.Localization.L10nManager(this.requestInfoRef);
LocalizationExportJob exportJob = this.CreateExportJob(title, l10nMgr);
exportJob.XliffVersion = xliffVersion;
exportJob.MaxCompressedFileSize = maxCompressedFileSize;
l10nMgr.StartExportForTranslation(exportJob);
private LocalizationExportJob CreateExportJob(string title, Ektron.Cms.BusinessObjects.Localization.L10nManager l10nMgr)
{
long[] taxonomyIds = this.GetSelectedLocaleTaxonomyIds();
if (String.IsNullOrEmpty(title))
{
title = this.defaultJobTitle;
if (taxonomyIds != null && 1 == taxonomyIds.Length)
{
long id = taxonomyIds[0];
Ektron.Cms.API.Content.Taxonomy taxonomyApi = new Ektron.Cms.API.Content.Taxonomy();
Ektron.Cms.TaxonomyRequest req = new Ektron.Cms.TaxonomyRequest();
req.TaxonomyId = id;
req.TaxonomyLanguage = this.commonApi.ContentLanguage;
Ektron.Cms.TaxonomyData data = taxonomyApi.ReadTaxonomy(ref req);
if (data != null)
{
title = data.TaxonomyName;
}
}
}
LocalizationExportJob job = new LocalizationExportJob(title);
job.SourceLanguageId = this.GetSelectedSourceLanguage();
foreach (long id in taxonomyIds)
{
job.AddItem(LocalizableCmsObjectType.LocaleTaxonomy, id);
}
return job;
}
Please sign in to leave a comment.