Ejemplo n.º 1
0
        private static void Export()
        {
            string workingDirectory = Environment.CurrentDirectory;

            Console.WriteLine("Where to export to?");
            Console.WriteLine("     1: /Output");
            Console.WriteLine("     2: ../../Mod/Mods/EnglishTranslate/Config");

            string outputFolder;
            var    input = Console.ReadKey().KeyChar;

            Console.WriteLine("\r          \n");
            switch (input)
            {
            case '1':
                outputFolder = workingDirectory + Path.DirectorySeparatorChar + "Output";
                break;

            case '2':
                outputFolder = workingDirectory + Path.DirectorySeparatorChar + ".." + Path.DirectorySeparatorChar + ".." + Path.DirectorySeparatorChar + "Mod/Mods/EnglishTranslate/Config/";
                break;

            default:
                Console.WriteLine("ERROR: Invalid option!");
                return;
            }

            SpreadsheetUpdater.ExportToMod(outputFolder);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Do you want to update the spreadsheets after a game update or do you want to build the English Mod data from the spreadsheets?");
            Console.WriteLine("     1: Update after game update");
            Console.WriteLine("     2: Build English Mod data");

            var input = Console.ReadKey().KeyChar;

            Console.WriteLine("\r          \n");
            switch (input)
            {
            case '1':
                Console.WriteLine("Selected updating spreadsheets after game update!");
                SpreadsheetUpdater.UpdateSpreadsheetsFromGameFiles();
                break;

            case '2':
                Console.WriteLine("Selected building English Mod data from spreadsheets");
                SpreadsheetUpdater.ExportToMod();
                break;

            default:
                Console.WriteLine("ERROR: Invalid option!");
                break;
            }

            /*
             * string test = "段红儿三阶-时间达标通告(触发於第一年四月中旬-望庐诀课后)(Movie中判定好感阶级大于一才触发对话)";
             * Console.WriteLine("Original: " + test);
             * BingTranslator bt = BingTranslator.GetInstance();
             * Task<string> t = bt.Translate(test);
             * t.Wait();
             *
             * Console.WriteLine("Translated: " + t.Result);
             */
            Console.WriteLine("Finished! Press any button to exit...");
            Console.ReadKey();
        }
Ejemplo n.º 3
0
        private static void GetTranslationStats()
        {
            List <TranslationStatEntry> stats = new List <TranslationStatEntry>();
            //Proofread Stats
            TranslationStatEntry proofReadStats = new TranslationStatEntry("Proofread");

            proofReadStats.AcceptableColors.Add(AssetVariable.ProofReadColor);
            proofReadStats.AcceptableColors.Add(new Google.Apis.Sheets.v4.Data.Color() //Cyan
            {
                Alpha = 1.0f,
                Red   = 0.0f / 255,
                Green = 0xFF / 255,
                Blue  = 0xFF / 255,
            });
            proofReadStats.AcceptableColors.Add(new Google.Apis.Sheets.v4.Data.Color()
            {
                Alpha = 1.0f,
                Red   = 0xC9 / 255,
                Green = 0xDA / 255,
                Blue  = 0xF8 / 255,
            });
            proofReadStats.AcceptableColors.Add(new Google.Apis.Sheets.v4.Data.Color()
            {
                Alpha = 1.0f,
                Red   = 0xA4 / 255,
                Green = 0xC2 / 255,
                Blue  = 0xF4 / 255,
            });
            proofReadStats.AcceptableColors.Add(new Google.Apis.Sheets.v4.Data.Color()
            {
                Alpha = 1.0f,
                Red   = 0x6D / 255,
                Green = 0x9E / 255,
                Blue  = 0xEB / 255,
            });
            proofReadStats.AcceptableColors.Add(new Google.Apis.Sheets.v4.Data.Color()
            {
                Alpha = 1.0f,
                Red   = 0x3C / 255,
                Green = 0x78 / 255,
                Blue  = 0xD8 / 255,
            });

            stats.Add(proofReadStats);

            //Translated Stats
            TranslationStatEntry translatedStats = new TranslationStatEntry("Translated");

            translatedStats.AcceptableColors.Add(AssetVariable.TranslatedColor);
            translatedStats.AcceptableColors.Add(new Google.Apis.Sheets.v4.Data.Color()
            {
                Alpha = 1.0f,
                Red   = 0x93 / 255,
                Green = 0xC4 / 255,
                Blue  = 0x7D / 255,
            });
            translatedStats.AcceptableColors.Add(new Google.Apis.Sheets.v4.Data.Color()
            {
                Alpha = 1.0f,
                Red   = 0xD9 / 255,
                Green = 0xEA / 255,
                Blue  = 0xD3 / 255,
            });
            translatedStats.AcceptableColors.Add(new Google.Apis.Sheets.v4.Data.Color()
            {
                Alpha = 1.0f,
                Red   = 0x34 / 255,
                Green = 0xA8 / 255,
                Blue  = 0x53 / 255,
            });

            stats.Add(translatedStats);

            //Needs manual check Stats
            TranslationStatEntry manualCheckingReqStats = new TranslationStatEntry("Needs manual Checking (usually due to game update)");

            manualCheckingReqStats.AcceptableColors.Add(AssetVariable.NeedsCheckColor);
            stats.Add(manualCheckingReqStats);

            //MTL
            TranslationStatEntry mtlStats = new TranslationStatEntry("Machine Translated");

            mtlStats.AcceptableColors.Add(AssetVariable.MTLColor);
            stats.Add(mtlStats);

            //Others (Unknown)
            TranslationStatEntry unknownStats = new TranslationStatEntry("Marked in unknown cell color (Manually marked)");

            unknownStats.MatchAll = true;
            stats.Add(unknownStats);


            SpreadsheetUpdater.GetTranslationStats(ref stats);

            foreach (TranslationStatEntry statEntry in stats)
            {
                Console.WriteLine(statEntry.Name + " => Lines: " + statEntry.LineCount.ToString() + " (Words: " + statEntry.WordCount.ToString() + " )");
            }
        }
Ejemplo n.º 4
0
 private static void UpdateSpreadsheets()
 {
     SpreadsheetUpdater.UpdateSpreadsheetsFromGameFiles();
 }