public TranslationJob EnqueueTranslation( object ui, UntranslatedText key, InternalTranslationResult translationResult, ParserTranslationContext context, UntranslatedTextInfo untranslatedTextContext, bool checkOtherEndpoints, bool saveResultGlobally, bool isTranslatable, bool allowFallback) { var added = AssociateWithExistingJobIfPossible(ui, key, translationResult, context, untranslatedTextContext, saveResultGlobally, allowFallback); if (added) { return(null); } if (checkOtherEndpoints) { var endpoints = Manager.ConfiguredEndpoints; var len = endpoints.Count; for (int i = 0; i < len; i++) { var endpoint = endpoints[i]; if (endpoint == this) { continue; } added = endpoint.AssociateWithExistingJobIfPossible(ui, key, translationResult, context, untranslatedTextContext, saveResultGlobally, allowFallback); if (added) { return(null); } } } if (!Settings.EnableSilentMode) { XuaLogger.AutoTranslator.Debug("Queued: '" + key.TemplatedOriginal_Text + "'"); } var newJob = new TranslationJob(this, key, saveResultGlobally, isTranslatable); newJob.Associate(key, ui, translationResult, context, untranslatedTextContext, saveResultGlobally, allowFallback); return(AddUnstartedJob(key, newJob)); }
public bool EnqueueTranslation(object ui, UntranslatedText key, TranslationResult translationResult, ParserTranslationContext context) { var added = AssociateWithExistingJobIfPossible(ui, key, translationResult, context); if (added) { return(false); } var checkOtherEndpoints = translationResult == null; if (checkOtherEndpoints) { var endpoints = Manager.ConfiguredEndpoints; var len = endpoints.Count; for (int i = 0; i < len; i++) { var endpoint = endpoints[i]; if (endpoint == this) { continue; } added = endpoint.AssociateWithExistingJobIfPossible(ui, key, translationResult, context); if (added) { return(false); } } } XuaLogger.Current.Debug("Queued: '" + key.TrimmedTranslatableText + "'"); var saveResultGlobally = checkOtherEndpoints; var newJob = new TranslationJob(this, key, saveResultGlobally); newJob.Associate(ui, translationResult, context); return(AddUnstartedJob(key, newJob)); }