private TextLanguage makeTextLanguage(string language, List <string> dictionary, int languageWeight, int dictionaryWeight) { // Create new TextLanguage object LanguageDatabase languageDatabase = Engine.CreateLanguageDatabase(); TextLanguage Language = languageDatabase.CreateTextLanguage(); if (language != null) { // Copy all attributes from predefined language Language.CopyFrom(Engine.PredefinedLanguages.Find(language).TextLanguage); Language.InternalName = "SampleTextLanguage"; } else { Language.CopyFrom(Engine.PredefinedLanguages.Find("English").TextLanguage); } // Bind new dictionary to first (and single) BaseLanguage object within TextLanguage //BaseLanguage baseLanguage = Language.BaseLanguages[0]; BaseLanguage baseLanguage = Language.BaseLanguages[0]; // Change internal dictionary name to user-defined baseLanguage.InternalName = "SampleBaseLanguage"; //set custom doctionary for base language setDictionary(language, baseLanguage, dictionary, languageWeight, dictionaryWeight); return(Language); }