-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Microsoft Translation Provider: Make access from standalone apps easier
- Loading branch information
Showing
4 changed files
with
30 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using MicrosoftTranslatorProvider.Helpers; | ||
using MicrosoftTranslatorProvider.Helpers; | ||
using MicrosoftTranslatorProvider.Interfaces; | ||
using Sdl.Desktop.IntegrationApi; | ||
using Sdl.Desktop.IntegrationApi.Extensions; | ||
using Sdl.LanguagePlatform.TranslationMemoryApi; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace MicrosoftTranslatorProvider | ||
{ | ||
[ApplicationInitializer] | ||
public class ApplicationInitializer : IApplicationInitializer | ||
{ | ||
public static ITranslationProviderCredentialStore CredentialStore { get; set; } | ||
[ApplicationInitializer] | ||
public class ApplicationInitializer : IApplicationInitializer | ||
{ | ||
public static ITranslationProviderCredentialStore CredentialStore { get; set; } | ||
|
||
public static IDictionary<string, ITranslationOptions> TranslationOptions { get; set; } = new Dictionary<string, ITranslationOptions>(); | ||
public static IDictionary<string, ITranslationOptions> TranslationOptions { get; set; } = new Dictionary<string, ITranslationOptions>(); | ||
public static bool IsStandalone { get; set; } = true; | ||
|
||
public void Execute() | ||
{ | ||
Log.Setup(); | ||
AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolver.CurrentDomain_AssemblyResolve; | ||
} | ||
} | ||
{ | ||
IsStandalone = false; | ||
Log.Setup(); | ||
AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolver.CurrentDomain_AssemblyResolve; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
namespace MicrosoftTranslatorProvider.Model | ||
{ | ||
public class MicrosoftCredentials | ||
public class MicrosoftCredentials | ||
{ | ||
public string AccessToken { get; set; } | ||
public string APIKey { get; set; } | ||
|
||
public string APIKey { get; set; } | ||
|
||
public string Region { get; set; } | ||
public string Region { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters