|
@@ -62,6 +62,11 @@ namespace XUnity.AutoTranslator.Plugin.Core
|
|
private HashSet<object> _ongoingOperations = new HashSet<object>();
|
|
private HashSet<object> _ongoingOperations = new HashSet<object>();
|
|
private HashSet<string> _startedOperationsForNonStabilizableComponents = new HashSet<string>();
|
|
private HashSet<string> _startedOperationsForNonStabilizableComponents = new HashSet<string>();
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// This function will check if there are symbols of a given language contained in a string.
|
|
|
|
+ /// </summary>
|
|
|
|
+ private Func<string, bool> _symbolCheck;
|
|
|
|
+
|
|
private bool _isInTranslatedMode = true;
|
|
private bool _isInTranslatedMode = true;
|
|
|
|
|
|
public void Initialize()
|
|
public void Initialize()
|
|
@@ -72,6 +77,8 @@ namespace XUnity.AutoTranslator.Plugin.Core
|
|
|
|
|
|
AutoTranslateClient.Configure();
|
|
AutoTranslateClient.Configure();
|
|
|
|
|
|
|
|
+ _symbolCheck = TextHelper.GetSymbolCheck( Settings.FromLanguage );
|
|
|
|
+
|
|
LoadTranslations();
|
|
LoadTranslations();
|
|
|
|
|
|
// start a thread that will periodically removed unused references
|
|
// start a thread that will periodically removed unused references
|
|
@@ -373,7 +380,7 @@ namespace XUnity.AutoTranslator.Plugin.Core
|
|
/// </summary>
|
|
/// </summary>
|
|
private bool IsTranslatable( string str )
|
|
private bool IsTranslatable( string str )
|
|
{
|
|
{
|
|
- return TextHelper.ContainsJapaneseSymbols( str ) && str.Length <= Settings.MaxCharactersPerTranslation && !_translatedTexts.Contains( str );
|
|
|
|
|
|
+ return _symbolCheck( str ) && str.Length <= Settings.MaxCharactersPerTranslation && !_translatedTexts.Contains( str );
|
|
}
|
|
}
|
|
|
|
|
|
public bool ShouldTranslate( object ui )
|
|
public bool ShouldTranslate( object ui )
|