Example #1
0
        static void Main(string[] args)
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            IExcelImporter <TranslateString> excelImporter = new ExcelImporter <TranslateString>();
            string fileName = @"123.xlsx";
            var    data     = excelImporter.GetData(fileName, "LoadedString", "CellCode");

            //PrintData(data);

            IDataNormalizer normalizer = new DataNormalizer();

            //repository

            IDictionaryRepository repository = new DbDictionaryRepository();

            //IDictionaryProcessor dictionaryProcessor = new DictionaryProcessor();
            //dictionaryProcessor.UpdateOriginalNormalizedAndTranslatedNormalizedFields();

            normalizer.DataNormalize(ref data);

            ITranslateProcessor processor = new DbNormalizedTranslateProcessor();

            processor.TranslateProcess(data);

            stopwatch.Stop();

            PrintData(data, TranslateStringState.TranslatedNormalized, stopwatch.ElapsedMilliseconds / 1000.0);

            Console.ReadLine();



            Console.WriteLine("Saving...");
            IExcelExporter <TranslateString> excelExporter = new ExcelExporter <TranslateString>();

            excelExporter.ExportData(data, fileName, "TranslatedString", "CellCode");
            Console.WriteLine("Done!");
            Console.ReadLine();
        }