コード例 #1
0
 public static void Translate(ITranslate obj, string translationName)
 {
     ITranslation translation = GetTranslation(translationName);
     if (translation == null)
         return;
     obj.TranslateItems(translation);
 }
コード例 #2
0
        public void CreateInstanceOfClass()
        {
            // just reference to GitUI
            MouseWheelRedirector.Active = true;

            var translatableTypes = TranslationUtl.GetTranslatableTypes();

            var testTranslation = new Dictionary <string, TranslationFile>();

            foreach (var types in translatableTypes)
            {
                var tranlation = new TranslationFile();
                foreach (Type type in types.Value)
                {
                    try
                    {
                        ITranslate obj = TranslationUtl.CreateInstanceOfClass(type) as ITranslate;
                        obj.AddTranslationItems(tranlation);
                        obj.TranslateItems(tranlation);
                    }
                    catch (Exception)
                    {
                        Trace.WriteLine("Problem with class: " + type.FullName);
                        throw;
                    }
                }

                testTranslation[types.Key] = tranlation;
            }
        }
コード例 #3
0
        public static void Translate(ITranslate obj, string translationName)
        {
            ITranslation translation = GetTranslation(translationName);

            if (translation == null)
            {
                return;
            }
            obj.TranslateItems(translation);
        }
コード例 #4
0
ファイル: Translator.cs プロジェクト: Carbenium/gitextensions
 public static void Translate(ITranslate obj, string translationName)
 {
     var translation = GetTranslation(translationName);
     if (translation.Count == 0)
         return;
     foreach (var pair in translation)
     {
         obj.TranslateItems(pair.Value);
     }
 }
コード例 #5
0
        public static void Translate(ITranslate obj, string translationName)
        {
            var translation = GetTranslation(translationName);

            if (translation.Count == 0)
            {
                return;
            }
            foreach (var pair in translation)
            {
                obj.TranslateItems(pair.Value);
            }
        }
コード例 #6
0
        public void CreateInstanceOfClass()
        {
            // just reference to GitUI
            MouseWheelRedirector.Active = true;

            List <Type> translatableTypes = TranslationUtl.GetTranslatableTypes();

            var testTranslation = new Translation();

            foreach (Type type in translatableTypes)
            {
                try
                {
                    ITranslate obj = TranslationUtl.CreateInstanceOfClass(type) as ITranslate;
                    obj.AddTranslationItems(testTranslation);
                    obj.TranslateItems(testTranslation);
                }
                catch (System.Exception)
                {
                    Trace.WriteLine("Problem with class: " + type.FullName);
                    throw;
                }
            }
        }