internal static void AddSource(LanguageSource Source)
        {
            if (Sources.Contains(Source))
            {
                return;
            }

            Sources.Add(Source);
#if !UNITY_EDITOR || I2LOC_AUTOSYNC_IN_EDITOR
            if (Source.HasGoogleSpreadsheet() && Source.GoogleUpdateFrequency != LanguageSource.eGoogleUpdateFrequency.Never)
            {
                Source.Import_Google_FromCache();
                if (Source.GoogleUpdateDelay > 0)
                {
                    CoroutineManager.Start(Delayed_Import_Google(Source, Source.GoogleUpdateDelay));
                }
                else
                {
                    Source.Import_Google();
                }
            }
#endif

            if (Source.mDictionary.Count == 0)
            {
                Source.UpdateDictionary(true);
            }
        }
        internal static void AddSource(LanguageSource Source)
        {
            if (Sources.Contains(Source))
            {
                return;
            }

            Sources.Add(Source);

            if (Source.HasGoogleSpreadsheet() && Source.GoogleUpdateFrequency != LanguageSource.eGoogleUpdateFrequency.Never)
            {
                #if !UNITY_EDITOR
                Source.Import_Google_FromCache();
                bool justCheck = false;
                #else
                bool justCheck = true;
                #endif
                if (Source.GoogleUpdateDelay > 0)
                {
                    CoroutineManager.Start(Delayed_Import_Google(Source, Source.GoogleUpdateDelay, justCheck));
                }
                else
                {
                    Source.Import_Google(false, justCheck);
                }
            }

            //if (force)
            {
                for (int i = 0; i < Source.mLanguages.Count(); ++i)
                {
                    Source.mLanguages[i].SetLoaded(true);
                }
            }

            if (Source.mDictionary.Count == 0)
            {
                Source.UpdateDictionary(true);
            }
        }
예제 #3
0
        internal static void AddSource(LanguageSource Source)
        {
            if (Sources.Contains(Source))
            {
                return;
            }

            Sources.Add(Source);
#if !UNITY_EDITOR || I2LOC_AUTOSYNC_IN_EDITOR
            Source.Import_Google_FromCache();
            if (Source.GoogleUpdateDelay > 0)
            {
                Source.Invoke("Delayed_Import_Google", Source.GoogleUpdateDelay);
            }
            else
            {
                Source.Import_Google();
            }
#endif
            if (Source.mDictionary.Count == 0)
            {
                Source.UpdateDictionary(true);
            }
        }
예제 #4
0
 internal static void AddSource(LanguageSource Source)
 {
     if (Sources.Contains(Source))
     {
         return;
     }
     Sources.Add(Source);
     if (Source.HasGoogleSpreadsheet() && Source.GoogleUpdateFrequency != LanguageSource.eGoogleUpdateFrequency.Never)
     {
         Source.Import_Google_FromCache();
         if (Source.GoogleUpdateDelay > 0f)
         {
             CoroutineManager.pInstance.StartCoroutine(Delayed_Import_Google(Source, Source.GoogleUpdateDelay));
         }
         else
         {
             Source.Import_Google();
         }
     }
     if (Source.mDictionary.Count == 0)
     {
         Source.UpdateDictionary(force: true);
     }
 }