From 1af187c3aaf1e1ce8afbf8b9d7f7d594658f2476 Mon Sep 17 00:00:00 2001 From: artem-dudarev Date: Tue, 17 Oct 2023 16:11:00 +0200 Subject: [PATCH] Add localization for dictionary settings --- .../ModuleConstants.cs | 7 ++++--- .../VirtoCommerce.CoreModule.Core.csproj | 2 +- .../VirtoCommerce.CoreModule.Data.csproj | 2 +- .../Localizations/en.VirtoCommerce.Core.json | 4 ---- .../Localizations/ru.VirtoCommerce.Core.json | 4 ---- .../PackageType/blades/package-type-detail.js | 13 ------------- .../blades/package-type-detail.tpl.html | 18 ++++++++---------- .../module.manifest | 6 +++--- 8 files changed, 17 insertions(+), 39 deletions(-) diff --git a/src/VirtoCommerce.CoreModule.Core/ModuleConstants.cs b/src/VirtoCommerce.CoreModule.Core/ModuleConstants.cs index 51cf3d3b..370fcf83 100644 --- a/src/VirtoCommerce.CoreModule.Core/ModuleConstants.cs +++ b/src/VirtoCommerce.CoreModule.Core/ModuleConstants.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using VirtoCommerce.Platform.Core.Settings; @@ -41,6 +42,7 @@ public static class General ValueType = SettingValueType.ShortText, DefaultValue = "gram", IsDictionary = true, + IsLocalizable = true, AllowedValues = new[] { "gram", "ounce", "pound" } }; @@ -51,9 +53,11 @@ public static class General ValueType = SettingValueType.ShortText, DefaultValue = "mm", IsDictionary = true, + IsLocalizable = true, AllowedValues = new[] { "m", "mm", "ft", "in" } }; + [Obsolete("Use PlatformConstants.Settings.General.Languages", DiagnosticId = "VC0005", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions/")] public static SettingDescriptor Languages = new SettingDescriptor { Name = "VirtoCommerce.Core.General.Languages", @@ -79,7 +83,6 @@ public static IEnumerable AllSettings yield return TaxTypes; yield return WeightUnits; yield return MeasureUnits; - yield return Languages; yield return FixedTaxRateProviderRate; } } @@ -94,6 +97,4 @@ public static IEnumerable AllSettings } } } - - } diff --git a/src/VirtoCommerce.CoreModule.Core/VirtoCommerce.CoreModule.Core.csproj b/src/VirtoCommerce.CoreModule.Core/VirtoCommerce.CoreModule.Core.csproj index 982f3e3a..ebcdaf66 100644 --- a/src/VirtoCommerce.CoreModule.Core/VirtoCommerce.CoreModule.Core.csproj +++ b/src/VirtoCommerce.CoreModule.Core/VirtoCommerce.CoreModule.Core.csproj @@ -13,6 +13,6 @@ - + \ No newline at end of file diff --git a/src/VirtoCommerce.CoreModule.Data/VirtoCommerce.CoreModule.Data.csproj b/src/VirtoCommerce.CoreModule.Data/VirtoCommerce.CoreModule.Data.csproj index da7bb239..2c9f6214 100644 --- a/src/VirtoCommerce.CoreModule.Data/VirtoCommerce.CoreModule.Data.csproj +++ b/src/VirtoCommerce.CoreModule.Data/VirtoCommerce.CoreModule.Data.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/VirtoCommerce.CoreModule.Web/Localizations/en.VirtoCommerce.Core.json b/src/VirtoCommerce.CoreModule.Web/Localizations/en.VirtoCommerce.Core.json index 9456eb72..3d819e88 100644 --- a/src/VirtoCommerce.CoreModule.Web/Localizations/en.VirtoCommerce.Core.json +++ b/src/VirtoCommerce.CoreModule.Web/Localizations/en.VirtoCommerce.Core.json @@ -299,10 +299,6 @@ "description": "Available measurement units for size of physical goods", "title": "Size measurement units" }, - "VirtoCommerce.Core.General.Languages": { - "description": "List of available languages", - "title": "Languages" - }, "VirtoCommerce.Core.FixedRateShippingMethod.Ground.Rate": { "description": "Fixed land shipping fee", "title": "Land shipping fee" diff --git a/src/VirtoCommerce.CoreModule.Web/Localizations/ru.VirtoCommerce.Core.json b/src/VirtoCommerce.CoreModule.Web/Localizations/ru.VirtoCommerce.Core.json index 81eb4562..80e841be 100644 --- a/src/VirtoCommerce.CoreModule.Web/Localizations/ru.VirtoCommerce.Core.json +++ b/src/VirtoCommerce.CoreModule.Web/Localizations/ru.VirtoCommerce.Core.json @@ -299,10 +299,6 @@ "description": "Единицы размера доступные для товаров", "title": "Единицы размера" }, - "VirtoCommerce.Core.General.Languages": { - "description": "Список доступных языков", - "title": "Языки" - }, "VirtoCommerce.Core.FixedRateShippingMethod.Ground.Rate": { "description": "Фиксированная стоимость за наземную доставку", "title": "Стоимость за наземную доставку" diff --git a/src/VirtoCommerce.CoreModule.Web/Scripts/PackageType/blades/package-type-detail.js b/src/VirtoCommerce.CoreModule.Web/Scripts/PackageType/blades/package-type-detail.js index efa1d162..f11dae57 100644 --- a/src/VirtoCommerce.CoreModule.Web/Scripts/PackageType/blades/package-type-detail.js +++ b/src/VirtoCommerce.CoreModule.Web/Scripts/PackageType/blades/package-type-detail.js @@ -29,7 +29,6 @@ angular.module('virtoCommerce.coreModule.packageType') function initializeBlade(data) { if (blade.isNew) data = { }; - $scope.measureUnits = settings.getValues({ id: 'VirtoCommerce.Core.General.MeasureUnits' }); blade.currentEntity = angular.copy(data); blade.origEntity = data; @@ -39,18 +38,6 @@ angular.module('virtoCommerce.coreModule.packageType') blade.subtitle = blade.isNew ? 'core.blades.package-type-detail.new-subtitle' : 'core.blades.package-type-detail.subtitle'; }; - $scope.openMeasureUnitsDictionarySettingManagement = function (setting) { - var newBlade = { - id: 'settingDetailChild', - currentEntityId: 'VirtoCommerce.Core.General.MeasureUnits', - parentRefresh: function (data) { $scope.measureUnits = data; }, - isApiSave: true, - controller: 'platformWebApp.settingDictionaryController', - template: '$(Platform)/Scripts/app/settings/blades/setting-dictionary.tpl.html' - }; - bladeNavigationService.showBlade(newBlade, blade); - }; - var formScope; $scope.setForm = function (form) { formScope = form; diff --git a/src/VirtoCommerce.CoreModule.Web/Scripts/PackageType/blades/package-type-detail.tpl.html b/src/VirtoCommerce.CoreModule.Web/Scripts/PackageType/blades/package-type-detail.tpl.html index 9f3d6fff..d6ea442f 100644 --- a/src/VirtoCommerce.CoreModule.Web/Scripts/PackageType/blades/package-type-detail.tpl.html +++ b/src/VirtoCommerce.CoreModule.Web/Scripts/PackageType/blades/package-type-detail.tpl.html @@ -12,16 +12,14 @@
{{ 'core.blades.package-type-detail.labels.name-description' | translate}}
- -
- - {{$select.selected}} - - - - -
-
{{ 'core.blades.package-type-detail.labels.measureUnit-description' | translate}}
+
diff --git a/src/VirtoCommerce.CoreModule.Web/module.manifest b/src/VirtoCommerce.CoreModule.Web/module.manifest index 9a8a8940..53710e91 100644 --- a/src/VirtoCommerce.CoreModule.Web/module.manifest +++ b/src/VirtoCommerce.CoreModule.Web/module.manifest @@ -1,9 +1,9 @@ - + VirtoCommerce.Core 3.401.0 - 3.400.0 + 3.427.0-alpha.12767-pt-13441 Commerce core module Common e-commerce domain functionality @@ -26,4 +26,4 @@ commerce false - \ No newline at end of file +