KnownEndpoints.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using XUnity.AutoTranslator.Plugin.Core.Constants;
  6. using XUnity.AutoTranslator.Plugin.Core.Web;
  7. namespace XUnity.AutoTranslator.Plugin.Core
  8. {
  9. public static class KnownEndpoints
  10. {
  11. public static IKnownEndpoint FindEndpoint( string identifier )
  12. {
  13. if( string.IsNullOrEmpty( identifier ) ) return null;
  14. switch( identifier )
  15. {
  16. case KnownEndpointNames.GoogleTranslate:
  17. return new GoogleTranslateEndpoint();
  18. case KnownEndpointNames.GoogleTranslateHack:
  19. return new GoogleTranslateHackEndpoint();
  20. case KnownEndpointNames.BaiduTranslate:
  21. return new BaiduTranslateEndpoint();
  22. //case KnownEndpointNames.YandexTranslate:
  23. // return new YandexTranslateEndpoint();
  24. //case KnownEndpointNames.WatsonTranslate:
  25. // return new WatsonTranslateEndpoint();
  26. case KnownEndpointNames.ExciteTranslate:
  27. return new ExciteTranslateEndpoint();
  28. default:
  29. return new DefaultEndpoint( identifier );
  30. }
  31. }
  32. }
  33. }