소스 검색

splitting out translator projects

randoman 6 년 전
부모
커밋
abb5b9093b
23개의 변경된 파일877개의 추가작업 그리고 462개의 파일을 삭제
  1. 2 0
      CHANGELOG.md
  2. 58 2
      XUnity.AutoTranslator.sln
  3. 28 0
      src/Translators/XUnity.AutoTranslator.Plugin.BaiduTranslate/XUnity.AutoTranslator.Plugin.BaiduTranslate.csproj
  4. 25 0
      src/Translators/XUnity.AutoTranslator.Plugin.BingTranslate/XUnity.AutoTranslator.Plugin.BingTranslate.csproj
  5. 28 0
      src/Translators/XUnity.AutoTranslator.Plugin.BingTranslateLegitimate/XUnity.AutoTranslator.Plugin.BingTranslateLegitimate.csproj
  6. 28 0
      src/Translators/XUnity.AutoTranslator.Plugin.CustomTranslate/XUnity.AutoTranslator.Plugin.CustomTranslate.csproj
  7. 8 0
      src/Translators/XUnity.AutoTranslator.Plugin.GoogleTranslate/XUnity.AutoTranslator.Plugin.GoogleTranslate.csproj
  8. 28 0
      src/Translators/XUnity.AutoTranslator.Plugin.GoogleTranslateLegitimate/XUnity.AutoTranslator.Plugin.GoogleTranslateLegitimate.csproj
  9. 28 0
      src/Translators/XUnity.AutoTranslator.Plugin.LecPowerTranslator15/XUnity.AutoTranslator.Plugin.LecPowerTranslator15.csproj
  10. 28 0
      src/Translators/XUnity.AutoTranslator.Plugin.WatsonTranslate/XUnity.AutoTranslator.Plugin.WatsonTranslate.csproj
  11. 28 0
      src/Translators/XUnity.AutoTranslator.Plugin.YandexTranslate/XUnity.AutoTranslator.Plugin.YandexTranslate.csproj
  12. 1 1
      src/XUnity.AutoTranslator.Plugin.BepIn/XUnity.AutoTranslator.Plugin.BepIn.csproj
  13. 1 0
      src/XUnity.AutoTranslator.Plugin.Core/AutoTranslationPlugin.cs
  14. 0 3
      src/XUnity.AutoTranslator.Plugin.Core/Endpoints/Http/BingTranslateEndpoint.cs
  15. 0 1
      src/XUnity.AutoTranslator.Plugin.Core/Endpoints/Http/BingTranslateLegitimateEndpoint.cs
  16. 2 2
      src/XUnity.AutoTranslator.Plugin.Core/Endpoints/Http/CustomTranslateEndpoint.cs
  17. 0 1
      src/XUnity.AutoTranslator.Plugin.Core/Endpoints/Http/GoogleTranslateLegitimateEndpoint.cs
  18. 3 17
      src/XUnity.AutoTranslator.Plugin.Core/Endpoints/ProcessLineProtocol/LecPowerTranslator15Endpoint.cs
  19. 0 62
      src/XUnity.AutoTranslator.Plugin.Core/Endpoints/Www/ExciteTranslateEndpoint.cs
  20. 20 15
      src/XUnity.AutoTranslator.Plugin.Core/Endpoints/Www/WatsonTranslateEndpoint.cs
  21. 5 1
      src/XUnity.AutoTranslator.Plugin.Core/Endpoints/Www/WwwEndpoint.cs
  22. 550 355
      src/XUnity.AutoTranslator.Plugin.Core/Web/Internal/ConnectionTrackingWebClient.cs
  23. 6 2
      src/XUnity.AutoTranslator.Plugin.Core/Web/XUnityWebClient.cs

+ 2 - 0
CHANGELOG.md

@@ -4,6 +4,8 @@
  * FEATURE - Support BingTranslate API
  * FEATURE - Support LEC Offline Power Translator 15
  * FEATURE - Enable custom implementations of translators that can be loaded dynamically
+ * FEATURE - Removed support for Excite translate because it only support the 'WWW' API in Unity due to missing TLS1.2 implementation
+ * FEATURE - Updated Watson translate to v3
  * MISC - {GameExeName} variable can now be used in configuration of directories and files
  * MISC - Changed the way the 'Custom' endpoint works. See README for more info
  * MISC - Added new configuration 'GameLogTextPaths' to enable special handling of text components that text is being appended to continuously (requires export knowledge to setup)

+ 58 - 2
XUnity.AutoTranslator.sln

@@ -34,9 +34,25 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XUnity.AutoTranslator.Plugi
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Translators", "Translators", "{7A01BA34-3B96-4910-AC70-462BA59417CB}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnity.AutoTranslator.Plugin.DummyTranslator", "src\Translators\XUnity.AutoTranslator.Plugin.DummyTranslator\XUnity.AutoTranslator.Plugin.DummyTranslator.csproj", "{7493BA4A-C688-4103-B161-7E578FBB6C0E}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XUnity.AutoTranslator.Plugin.DummyTranslator", "src\Translators\XUnity.AutoTranslator.Plugin.DummyTranslator\XUnity.AutoTranslator.Plugin.DummyTranslator.csproj", "{7493BA4A-C688-4103-B161-7E578FBB6C0E}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnity.AutoTranslator.Plugin.GoogleTranslate", "src\Translators\XUnity.AutoTranslator.Plugin.GoogleTranslate\XUnity.AutoTranslator.Plugin.GoogleTranslate.csproj", "{5D9A4F4D-D2D2-4D2B-A58A-F7529DDAF1D0}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XUnity.AutoTranslator.Plugin.GoogleTranslate", "src\Translators\XUnity.AutoTranslator.Plugin.GoogleTranslate\XUnity.AutoTranslator.Plugin.GoogleTranslate.csproj", "{5D9A4F4D-D2D2-4D2B-A58A-F7529DDAF1D0}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnity.AutoTranslator.Plugin.BingTranslate", "src\Translators\XUnity.AutoTranslator.Plugin.BingTranslate\XUnity.AutoTranslator.Plugin.BingTranslate.csproj", "{95C83913-8D7F-4FA1-877E-288251A2A461}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnity.AutoTranslator.Plugin.GoogleTranslateLegitimate", "src\Translators\XUnity.AutoTranslator.Plugin.GoogleTranslateLegitimate\XUnity.AutoTranslator.Plugin.GoogleTranslateLegitimate.csproj", "{151F7489-AB89-482D-9128-4D65F2D7B8EA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnity.AutoTranslator.Plugin.BaiduTranslate", "src\Translators\XUnity.AutoTranslator.Plugin.BaiduTranslate\XUnity.AutoTranslator.Plugin.BaiduTranslate.csproj", "{DDE97F5D-E021-45C0-87B6-FAD35BC8BCFB}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnity.AutoTranslator.Plugin.BingTranslateLegitimate", "src\Translators\XUnity.AutoTranslator.Plugin.BingTranslateLegitimate\XUnity.AutoTranslator.Plugin.BingTranslateLegitimate.csproj", "{F49BA6D1-FAFB-414C-97B1-28B77FC21286}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnity.AutoTranslator.Plugin.CustomTranslate", "src\Translators\XUnity.AutoTranslator.Plugin.CustomTranslate\XUnity.AutoTranslator.Plugin.CustomTranslate.csproj", "{CEA7D2D8-C2CF-4FA3-8184-DD485160CDAC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnity.AutoTranslator.Plugin.YandexTranslate", "src\Translators\XUnity.AutoTranslator.Plugin.YandexTranslate\XUnity.AutoTranslator.Plugin.YandexTranslate.csproj", "{42DEC139-7E8E-4E2E-9BC9-0B5661F444C5}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnity.AutoTranslator.Plugin.WatsonTranslate", "src\Translators\XUnity.AutoTranslator.Plugin.WatsonTranslate\XUnity.AutoTranslator.Plugin.WatsonTranslate.csproj", "{A74F9486-2BA0-42FF-8BBC-9F07ECFBDCE5}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnity.AutoTranslator.Plugin.LecPowerTranslator15", "src\Translators\XUnity.AutoTranslator.Plugin.LecPowerTranslator15\XUnity.AutoTranslator.Plugin.LecPowerTranslator15.csproj", "{AE28F88E-E877-456B-98AB-BD03A59A3E44}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -80,6 +96,38 @@ Global
 		{5D9A4F4D-D2D2-4D2B-A58A-F7529DDAF1D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{5D9A4F4D-D2D2-4D2B-A58A-F7529DDAF1D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{5D9A4F4D-D2D2-4D2B-A58A-F7529DDAF1D0}.Release|Any CPU.Build.0 = Release|Any CPU
+		{95C83913-8D7F-4FA1-877E-288251A2A461}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{95C83913-8D7F-4FA1-877E-288251A2A461}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{95C83913-8D7F-4FA1-877E-288251A2A461}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{95C83913-8D7F-4FA1-877E-288251A2A461}.Release|Any CPU.Build.0 = Release|Any CPU
+		{151F7489-AB89-482D-9128-4D65F2D7B8EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{151F7489-AB89-482D-9128-4D65F2D7B8EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{151F7489-AB89-482D-9128-4D65F2D7B8EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{151F7489-AB89-482D-9128-4D65F2D7B8EA}.Release|Any CPU.Build.0 = Release|Any CPU
+		{DDE97F5D-E021-45C0-87B6-FAD35BC8BCFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{DDE97F5D-E021-45C0-87B6-FAD35BC8BCFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{DDE97F5D-E021-45C0-87B6-FAD35BC8BCFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{DDE97F5D-E021-45C0-87B6-FAD35BC8BCFB}.Release|Any CPU.Build.0 = Release|Any CPU
+		{F49BA6D1-FAFB-414C-97B1-28B77FC21286}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{F49BA6D1-FAFB-414C-97B1-28B77FC21286}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{F49BA6D1-FAFB-414C-97B1-28B77FC21286}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{F49BA6D1-FAFB-414C-97B1-28B77FC21286}.Release|Any CPU.Build.0 = Release|Any CPU
+		{CEA7D2D8-C2CF-4FA3-8184-DD485160CDAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{CEA7D2D8-C2CF-4FA3-8184-DD485160CDAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{CEA7D2D8-C2CF-4FA3-8184-DD485160CDAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{CEA7D2D8-C2CF-4FA3-8184-DD485160CDAC}.Release|Any CPU.Build.0 = Release|Any CPU
+		{42DEC139-7E8E-4E2E-9BC9-0B5661F444C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{42DEC139-7E8E-4E2E-9BC9-0B5661F444C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{42DEC139-7E8E-4E2E-9BC9-0B5661F444C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{42DEC139-7E8E-4E2E-9BC9-0B5661F444C5}.Release|Any CPU.Build.0 = Release|Any CPU
+		{A74F9486-2BA0-42FF-8BBC-9F07ECFBDCE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{A74F9486-2BA0-42FF-8BBC-9F07ECFBDCE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{A74F9486-2BA0-42FF-8BBC-9F07ECFBDCE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{A74F9486-2BA0-42FF-8BBC-9F07ECFBDCE5}.Release|Any CPU.Build.0 = Release|Any CPU
+		{AE28F88E-E877-456B-98AB-BD03A59A3E44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{AE28F88E-E877-456B-98AB-BD03A59A3E44}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{AE28F88E-E877-456B-98AB-BD03A59A3E44}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{AE28F88E-E877-456B-98AB-BD03A59A3E44}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -95,6 +143,14 @@ Global
 		{7A01BA34-3B96-4910-AC70-462BA59417CB} = {0F9B38FC-4E57-4B83-AF0B-0993B8470823}
 		{7493BA4A-C688-4103-B161-7E578FBB6C0E} = {7A01BA34-3B96-4910-AC70-462BA59417CB}
 		{5D9A4F4D-D2D2-4D2B-A58A-F7529DDAF1D0} = {7A01BA34-3B96-4910-AC70-462BA59417CB}
+		{95C83913-8D7F-4FA1-877E-288251A2A461} = {7A01BA34-3B96-4910-AC70-462BA59417CB}
+		{151F7489-AB89-482D-9128-4D65F2D7B8EA} = {7A01BA34-3B96-4910-AC70-462BA59417CB}
+		{DDE97F5D-E021-45C0-87B6-FAD35BC8BCFB} = {7A01BA34-3B96-4910-AC70-462BA59417CB}
+		{F49BA6D1-FAFB-414C-97B1-28B77FC21286} = {7A01BA34-3B96-4910-AC70-462BA59417CB}
+		{CEA7D2D8-C2CF-4FA3-8184-DD485160CDAC} = {7A01BA34-3B96-4910-AC70-462BA59417CB}
+		{42DEC139-7E8E-4E2E-9BC9-0B5661F444C5} = {7A01BA34-3B96-4910-AC70-462BA59417CB}
+		{A74F9486-2BA0-42FF-8BBC-9F07ECFBDCE5} = {7A01BA34-3B96-4910-AC70-462BA59417CB}
+		{AE28F88E-E877-456B-98AB-BD03A59A3E44} = {7A01BA34-3B96-4910-AC70-462BA59417CB}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {EE803FED-4447-4D19-B3D6-88C56E8DFCCA}

+ 28 - 0
src/Translators/XUnity.AutoTranslator.Plugin.BaiduTranslate/XUnity.AutoTranslator.Plugin.BaiduTranslate.csproj

@@ -0,0 +1,28 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+   <PropertyGroup>
+      <TargetFramework>net35</TargetFramework>
+   </PropertyGroup>
+
+   <ItemGroup>
+     <Compile Include="..\..\XUnity.AutoTranslator.Plugin.Core\Endpoints\Http\BaiduTranslateEndpoint.cs" Link="BaiduTranslateEndpoint.cs" />
+   </ItemGroup>
+
+   <ItemGroup>
+      <ProjectReference Include="..\..\XUnity.AutoTranslator.Plugin.Core\XUnity.AutoTranslator.Plugin.Core.csproj" />
+   </ItemGroup>
+
+   <ItemGroup>
+      <Reference Include="ExIni">
+        <HintPath>..\..\..\libs\ExIni.dll</HintPath>
+      </Reference>
+      <Reference Include="UnityEngine">
+         <HintPath>..\..\..\libs\UnityEngine.dll</HintPath>
+      </Reference>
+   </ItemGroup>
+
+   <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+      <Exec Command="if $(ConfigurationName) == Release (&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)dist\Translators\&quot;&#xD;&#xA;)" />
+   </Target>
+
+</Project>

+ 25 - 0
src/Translators/XUnity.AutoTranslator.Plugin.BingTranslate/XUnity.AutoTranslator.Plugin.BingTranslate.csproj

@@ -0,0 +1,25 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net35</TargetFramework>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Compile Include="..\..\XUnity.AutoTranslator.Plugin.Core\Endpoints\Http\BingTranslateEndpoint.cs" Link="BingTranslateEndpoint.cs" />
+  </ItemGroup>
+
+   <ItemGroup>
+      <ProjectReference Include="..\..\XUnity.AutoTranslator.Plugin.Core\XUnity.AutoTranslator.Plugin.Core.csproj" />
+   </ItemGroup>
+
+   <ItemGroup>
+      <Reference Include="UnityEngine">
+         <HintPath>..\..\..\libs\UnityEngine.dll</HintPath>
+      </Reference>
+   </ItemGroup>
+
+   <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+      <Exec Command="if $(ConfigurationName) == Release (&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)dist\Translators\&quot;&#xD;&#xA;)" />
+   </Target>
+
+</Project>

+ 28 - 0
src/Translators/XUnity.AutoTranslator.Plugin.BingTranslateLegitimate/XUnity.AutoTranslator.Plugin.BingTranslateLegitimate.csproj

@@ -0,0 +1,28 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+   <PropertyGroup>
+      <TargetFramework>net35</TargetFramework>
+   </PropertyGroup>
+
+   <ItemGroup>
+     <Compile Include="..\..\XUnity.AutoTranslator.Plugin.Core\Endpoints\Http\BingTranslateLegitimateEndpoint.cs" Link="BingTranslateLegitimateEndpoint.cs" />
+   </ItemGroup>
+
+   <ItemGroup>
+      <ProjectReference Include="..\..\XUnity.AutoTranslator.Plugin.Core\XUnity.AutoTranslator.Plugin.Core.csproj" />
+   </ItemGroup>
+
+   <ItemGroup>
+      <Reference Include="ExIni">
+         <HintPath>..\..\..\libs\ExIni.dll</HintPath>
+      </Reference>
+      <Reference Include="UnityEngine">
+         <HintPath>..\..\..\libs\UnityEngine.dll</HintPath>
+      </Reference>
+   </ItemGroup>
+
+   <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+      <Exec Command="if $(ConfigurationName) == Release (&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)dist\Translators\&quot;&#xD;&#xA;)" />
+   </Target>
+
+</Project>

+ 28 - 0
src/Translators/XUnity.AutoTranslator.Plugin.CustomTranslate/XUnity.AutoTranslator.Plugin.CustomTranslate.csproj

@@ -0,0 +1,28 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+   <PropertyGroup>
+      <TargetFramework>net35</TargetFramework>
+   </PropertyGroup>
+
+   <ItemGroup>
+     <Compile Include="..\..\XUnity.AutoTranslator.Plugin.Core\Endpoints\Http\CustomTranslateEndpoint.cs" Link="CustomTranslateEndpoint.cs" />
+   </ItemGroup>
+
+   <ItemGroup>
+      <ProjectReference Include="..\..\XUnity.AutoTranslator.Plugin.Core\XUnity.AutoTranslator.Plugin.Core.csproj" />
+   </ItemGroup>
+
+   <ItemGroup>
+      <Reference Include="ExIni">
+         <HintPath>..\..\..\libs\ExIni.dll</HintPath>
+      </Reference>
+      <Reference Include="UnityEngine">
+         <HintPath>..\..\..\libs\UnityEngine.dll</HintPath>
+      </Reference>
+   </ItemGroup>
+
+   <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+      <Exec Command="if $(ConfigurationName) == Release (&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)dist\Translators\&quot;&#xD;&#xA;)" />
+   </Target>
+
+</Project>

+ 8 - 0
src/Translators/XUnity.AutoTranslator.Plugin.GoogleTranslate/XUnity.AutoTranslator.Plugin.GoogleTranslate.csproj

@@ -4,6 +4,10 @@
     <TargetFramework>net35</TargetFramework>
   </PropertyGroup>
 
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
+    <OutputPath></OutputPath>
+  </PropertyGroup>
+
   <ItemGroup>
     <Compile Include="..\..\XUnity.AutoTranslator.Plugin.Core\Endpoints\Http\GoogleTranslateEndpoint.cs" Link="GoogleTranslateEndpoint.cs" />
   </ItemGroup>
@@ -18,4 +22,8 @@
     </Reference>
   </ItemGroup>
 
+  <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+    <Exec Command="if $(ConfigurationName) == Release (&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)dist\Translators\&quot;&#xD;&#xA;)" />
+  </Target>
+
 </Project>

+ 28 - 0
src/Translators/XUnity.AutoTranslator.Plugin.GoogleTranslateLegitimate/XUnity.AutoTranslator.Plugin.GoogleTranslateLegitimate.csproj

@@ -0,0 +1,28 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+   <PropertyGroup>
+      <TargetFramework>net35</TargetFramework>
+   </PropertyGroup>
+
+   <ItemGroup>
+     <Compile Include="..\..\XUnity.AutoTranslator.Plugin.Core\Endpoints\Http\GoogleTranslateLegitimateEndpoint.cs" Link="GoogleTranslateLegitimateEndpoint.cs" />
+   </ItemGroup>
+
+   <ItemGroup>
+      <ProjectReference Include="..\..\XUnity.AutoTranslator.Plugin.Core\XUnity.AutoTranslator.Plugin.Core.csproj" />
+   </ItemGroup>
+
+   <ItemGroup>
+      <Reference Include="ExIni">
+        <HintPath>..\..\..\libs\ExIni.dll</HintPath>
+      </Reference>
+      <Reference Include="UnityEngine">
+         <HintPath>..\..\..\libs\UnityEngine.dll</HintPath>
+      </Reference>
+   </ItemGroup>
+
+   <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+      <Exec Command="if $(ConfigurationName) == Release (&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)dist\Translators\&quot;&#xD;&#xA;)" />
+   </Target>
+
+</Project>

+ 28 - 0
src/Translators/XUnity.AutoTranslator.Plugin.LecPowerTranslator15/XUnity.AutoTranslator.Plugin.LecPowerTranslator15.csproj

@@ -0,0 +1,28 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+   <PropertyGroup>
+      <TargetFramework>net35</TargetFramework>
+   </PropertyGroup>
+
+   <ItemGroup>
+     <Compile Include="..\..\XUnity.AutoTranslator.Plugin.Core\Endpoints\ProcessLineProtocol\LecPowerTranslator15Endpoint.cs" Link="LecPowerTranslator15Endpoint.cs" />
+   </ItemGroup>
+
+   <ItemGroup>
+      <ProjectReference Include="..\..\XUnity.AutoTranslator.Plugin.Core\XUnity.AutoTranslator.Plugin.Core.csproj" />
+   </ItemGroup>
+
+   <ItemGroup>
+      <Reference Include="ExIni">
+         <HintPath>..\..\..\libs\ExIni.dll</HintPath>
+      </Reference>
+      <Reference Include="UnityEngine">
+         <HintPath>..\..\..\libs\UnityEngine.dll</HintPath>
+      </Reference>
+   </ItemGroup>
+
+   <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+      <Exec Command="if $(ConfigurationName) == Release (&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)dist\Translators\&quot;&#xD;&#xA;)" />
+   </Target>
+
+</Project>

+ 28 - 0
src/Translators/XUnity.AutoTranslator.Plugin.WatsonTranslate/XUnity.AutoTranslator.Plugin.WatsonTranslate.csproj

@@ -0,0 +1,28 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+   <PropertyGroup>
+      <TargetFramework>net35</TargetFramework>
+   </PropertyGroup>
+
+   <ItemGroup>
+     <Compile Include="..\..\XUnity.AutoTranslator.Plugin.Core\Endpoints\Www\WatsonTranslateEndpoint.cs" Link="WatsonTranslateEndpoint.cs" />
+   </ItemGroup>
+
+   <ItemGroup>
+      <ProjectReference Include="..\..\XUnity.AutoTranslator.Plugin.Core\XUnity.AutoTranslator.Plugin.Core.csproj" />
+   </ItemGroup>
+
+   <ItemGroup>
+      <Reference Include="ExIni">
+         <HintPath>..\..\..\libs\ExIni.dll</HintPath>
+      </Reference>
+      <Reference Include="UnityEngine">
+         <HintPath>..\..\..\libs\UnityEngine.dll</HintPath>
+      </Reference>
+   </ItemGroup>
+
+   <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+      <Exec Command="if $(ConfigurationName) == Release (&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)dist\Translators\&quot;&#xD;&#xA;)" />
+   </Target>
+
+</Project>

+ 28 - 0
src/Translators/XUnity.AutoTranslator.Plugin.YandexTranslate/XUnity.AutoTranslator.Plugin.YandexTranslate.csproj

@@ -0,0 +1,28 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+   <PropertyGroup>
+      <TargetFramework>net35</TargetFramework>
+   </PropertyGroup>
+
+   <ItemGroup>
+     <Compile Include="..\..\XUnity.AutoTranslator.Plugin.Core\Endpoints\Http\YandexTranslateEndpoint.cs" Link="YandexTranslateEndpoint.cs" />
+   </ItemGroup>
+
+   <ItemGroup>
+      <ProjectReference Include="..\..\XUnity.AutoTranslator.Plugin.Core\XUnity.AutoTranslator.Plugin.Core.csproj" />
+   </ItemGroup>
+
+   <ItemGroup>
+      <Reference Include="ExIni">
+         <HintPath>..\..\..\libs\ExIni.dll</HintPath>
+      </Reference>
+      <Reference Include="UnityEngine">
+         <HintPath>..\..\..\libs\UnityEngine.dll</HintPath>
+      </Reference>
+   </ItemGroup>
+
+   <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+      <Exec Command="if $(ConfigurationName) == Release (&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)dist\Translators\&quot;&#xD;&#xA;)" />
+   </Target>
+
+</Project>

+ 1 - 1
src/XUnity.AutoTranslator.Plugin.BepIn/XUnity.AutoTranslator.Plugin.BepIn.csproj

@@ -31,7 +31,7 @@
       <ItemGroup>
          <VersionNumber Include="$([System.Text.RegularExpressions.Regex]::Replace(&quot;%(Targets.Version)&quot;, &quot;^(.+?)(\.0+)$&quot;, &quot;$1&quot;))" />
       </ItemGroup>
-      <Exec Command="if $(ConfigurationName) == Release (&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)ExIni.dll&quot; &quot;$(SolutionDir)dist\BepIn\BepInEx\&quot;&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)XUnity.AutoTranslator.Plugin.Core.dll&quot; &quot;$(SolutionDir)dist\BepIn\BepInEx\&quot;&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)dist\BepIn\BepInEx\&quot;&#xD;&#xA;   XCOPY /Y /I &quot;$(SolutionDir)src\XUnity.AutoTranslator.Plugin.Lec\bin\x86\Release\net35\XUnity.AutoTranslator.Plugin.Lec.exe&quot; &quot;$(SolutionDir)dist\BepIn\BepInEx\&quot;&#xD;&#xA;   COPY /Y &quot;$(SolutionDir)README.md&quot; &quot;$(SolutionDir)dist\BepIn\BepInEx\README (AutoTranslator).md&quot;&#xD;&#xA;   powershell Compress-Archive -Path '$(SolutionDir)dist\BepIn\BepInEx' -DestinationPath '$(SolutionDir)dist\BepIn\XUnity.AutoTranslator-BepIn-@(VersionNumber).zip' -Force)&#xD;&#xA;)" />
+      <Exec Command="if $(ConfigurationName) == Release (&#xD;&#xA;   for %%f in (&quot;$(SolutionDir)dist\Translators\*.dll&quot;) do XCOPY /Y /I &quot;%%f&quot; &quot;$(SolutionDir)dist\BepIn\BepInEx\Translators\&quot;&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)ExIni.dll&quot; &quot;$(SolutionDir)dist\BepIn\BepInEx\&quot;&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)XUnity.AutoTranslator.Plugin.Core.dll&quot; &quot;$(SolutionDir)dist\BepIn\BepInEx\&quot;&#xD;&#xA;   XCOPY /Y /I &quot;$(TargetDir)$(TargetName)$(TargetExt)&quot; &quot;$(SolutionDir)dist\BepIn\BepInEx\&quot;&#xD;&#xA;   XCOPY /Y /I &quot;$(SolutionDir)src\XUnity.AutoTranslator.Plugin.Lec\bin\x86\Release\net35\XUnity.AutoTranslator.Plugin.Lec.exe&quot; &quot;$(SolutionDir)dist\BepIn\BepInEx\&quot;&#xD;&#xA;   COPY /Y &quot;$(SolutionDir)README.md&quot; &quot;$(SolutionDir)dist\BepIn\BepInEx\README (AutoTranslator).md&quot;&#xD;&#xA;   powershell Compress-Archive -Path '$(SolutionDir)dist\BepIn\BepInEx' -DestinationPath '$(SolutionDir)dist\BepIn\XUnity.AutoTranslator-BepIn-@(VersionNumber).zip' -Force)&#xD;&#xA;)" />
    </Target>
 
 </Project>

+ 1 - 0
src/XUnity.AutoTranslator.Plugin.Core/AutoTranslationPlugin.cs

@@ -30,6 +30,7 @@ using XUnity.AutoTranslator.Plugin.Core.Parsing;
 using System.Diagnostics;
 using XUnity.AutoTranslator.Plugin.Core.UI;
 using XUnity.AutoTranslator.Plugin.Core.Endpoints;
+using XUnity.AutoTranslator.Plugin.Core.Web.Internal;
 
 namespace XUnity.AutoTranslator.Plugin.Core
 {

+ 0 - 3
src/XUnity.AutoTranslator.Plugin.Core/Endpoints/Http/BingTranslateEndpoint.cs

@@ -6,7 +6,6 @@ using System.IO;
 using System.Net;
 using System.Reflection;
 using System.Text;
-using Harmony;
 using SimpleJSON;
 using UnityEngine;
 using XUnity.AutoTranslator.Plugin.Core.Configuration;
@@ -237,8 +236,6 @@ namespace XUnity.AutoTranslator.Plugin.Core.Endpoints.Http
       {
          try
          {
-            Logger.Current.Warn( result );
-
             var obj = JSON.Parse( result );
 
             var code = obj[ "statusCode" ].AsInt;

+ 0 - 1
src/XUnity.AutoTranslator.Plugin.Core/Endpoints/Http/BingTranslateLegitimateEndpoint.cs

@@ -6,7 +6,6 @@ using System.IO;
 using System.Net;
 using System.Reflection;
 using System.Text;
-using Harmony;
 using SimpleJSON;
 using UnityEngine;
 using XUnity.AutoTranslator.Plugin.Core.Configuration;

+ 2 - 2
src/XUnity.AutoTranslator.Plugin.Core/Endpoints/Http/CustomHttpEndpoint.cs → src/XUnity.AutoTranslator.Plugin.Core/Endpoints/Http/CustomTranslateEndpoint.cs

@@ -9,13 +9,13 @@ using XUnity.AutoTranslator.Plugin.Core.Web;
 
 namespace XUnity.AutoTranslator.Plugin.Core.Endpoints.Http
 {
-   internal class CustomHttpEndpoint : HttpEndpoint
+   internal class CustomTranslateEndpoint : HttpEndpoint
    {
       private static readonly string ServicePointTemplateUrl = "{0}?from={1}&to={2}&text={3}";
       private string _endpoint;
       private string _friendlyName;
 
-      public CustomHttpEndpoint()
+      public CustomTranslateEndpoint()
       {
          _friendlyName = "Custom";
       }

+ 0 - 1
src/XUnity.AutoTranslator.Plugin.Core/Endpoints/Http/GoogleTranslateLegitimateEndpoint.cs

@@ -6,7 +6,6 @@ using System.IO;
 using System.Net;
 using System.Reflection;
 using System.Text;
-using Harmony;
 using SimpleJSON;
 using UnityEngine;
 using XUnity.AutoTranslator.Plugin.Core.Configuration;

+ 3 - 17
src/XUnity.AutoTranslator.Plugin.Core/Endpoints/ProcessLineProtocol/LecPowerTranslateEndpoint.cs → src/XUnity.AutoTranslator.Plugin.Core/Endpoints/ProcessLineProtocol/LecPowerTranslator15Endpoint.cs

@@ -7,7 +7,7 @@ using XUnity.AutoTranslator.Plugin.Core.Web;
 
 namespace XUnity.AutoTranslator.Plugin.Core.Endpoints.ProcessLineProtocol
 {
-   internal class LecPowerTranslateEndpoint : ProcessLineProtocolEndpoint
+   internal class LecPowerTranslator15Endpoint : ProcessLineProtocolEndpoint
    {
       public override string Id => "LecPowerTranslator15";
 
@@ -25,19 +25,9 @@ namespace XUnity.AutoTranslator.Plugin.Core.Endpoints.ProcessLineProtocol
          var path1 = context.Config.DataPath;
          var exePath1 = Path.Combine( path1, "XUnity.AutoTranslator.Plugin.Lec.exe" );
          var file1Exists = File.Exists( exePath1 );
-         var path2 = new FileInfo( typeof( LecPowerTranslateEndpoint ).Assembly.Location ).Directory.FullName;
-         var exePath2 = Path.Combine( path2, "XUnity.AutoTranslator.Plugin.Lec.exe" );
-         var file2Exists = File.Exists( exePath2 );
-         if( !file1Exists && !file2Exists )
+         if( !file1Exists )
          {
-            if( path1 != path2 )
-            {
-               throw new Exception( $"Could not find any executable at '{exePath1}' or at '{exePath2}'" );
-            }
-            else
-            {
-               throw new Exception( $"Could not find any executable at '{exePath1}'" );
-            }
+            throw new Exception( $"Could not find any executable at '{exePath1}'" );
          }
 
          _arguments = Convert.ToBase64String( Encoding.UTF8.GetBytes( pathToLec ) );
@@ -46,10 +36,6 @@ namespace XUnity.AutoTranslator.Plugin.Core.Endpoints.ProcessLineProtocol
          {
             _exePath = exePath1;
          }
-         else if( file2Exists )
-         {
-            _exePath = exePath2;
-         }
          else
          {
             throw new Exception( "Unexpected error occurred." );

+ 0 - 62
src/XUnity.AutoTranslator.Plugin.Core/Endpoints/Www/ExciteTranslateEndpoint.cs

@@ -1,62 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Net;
-using System.Text;
-using SimpleJSON;
-using UnityEngine;
-using XUnity.AutoTranslator.Plugin.Core.Configuration;
-using XUnity.AutoTranslator.Plugin.Core.Constants;
-using XUnity.AutoTranslator.Plugin.Core.Extensions;
-using XUnity.AutoTranslator.Plugin.Core.Web;
-
-namespace XUnity.AutoTranslator.Plugin.Core.Endpoints.Www
-{
-   internal class ExciteTranslateEndpoint : WwwEndpoint
-   {
-      private static readonly string HttpsServicePointTemplateUrl = "https://www.excite.co.jp/world/?wb_lp={0}{1}&before={2}";
-
-      public ExciteTranslateEndpoint()
-      {
-      }
-
-      public override string Id => "ExciteTranslate";
-
-      public override string FriendlyName => "Excite Translator";
-
-      public override void Initialize( InitializationContext context )
-      {
-         context.HttpSecurity.EnableSslFor( "www.excite.co.jp", "excite.co.jp" );
-      }
-
-      public override void ApplyHeaders( Dictionary<string, string> headers )
-      {
-         headers[ "User-Agent" ] = string.IsNullOrEmpty( AutoTranslationState.UserAgent ) ? "Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53" : AutoTranslationState.UserAgent;
-         headers[ "Accept" ] = "text/html";
-         //headers[ "Accept-Charset" ] = "UTF-8";
-         //headers[ "DNT" ] = "1";
-      }
-
-      public override bool TryExtractTranslated( string result, out string translated )
-      {
-         try
-         {
-            string extracted = result.GetBetween( "class=\"inputText\">", "</p>" );
-            translated = RestSharp.Contrib.HttpUtility.HtmlDecode( extracted ?? string.Empty );
-
-            var success = !string.IsNullOrEmpty( translated );
-            return success;
-         }
-         catch
-         {
-            translated = null;
-            return false;
-         }
-      }
-
-      public override string GetServiceUrl( string untranslatedText, string from, string to )
-      {
-         return string.Format( HttpsServicePointTemplateUrl, from.ToUpper(), to.ToUpper(), WWW.EscapeURL( untranslatedText ) );
-      }
-   }
-}

+ 20 - 15
src/XUnity.AutoTranslator.Plugin.Core/Endpoints/Www/WatsonTranslateEndpoint.cs

@@ -7,6 +7,7 @@ using SimpleJSON;
 using UnityEngine;
 using XUnity.AutoTranslator.Plugin.Core.Configuration;
 using XUnity.AutoTranslator.Plugin.Core.Constants;
+using XUnity.AutoTranslator.Plugin.Core.Endpoints.Http;
 using XUnity.AutoTranslator.Plugin.Core.Extensions;
 using XUnity.AutoTranslator.Plugin.Core.Utilities;
 using XUnity.AutoTranslator.Plugin.Core.Web;
@@ -15,10 +16,11 @@ namespace XUnity.AutoTranslator.Plugin.Core.Endpoints.Www
 {
    internal class WatsonTranslateEndpoint : WwwEndpoint
    {
+      private static readonly string RequestTemplate = "{{\"text\":[\"{2}\"],\"model_id\":\"{0}-{1}\"}}";
+
       private string _template;
       private string _url;
-      private string _username;
-      private string _password;
+      private string _key;
 
       public WatsonTranslateEndpoint()
       {
@@ -30,22 +32,30 @@ namespace XUnity.AutoTranslator.Plugin.Core.Endpoints.Www
 
       public override void Initialize( InitializationContext context )
       {
-         _url = context.Config.Preferences[ "Watson" ][ "WatsonAPIUrl" ].GetOrDefault( "" );
-         _username = context.Config.Preferences[ "Watson" ][ "WatsonAPIUsername" ].GetOrDefault( "" );
-         _password = context.Config.Preferences[ "Watson" ][ "WatsonAPIPassword" ].GetOrDefault( "" );
+         _url = context.Config.Preferences[ "Watson" ][ "Url" ].GetOrDefault( "" );
+         _key = context.Config.Preferences[ "Watson" ][ "Key" ].GetOrDefault( "" );
          if( string.IsNullOrEmpty( _url ) ) throw new Exception( "The WatsonTranslate endpoint requires a url which has not been provided." );
-         if( string.IsNullOrEmpty( _username ) ) throw new Exception( "The WatsonTranslate endpoint requires a username which has not been provided." );
-         if( string.IsNullOrEmpty( _password ) ) throw new Exception( "The WatsonTranslate endpoint requires a password which has not been provided." );
+         if( string.IsNullOrEmpty( _key ) ) throw new Exception( "The WatsonTranslate endpoint requires a key which has not been provided." );
+
+         _template = _url.TrimEnd( '/' ) + "/v3/translate?version=2018-05-01";
+      }
+
+      public override string GetServiceUrl( string untranslatedText, string from, string to )
+      {
+         return _template;
+      }
 
-         _template = _url.TrimEnd( '/' ) + "/v2/translate?model_id={0}-{1}&text={2}";
+      public override string GetRequestObject( string untranslatedText, string from, string to )
+      {
+         return string.Format( RequestTemplate, from, to, TextHelper.EscapeJson( untranslatedText ) );
       }
 
       public override void ApplyHeaders( Dictionary<string, string> headers )
       {
          headers[ "User-Agent" ] = string.IsNullOrEmpty( AutoTranslationState.UserAgent ) ? "curl/7.55.1" : AutoTranslationState.UserAgent;
          headers[ "Accept" ] = "application/json";
-         headers[ "Accept-Charset" ] = "UTF-8";
-         headers[ "Authorization" ] = "Basic " + System.Convert.ToBase64String( System.Text.Encoding.ASCII.GetBytes( _username + ":" + _password ) );
+         headers[ "Content-Type" ] = "application/json";
+         headers[ "Authorization" ] = "Basic " + Convert.ToBase64String( Encoding.ASCII.GetBytes( "apikey:" + _key ) );
       }
 
       public override bool TryExtractTranslated( string result, out string translated )
@@ -75,10 +85,5 @@ namespace XUnity.AutoTranslator.Plugin.Core.Endpoints.Www
             return false;
          }
       }
-
-      public override string GetServiceUrl( string untranslatedText, string from, string to )
-      {
-         return string.Format( _template, from, to, WWW.EscapeURL( untranslatedText ) );
-      }
    }
 }

+ 5 - 1
src/XUnity.AutoTranslator.Plugin.Core/Endpoints/Www/WwwEndpoint.cs

@@ -3,6 +3,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Net;
 using System.Reflection;
+using System.Text;
 using Harmony;
 using UnityEngine;
 using XUnity.AutoTranslator.Plugin.Core.Configuration;
@@ -22,6 +23,8 @@ namespace XUnity.AutoTranslator.Plugin.Core.Endpoints.Www
 
       public abstract string GetServiceUrl( string untranslatedText, string from, string to );
 
+      public virtual string GetRequestObject( string untranslatedText, string from, string to ) => null;
+
       public abstract void ApplyHeaders( Dictionary<string, string> headers );
 
       public abstract bool TryExtractTranslated( string result, out string translated );
@@ -49,9 +52,10 @@ namespace XUnity.AutoTranslator.Plugin.Core.Endpoints.Www
             var headers = new Dictionary<string, string>();
             ApplyHeaders( headers );
             var url = GetServiceUrl( untranslatedText, from, to );
+            var data = GetRequestObject( untranslatedText, from, to );
 
             // execute request
-            www = WwwConstructor.Invoke( new object[] { url, null, headers } );
+            www = WwwConstructor.Invoke( new object[] { url, data != null ? Encoding.UTF8.GetBytes( data ) : null, headers } );
          }
          catch( Exception e )
          {

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 550 - 355
src/XUnity.AutoTranslator.Plugin.Core/Web/Internal/ConnectionTrackingWebClient.cs


+ 6 - 2
src/XUnity.AutoTranslator.Plugin.Core/Web/XUnityWebClient.cs

@@ -10,6 +10,7 @@ using System.Text;
 using Harmony;
 using UnityEngine;
 using XUnity.AutoTranslator.Plugin.Core.Endpoints.Http;
+using XUnity.AutoTranslator.Plugin.Core.Web.Internal;
 
 namespace XUnity.AutoTranslator.Plugin.Core.Web
 {
@@ -26,7 +27,7 @@ namespace XUnity.AutoTranslator.Plugin.Core.Web
          Encoding = Encoding.UTF8;
       }
 
-      private void UnityWebClient_UploadStringCompleted( object sender, UnityUploadStringCompletedEventArgs ev )
+      private void UnityWebClient_UploadStringCompleted( object sender, XUnityUploadStringCompletedEventArgs ev )
       {
          UploadStringCompleted -= UnityWebClient_UploadStringCompleted;
 
@@ -35,7 +36,7 @@ namespace XUnity.AutoTranslator.Plugin.Core.Web
          handle.SetCompleted( _responseCode.Value, ev.Result, responseHeaders, _responseCookies, ev.Error );
       }
 
-      private void UnityWebClient_DownloadStringCompleted( object sender, UnityDownloadStringCompletedEventArgs ev )
+      private void UnityWebClient_DownloadStringCompleted( object sender, XUnityDownloadStringCompletedEventArgs ev )
       {
          DownloadStringCompleted -= UnityWebClient_DownloadStringCompleted;
 
@@ -95,6 +96,9 @@ namespace XUnity.AutoTranslator.Plugin.Core.Web
       {
          var handle = new XUnityWebResponse();
 
+         _requestCookies = request.Cookies;
+         _requestHeaders = request.Headers;
+
          if( request.Data == null )
          {
             try

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.