Skip to content

Commit

Permalink
Merge pull request #3 from LazZiya/vNext
Browse files Browse the repository at this point in the history
user friendly exception
  • Loading branch information
LazZiya authored Nov 20, 2020
2 parents b35738a + c925366 commit e94e0c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public IBMWatsonTranslateService(IConfiguration configuration, ILogger<IBMWatson
{
_logger = logger;

var IBMWatsonTranslateApiKey = configuration["XLocalizer.Translate:IBMWatsonTranslateApiKey"] ?? throw new NullReferenceException("IBMWatsonTranslateApiKey");
var IBMWatsonTranslateApiKey = configuration["XLocalizer.Translate:IBMWatsonTranslateApiKey"] ?? throw new NullReferenceException("Configuration key for IBMWatsonTranslateApiKey was not found! For more details see https://docs.ziyad.info/en/XLocalizer/v1.0/translate-services-ibm.md");

var IBMWatsonTranslateServiceUrl = configuration["XLocalizer.Translate:IBMWatsonTranslateServiceUrl"] ?? throw new NullReferenceException("IBMWatsonTranslateServiceUrl");
var IBMWatsonTranslateServiceUrl = configuration["XLocalizer.Translate:IBMWatsonTranslateServiceUrl"] ?? throw new NullReferenceException("Configuration key for IBMWatsonTranslateServiceUrl was not found! For more details see https://docs.ziyad.info/en/XLocalizer/v1.0/translate-services-ibm.md");

var IBMWatsonTranslateServiceVersionDate = configuration["XLocalizer.Translate:IBMWatsonTranslateServiceVersionDate"] ?? throw new NullReferenceException("IBMWatsonTranslateServiceVersionDate");
var IBMWatsonTranslateServiceVersionDate = configuration["XLocalizer.Translate:IBMWatsonTranslateServiceVersionDate"] ?? throw new NullReferenceException("Configuration key for IBMWatsonTranslateServiceVersionDate was not found! For more details see https://docs.ziyad.info/en/XLocalizer/v1.0/translate-services-ibm.md");

var authenticator = new IamAuthenticator(IBMWatsonTranslateApiKey);
_translatorService = new LanguageTranslatorService(IBMWatsonTranslateServiceVersionDate, authenticator);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
Extension package for XLocalizer.TranslationServices to provide translations using IBM.Watson.LanguageTranslator.v3.
</Description>
<Copyright>Ziyad.info</Copyright>
<PackageProjectUrl>http://docs.ziyad.info</PackageProjectUrl>
<PackageProjectUrl>https://docs.ziyad.info</PackageProjectUrl>
<PackageIcon>icon.png</PackageIcon>
<PackageTags>asp.net, core, razor, mvc, localization, globalization, translation, services</PackageTags>
<PackageReleaseNotes>
- Target frameworks updated
- Provide more user friendly exception when no API key is provided.
Release notes: https://github.com/LazZiya/XLocalizer.Translate.IBMWatsonTranslate/releases
</PackageReleaseNotes>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionPrefix>1.0.1</VersionPrefix>
<VersionSuffix></VersionSuffix>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<AssemblyVersion>1.0.1.0</AssemblyVersion>
<FileVersion>1.0.1.0</FileVersion>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIconUrl>https://github.com/LazZiya/XLocalizer.Translate.IBMWatsonTranslate/raw/master/XLocalizer.Translate.IBMWatsonTranslate/files/icon.png</PackageIconUrl>
Expand Down

0 comments on commit e94e0c9

Please sign in to comment.