Преглед на файлове

Revert "commented out Yandex+Watson for 2.9.0 release"

This reverts commit 22fe64b8a2d04f12e70ca7ed19a1dd80c1c06b2f.
Scrublord1336 преди 6 години
родител
ревизия
d81043eacb
променени са 4 файла, в които са добавени 19 реда и са изтрити 9 реда
  1. 2 0
      CHANGELOG.md
  2. 9 1
      README.md
  3. 4 4
      src/XUnity.AutoTranslator.Plugin.Core/Configuration/Settings.cs
  4. 4 4
      src/XUnity.AutoTranslator.Plugin.Core/KnownEndpoints.cs

+ 2 - 0
CHANGELOG.md

@@ -1,5 +1,7 @@
 ### 2.9.0
  * FEATURE - Installation as UnityInjector plugin
+ * FEATURE - Support Yandex translate (requires key)
+ * FEATURE - Support Watson translate (requires key)
  * FEATURE - Support Excite translate
  * MISC - Better debugging capabilities with extra config options
 

+ 9 - 1
README.md

@@ -24,7 +24,7 @@ The default configuration file, looks as such (2.6.0+):
 
 ```ini
 [Service]
-Endpoint=GoogleTranslate         ;Endpoint to use. Can be ["GoogleTranslate", "BaiduTranslate", "ExciteTranslate", "GoogleTranslateHack"]
+Endpoint=GoogleTranslate         ;Endpoint to use. Can be ["GoogleTranslate", "BaiduTranslate", "GoogleTranslateHack", "BaiduTranslate", "YandexTranslate", "WatsonTranslate", "ExciteTranslate"]
 
 [General]
 Language=en                      ;The language to translate into
@@ -54,6 +54,14 @@ MaxClipboardCopyCharacters=450   ;Max number of characters to hook to clipboard
 BaiduAppId=                      ;OPTIONAL, needed if BaiduTranslate is configured
 BaiduAppSecret=                  ;OPTIONAL, needed if BaiduTranslate is configured
 
+[Yandex]
+YandexAPIKey=                    ;OPTIONAL, needed if YandexTranslate is configured
+
+[Watson]
+WatsonAPIUrl=                    ;OPTIONAL, needed if WatsonTranslate is configured
+WatsonAPIUsername=               ;OPTIONAL, needed if WatsonTranslate is configured
+WatsonAPIPassword=               ;OPTIONAL, needed if WatsonTranslate is configured
+
 [Debug]
 EnablePrintHierarchy=False       ;Used for debugging
 EnableConsole=False              ;Enables the console. Do not enable if other plugins (managers) handles this

+ 4 - 4
src/XUnity.AutoTranslator.Plugin.Core/Configuration/Settings.cs

@@ -95,11 +95,11 @@ namespace XUnity.AutoTranslator.Plugin.Core.Configuration
          BaiduAppId = Config.Current.Preferences[ "Baidu" ][ "BaiduAppId" ].GetOrDefault( "" );
          BaiduAppSecret = Config.Current.Preferences[ "Baidu" ][ "BaiduAppSecret" ].GetOrDefault( "" );
 
-         //YandexAPIKey = Config.Current.Preferences["Yandex"]["YandexAPIKey"].GetOrDefault("");
+         YandexAPIKey = Config.Current.Preferences["Yandex"]["YandexAPIKey"].GetOrDefault("");
 
-         //WatsonAPIUrl = Config.Current.Preferences["Watson"]["WatsonAPIUrl"].GetOrDefault("");
-         //WatsonAPIUsername = Config.Current.Preferences["Watson"]["WatsonAPIUsername"].GetOrDefault("");
-         //WatsonAPIPassword = Config.Current.Preferences["Watson"]["WatsonAPIPassword"].GetOrDefault("");
+         WatsonAPIUrl = Config.Current.Preferences["Watson"]["WatsonAPIUrl"].GetOrDefault("");
+         WatsonAPIUsername = Config.Current.Preferences["Watson"]["WatsonAPIUsername"].GetOrDefault("");
+         WatsonAPIPassword = Config.Current.Preferences["Watson"]["WatsonAPIPassword"].GetOrDefault("");
 
          EnablePrintHierarchy = Config.Current.Preferences[ "Debug" ][ "EnablePrintHierarchy" ].GetOrDefault( false );
          EnableConsole = Config.Current.Preferences[ "Debug" ][ "EnableConsole" ].GetOrDefault( false );

+ 4 - 4
src/XUnity.AutoTranslator.Plugin.Core/KnownEndpoints.cs

@@ -21,10 +21,10 @@ namespace XUnity.AutoTranslator.Plugin.Core
                return new GoogleTranslateHackEndpoint();
             case KnownEndpointNames.BaiduTranslate:
                return new BaiduTranslateEndpoint();
-            //case KnownEndpointNames.YandexTranslate:
-            //   return new YandexTranslateEndpoint();
-            //case KnownEndpointNames.WatsonTranslate:
-            //   return new WatsonTranslateEndpoint();
+            case KnownEndpointNames.YandexTranslate:
+               return new YandexTranslateEndpoint();
+            case KnownEndpointNames.WatsonTranslate:
+               return new WatsonTranslateEndpoint();
             case KnownEndpointNames.ExciteTranslate:
                return new ExciteTranslateEndpoint();
             default: