diff --git a/api/src/Sozsoft.Platform.Application/ListForms/ListFormWizardAppService.cs b/api/src/Sozsoft.Platform.Application/ListForms/ListFormWizardAppService.cs index 5823cd8..79d2927 100644 --- a/api/src/Sozsoft.Platform.Application/ListForms/ListFormWizardAppService.cs +++ b/api/src/Sozsoft.Platform.Application/ListForms/ListFormWizardAppService.cs @@ -18,6 +18,7 @@ using Microsoft.Extensions.Hosting; using Sozsoft.Languages; using Sozsoft.Platform.DynamicData; using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.Logging; namespace Sozsoft.Platform.ListForms; @@ -34,7 +35,8 @@ public class ListFormWizardAppService( IPermissionGrantRepository permissionGrantRepository, IHostEnvironment hostEnvironment, LanguageTextAppService languageTextAppService, - IDynamicDataManager dynamicDataManager + IDynamicDataManager dynamicDataManager, + ILogger logger ) : PlatformAppService(), IListFormWizardAppService { private readonly IRepository repoListForm = repoListForm; @@ -49,6 +51,7 @@ public class ListFormWizardAppService( private readonly IHostEnvironment _hostEnvironment = hostEnvironment; private readonly LanguageTextAppService _languageTextAppService = languageTextAppService; private readonly IDynamicDataManager _dynamicDataManager = dynamicDataManager; + private readonly ILogger logger = logger; private readonly string cultureNameDefault = PlatformConsts.DefaultLanguage; [UnitOfWork] @@ -346,12 +349,12 @@ public class ListFormWizardAppService( var filePath = Path.Combine(outputPath, $"{timestamp}_{safeWizardName}.json"); await File.WriteAllTextAsync(filePath, json); - Console.WriteLine($"[WizardSeed] Seed dosyası kaydedildi: {filePath}"); + logger.LogInformation($"Seed dosyası kaydedildi: {filePath}"); } catch (Exception ex) { // Dosya kaydetme hatası wizard işlemini engellemez - Console.WriteLine($"[WizardSeed] Seed dosyası kaydedilemedi: {ex.Message}"); + logger.LogError(ex, $"Seed dosyası kaydedilemedi: {ex.Message}"); } } diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202605022050_Departments.json b/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202605022245_Departments.json similarity index 100% rename from api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202605022050_Departments.json rename to api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202605022245_Departments.json diff --git a/ui/src/services/localization.service.ts b/ui/src/services/localization.service.ts index c6bd84d..80e6ca8 100644 --- a/ui/src/services/localization.service.ts +++ b/ui/src/services/localization.service.ts @@ -47,8 +47,15 @@ const interpolate = (text: string, params: Record) => { if (!params || typeof params !== 'object') return text return Object.entries(params).reduce((acc, [key, value]) => { - const pattern = new RegExp(`{{\\s*${key}\\s*}}`, 'g') - return acc.replace(pattern, String(value)) + if (/^\d+$/.test(key)) { + // Positional ABP-style: {0}, {1}, etc. + const pattern = new RegExp(`\\{${key}\\}`, 'g') + return acc.replace(pattern, String(value)) + } else { + // Named: {{ key }} + const pattern = new RegExp(`{{\\s*${key}\\s*}}`, 'g') + return acc.replace(pattern, String(value)) + } }, text) } diff --git a/ui/src/views/admin/listForm/wizard/WizardStep4.tsx b/ui/src/views/admin/listForm/wizard/WizardStep4.tsx index 269c617..0da1af6 100644 --- a/ui/src/views/admin/listForm/wizard/WizardStep4.tsx +++ b/ui/src/views/admin/listForm/wizard/WizardStep4.tsx @@ -42,14 +42,14 @@ interface LogEntry { function buildLogSteps( values: ListFormWizardDto, groups: WizardGroup[], - translate: (key: string) => string, + translate: (key: string, params?: Record) => string, ): Omit[] { const totalFields = groups.reduce((acc, g) => acc + g.items.length, 0) return [ { id: 1, label: translate('::ListForms.Wizard.Step4.Log.ValidatingConfig') }, { id: 2, - label: `${translate('::ListForms.Wizard.Step4.Log.CreatingMenu')}: ${values.menuCode}`, + label: translate('::ListForms.Wizard.Step4.Log.CreatingMenu', { 0: values.menuCode }), detail: `Parent: ${values.menuParentCode}`, }, { @@ -57,14 +57,14 @@ function buildLogSteps( label: translate('::ListForms.Wizard.Step4.Log.SavingLanguageTexts'), detail: `EN: ${values.languageTextMenuEn} / TR: ${values.languageTextMenuTr}`, }, - { id: 4, label: `${translate('::ListForms.Wizard.Step4.Log.ConfiguringPermission')}: ${values.permissionGroupName}` }, - { id: 5, label: `${translate('::ListForms.Wizard.Step4.Log.ConnectingDataSource')}: ${values.dataSourceCode}` }, + { id: 4, label: translate('::ListForms.Wizard.Step4.Log.ConfiguringPermission', { 0: values.permissionGroupName }) }, + { id: 5, label: translate('::ListForms.Wizard.Step4.Log.ConnectingDataSource', { 0: values.dataSourceCode }) }, { id: 6, - label: `${translate('::ListForms.Wizard.Step4.Log.CreatingListForm')}: ${values.listFormCode}`, + label: translate('::ListForms.Wizard.Step4.Log.CreatingListForm', { 0: values.listFormCode }), detail: `Key: ${values.keyFieldName}`, }, - { id: 7, label: `${translate('::ListForms.Wizard.Step4.Log.SavingFormGroups')} (${groups.length} ${translate('::ListForms.Wizard.Step4.StatGroup')}, ${totalFields} ${translate('::ListForms.Wizard.Step4.StatField')})` }, + { id: 7, label: translate('::ListForms.Wizard.Step4.Log.SavingFormGroups', { 0: groups.length, 1: totalFields }) }, { id: 8, label: translate('::ListForms.Wizard.Step4.Log.Deploying') }, { id: 9, label: translate('::ListForms.Wizard.Step4.Log.Completed') }, ]