Hi
We have developed a console application (C# language) which produce .sdltb file using Sdl.MultiTerm.TMO COM component which is installed with SDL MultiTerm 2017.
but after file creation, in SDL MultiTerm 2017 when I am opening this termbase files, I cannot add a term to it. after clicking "Add New" from upper menu and entering a term in to the textbox and clicking the tick button, this error will show up in a red box:
"One or more errors occurred."
. . . and nothing will add to the termbase.
What is wrong with my Console Application.
here is the heart of the code:
oMt = new Application();
oLocalRep = oMt.LocalRepository;
oLocalRep.Connect("", "");
string definitionFile = ". . ."; // select an appropriate .xdt file name among many files has been created before by "Multiterm Convert" software
Termbase oTb = oLocalRep.Termbases.New(orderId.ToString(), desc, definitionFile, string.Format("{0}.sdltb", orderId));
string conceptGrpS;
for (int i = 0; i < d.Rows.Count; i++)
{
var conceptGrp = new Mtf.ConceptGrp();
conceptGrp.LanguageGrps = new List<Mtf.LanguageGrp>();
DataRow dr = d.Rows[ i ];
AddWordInLang(conceptGrp.LanguageGrps, sourceCode, dr["SourceTerm"].ToString());
AddWordInLang(conceptGrp.LanguageGrps, targetCode, dr["TargetTerm"].ToString());
conceptGrpS = Serialize(typeof(Mtf.ConceptGrp), conceptGrp);
oTb.Entries.New(conceptGrpS, true);
}
oTb.Close();
// in above code , this procedure and class is called:
private void AddWordInLang(List<Mtf.LanguageGrp> nest, string lang, string term)
{
nest.Add(new Mtf.LanguageGrp()
{
Language = new Mtf.Language() { Lang = lang, Type = lang },
TermGrp = new Mtf.TermGrp() { Term = term }
});
}
public class Mtf
{
[XmlRoot(ElementName = "transac")]
public class Transac
{
[XmlAttribute(AttributeName = "type")]
public string Type { get; set; }
[XmlText]
public string Text { get; set; }
}
public class TransacGrp
{
[XmlElement(ElementName = "transac")]
public Transac Transac { get; set; }
[XmlElement(ElementName = "date")]
public string Date { get; set; }
}
public class Language
{
[XmlAttribute(AttributeName = "lang")]
public string Lang { get; set; }
[XmlAttribute(AttributeName = "type")]
public string Type { get; set; }
}
public class Descrip
{
[XmlAttribute(AttributeName = "type")]
public string Type { get; set; }
[XmlText]
public string Text { get; set; }
}
public class DescripGrp
{
[XmlElement(ElementName = "descrip")]
public Descrip Descrip { get; set; }
}
public class TermGrp
{
[XmlElement(ElementName = "term")]
public string Term { get; set; }
[XmlElement(ElementName = "descripGrp")]
public List<DescripGrp> DescripGrp { get; set; }
}
public class LanguageGrp
{
[XmlElement(ElementName = "language")]
public Language Language { get; set; }
[XmlElement(ElementName = "termGrp")]
public TermGrp TermGrp { get; set; }
}
public class ConceptGrp
{
[XmlElement(ElementName = "concept")]
public string Concept { get; set; }
[XmlElement(ElementName = "transacGrp")]
public List<TransacGrp> TransacGrp { get; set; }
[XmlElement(ElementName = "languageGrp")]
public List<LanguageGrp> LanguageGrps { get; set; }
}
}
also the sample of my termbase file is attached: