Ver código fonte

added 'en' to supported languages

Scrublord1336 6 anos atrás
pai
commit
98d8527292

+ 14 - 0
src/XUnity.AutoTranslator.Plugin.Core/Utilities/TextHelper.cs

@@ -14,6 +14,7 @@ namespace XUnity.AutoTranslator.Plugin.Core.Utilities
          { "zh-CN", ContainsChineseSymbols },
          { "zh-TW", ContainsChineseSymbols },
          { "ko", ContainsKoreanSymbols },
+         { "en", ContainsStandardLatinSymbols },
       };
 
       public static bool IsFromLanguageSupported( string code )
@@ -95,6 +96,19 @@ namespace XUnity.AutoTranslator.Plugin.Core.Utilities
          return false;
       }
 
+      public static bool ContainsStandardLatinSymbols( string text )
+      {
+         foreach( var c in text )
+         {
+            if( ( c >= '\u0041' && c <= '\u005a' )
+               || ( c >= '\u0061' && c <= '\u007a' ) )
+            {
+               return true;
+            }
+         }
+         return false;
+      }
+
       /// <summary>
       /// Decodes a text from a single-line serializable format.
       ///