ITranslateEndpoint.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Collections;
  3. using System.IO;
  4. using XUnity.AutoTranslator.Plugin.Core.Configuration;
  5. using XUnity.AutoTranslator.Plugin.Core.Extensions;
  6. using XUnity.AutoTranslator.Plugin.Core.Web;
  7. namespace XUnity.AutoTranslator.Plugin.Core.Endpoints
  8. {
  9. public interface ITranslateEndpoint
  10. {
  11. /// <summary>
  12. /// Gets the id of the IKnownEndpoint that is used as a configuration parameter.
  13. /// </summary>
  14. string Id { get; }
  15. /// <summary>
  16. /// Gets a friendly name that can be displayed to the user representing the plugin.
  17. /// </summary>
  18. string FriendlyName { get; }
  19. /// <summary>
  20. /// Gets the maximum concurrency for the endpoint. This specifies how many times "Translate"
  21. /// can be called before it returns.
  22. /// </summary>
  23. int MaxConcurrency { get; }
  24. /// <summary>
  25. /// Called during initialization. Use this to initialize plugin or throw exception if impossible.
  26. /// </summary>
  27. void Initialize( IInitializationContext context );
  28. /// <summary>
  29. /// Attempt to translated the provided untranslated text. Will be used in a "coroutine", so it can be implemented
  30. /// in an async fashion.
  31. /// </summary>
  32. IEnumerator Translate( ITranslationContext context );
  33. }
  34. }