I have a question about adding a translation memory to a project. Is there a way I can set the Penalties of a translation memory programmatically?
I have tried something like the code below but it doesn't seem to work.
(I working with filebased projects)
Language trgLanguage = new Language(CultureInfo.GetCultureInfo(trgLocale));
ISettingsBundle settings = project.GetSettings(trgLanguage);
TranslationMemorySettings TMSettings = settings.GetSettingsGroup<TranslationMemorySettings>();
TMSettings.MissingFormattingPenalty.Value = 10;
TMSettings.DifferentFormattingPenalty.Value = 20;
TMSettings.MultipleTranslationsPenalty.Value = 30;
TMSettings.AutoLocalizationPenalty.Value = 40;
TMSettings.TextReplacementPenalty.Value = 50;
project.UpdateSettings(trgLanguage, settings);