Example #1
0
        private static String CreateTm(String sourceLcid, String targetLcid)
        {
            String filePath = Path.Combine(
                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                @"SDL\OpenExchange\TTXIT\TM\TM.tmw");

            if (!Directory.Exists(Path.GetDirectoryName(filePath)))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(filePath));
            }
            CreateTmTask tTm = new CreateTmTaskClass();

            tTm.Settings.TranslationMemoryType = tmaTranslationMemoryType.tmaTranslationMemoryTypeFile;
            tTm.Settings.SourceLocale          = sourceLcid;
            tTm.Settings.TargetLocales         = targetLcid;
            tTm.Settings.FileName = filePath;

            var backdoor = (IRunStatus)tTm;
            int p1, p2, p3, p4;

            backdoor.GetParameters(out p1, out p2, out p3, out p4);
            GenerateResponse(ref p1, ref p2, ref p3, ref p4);
            backdoor.SetParameters(p1, p2, p3, p4);


            tTm.Execute();

            return(filePath);
        }
Example #2
0
        private static String CreateTm(String sourceLcid, String targetLcid)
        {
            String filePath = Path.Combine(
                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                @"SDL\OpenExchange\TTXIT\TM\TM.tmw");
            if (!Directory.Exists(Path.GetDirectoryName(filePath)))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(filePath));
            }
            CreateTmTask tTm = new CreateTmTaskClass();
            tTm.Settings.TranslationMemoryType = tmaTranslationMemoryType.tmaTranslationMemoryTypeFile;
            tTm.Settings.SourceLocale = sourceLcid;
            tTm.Settings.TargetLocales = targetLcid;
            tTm.Settings.FileName = filePath;

            var backdoor = (IRunStatus) tTm;
            int p1, p2, p3, p4;
            backdoor.GetParameters(out p1, out p2, out p3, out p4);
            GenerateResponse(ref p1, ref p2, ref p3, ref p4);
            backdoor.SetParameters(p1, p2, p3, p4);

            tTm.Execute();

            return filePath;
        }