Exemplo n.º 1
0
        private void btnMergeTranslate_Click(object sender, EventArgs e)
        {
            string translatedpath = OutPathBinTranslate + (tIs64 ? @"Translation64.xml" : @"Translation.xml");//exported xml

            if (!File.Exists(translatedpath))
            {
                MessageBox.Show("Original translation.xml file not found make sure you have unpacked local file and try again.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (!File.Exists(FileTranslate))
            {
                MessageBox.Show("Merge translation.xml file not found make sure you have selected it and try again.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                Console.WriteLine("\rMerging translation...");
                RunWithWorker(((o, args) =>
                {
                    TranslateReader translateControl_Na = new TranslateReader();
                    translateControl_Na.Load(FileTranslate);//translated xml

                    TranslateReader translateControl_Org = new TranslateReader();
                    translateControl_Org.Load(translatedpath, true);//

                    translateControl_Org.MergeTranslation(translateControl_Na, translatedpath);
                }));
            }
        }
Exemplo n.º 2
0
        private void BtnMerge_Click(object sender, EventArgs e)
        {
            if (multiworker != null && multiworker.IsBusy)
            {
                multiworker.CancelAsync();
            }

            try
            {
                if (File.Exists(TranslationSourceFile) || File.Exists(TranslationTargetFile))
                {
                    Console.WriteLine("\rMerging translation...");
                    GboxTranslator.Enabled = false;
                    RunWithWorker(((o, args) =>
                    {
                        TranslateReader translateControl_Na = new TranslateReader();
                        translateControl_Na.Load(TranslationSourceFile);                                   //Source xml
                        TranslateReader translateControl_Org = new TranslateReader();
                        translateControl_Org.Load(TranslationTargetFile, true);                            //Target xml
                        translateControl_Org.MergeTranslation(translateControl_Na, TranslationTargetFile); //Target xml
                        GboxTranslator.Enabled = true;
                    }));
                }
                else
                {
                    MessageBox.Show("Translation files not exist please select source and merge files first.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Exemplo n.º 3
0
        void TranslateMerge(object sender, EventArgs e)
        {
            Console.WriteLine("\rMerging translation...");

            TranslateReader translateControl_Na = new TranslateReader();

            translateControl_Na.Load(SourceMergeFile);//Source xml

            TranslateReader translateControl_Org = new TranslateReader();

            translateControl_Org.Load(TargetMergeFile, true);                            //Target xml

            translateControl_Org.MergeTranslation(translateControl_Na, TargetMergeFile); //Target xml
        }