From 482622ce6cffea1fe630d79cd8ae2391bc6bbd91 Mon Sep 17 00:00:00 2001 From: iAlexeyProkhorov Date: Tue, 8 Nov 2022 16:18:43 +0200 Subject: [PATCH] Update to version 1.4.2. Fixes: - fixed path separator usage in localization file builder method. Now plugin should be compatible with Linux OS. --- BaseBaroquePlugin.cs | 18 +++++++++--------- Nop.Plugin.Widgets.qBoSlider.csproj | 2 +- plugin.json | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/BaseBaroquePlugin.cs b/BaseBaroquePlugin.cs index 9e2170b..7ecd52f 100644 --- a/BaseBaroquePlugin.cs +++ b/BaseBaroquePlugin.cs @@ -64,7 +64,7 @@ public BaseBaroquePlugin() protected string GenerateLocalizationXmlFilePathByCulture(string culture = "en-US") { string fileName = string.Format("localization.{0}.xml", culture); - string contentDirectoryPath = $"{_originalAssemblyFile.DirectoryName}\\Content\\"; + string contentDirectoryPath = $"{_originalAssemblyFile.DirectoryName}{Path.DirectorySeparatorChar}Content{Path.DirectorySeparatorChar}"; return $"{contentDirectoryPath}{fileName}"; } @@ -72,9 +72,9 @@ protected string GenerateLocalizationXmlFilePathByCulture(string culture = "en-U /// /// Install available plugin localizations /// - protected virtual void InstallLocalization() + protected virtual async Task InstallLocalizationAsync() { - var allLanguages = _languageService.GetAllLanguagesAsync().GetAwaiter().GetResult(); + var allLanguages = await _languageService.GetAllLanguagesAsync(); var language = allLanguages.FirstOrDefault(); //if shop have no available languages method generate exception @@ -95,7 +95,7 @@ protected virtual void InstallLocalization() { using (var sr = new StreamReader(stream, Encoding.UTF8)) { - _localizationService.ImportResourcesFromXmlAsync(l, sr); + await _localizationService.ImportResourcesFromXmlAsync(l, sr); } } } @@ -104,7 +104,7 @@ protected virtual void InstallLocalization() /// /// Uninstall plugin localization /// - protected virtual void UninstallLocalization() + protected virtual async Task UninstallLocalizationAsync() { var localizationPath = GenerateLocalizationXmlFilePathByCulture(); @@ -118,7 +118,7 @@ protected virtual void UninstallLocalization() { using (var sr = new StreamReader(stream, Encoding.UTF8)) { - var result = sr.ReadToEnd(); + var result = await sr.ReadToEndAsync(); var xLang = new XmlDocument(); xLang.LoadXml(result); @@ -128,7 +128,7 @@ protected virtual void UninstallLocalization() if (elem.Name == "LocaleResource") { var localResource = elem.Attributes["Name"].Value; - _localizationService.DeleteLocaleResourceAsync(localResource); + await _localizationService.DeleteLocaleResourceAsync(localResource); } } } @@ -141,14 +141,14 @@ protected virtual void UninstallLocalization() public override async Task InstallAsync() { - InstallLocalization(); + await InstallLocalizationAsync(); await base.InstallAsync(); } public override async Task UninstallAsync() { - UninstallLocalization(); + await UninstallLocalizationAsync(); await base.UninstallAsync(); } diff --git a/Nop.Plugin.Widgets.qBoSlider.csproj b/Nop.Plugin.Widgets.qBoSlider.csproj index 205b950..ada88be 100644 --- a/Nop.Plugin.Widgets.qBoSlider.csproj +++ b/Nop.Plugin.Widgets.qBoSlider.csproj @@ -16,7 +16,7 @@ https://github.com/iAlexeyProkhorov/qBoSlider Git - 1.3.0 + 1.4.2 ..\..\Presentation\Nop.Web\Plugins\Widgets.qBoSlider $(OutputPath) diff --git a/plugin.json b/plugin.json index 49ce518..47a7b4c 100644 --- a/plugin.json +++ b/plugin.json @@ -2,7 +2,7 @@ "Group": "Widgets", "FriendlyName": "qBoSlider", "SystemName": "Widgets.qBoSlider", - "Version": "1.4.1", + "Version": "1.4.2", "SupportedVersions": [ "4.50" ], "Author": "Baroque team", "DisplayOrder": 1,