소스 검색

added 'en' to supported languages

Scrublord1336 6 년 전
부모
커밋
98d8527292
1개의 변경된 파일14개의 추가작업 그리고 0개의 파일을 삭제
  1. 14 0
      src/XUnity.AutoTranslator.Plugin.Core/Utilities/TextHelper.cs

+ 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.
       ///