+
{index > 0 ? (
-
)
}
@@ -620,10 +622,11 @@ function ScriptBuilderDialog({
{recipe.summary}
-
+ {/* Tetikleyici ve kosullar tek bir akan satirda; dar panelde sarar. */}
+
{dialect.triggers && (
-
- Ne zaman
+
+ {fieldLabel(translate('::App.ScriptBuilder.When'), triggerInfo?.help)}
+
}
+ title={translate('::App.ScriptBuilder.AddConditionHint')}
+ onClick={() => addCondition(rule)}
+ >
+ {translate('::App.ScriptBuilder.AddCondition')}
+
-
+
{recipe.params.map((param) => renderParam(rule, param))}
@@ -806,7 +808,7 @@ function ScriptBuilderDialog({
}`}
onClick={() => setView('code')}
>
-
Kod
+
{translate('::App.Platform.Code')}
diff --git a/ui/src/views/admin/listForm/edit/json-row-operations/editor-options/optionSpecs.ts b/ui/src/views/admin/listForm/edit/json-row-operations/editor-options/optionSpecs.ts
index 84b80fff..757daa9d 100644
--- a/ui/src/views/admin/listForm/edit/json-row-operations/editor-options/optionSpecs.ts
+++ b/ui/src/views/admin/listForm/edit/json-row-operations/editor-options/optionSpecs.ts
@@ -67,7 +67,7 @@ export const optionGroups: { key: OptionGroupKey; title: string; description: st
},
{
key: 'text',
- title: 'Metin / Maske',
+ title: 'App.SpecText.TextTitle',
description: 'App.SpecText.TextDescription',
},
{
@@ -244,7 +244,7 @@ export const optionSpecs: OptionSpec[] = [
label: 'width',
type: 'size',
group: 'appearance',
- placeholder: '100% veya 240',
+ placeholder: 'App.SpecWidth.WidthPlaceholder',
help: 'App.SpecWidth.Help',
},
{ path: 'height', label: 'height', type: 'size', group: 'appearance', placeholder: '200' },
@@ -547,7 +547,7 @@ export const optionSpecs: OptionSpec[] = [
type: 'number',
group: 'date',
editors: DATE_EDITORS,
- help: '0 Pazar, 1 Pazartesi.',
+ help: 'App.SpecFirstDayOfWeek.Help',
},
{
path: 'calendarOptions.zoomLevel',
@@ -933,10 +933,10 @@ export const optionSpecs: OptionSpec[] = [
// ── Liste sütununu da etkileyenler ───────────────────────────────
{
path: 'format',
- label: 'format (metin)',
+ label: 'format (string)',
type: 'text',
group: 'grid',
- placeholder: 'dd/MM/yyyy veya currency',
+ placeholder: 'App.SpecFormatText.FormatTextPlaceholder',
help: 'App.SpecFormat.Help',
},
{
diff --git a/ui/src/views/admin/listForm/edit/json-row-operations/editor-options/presets.ts b/ui/src/views/admin/listForm/edit/json-row-operations/editor-options/presets.ts
index 27415827..056894e6 100644
--- a/ui/src/views/admin/listForm/edit/json-row-operations/editor-options/presets.ts
+++ b/ui/src/views/admin/listForm/edit/json-row-operations/editor-options/presets.ts
@@ -95,13 +95,13 @@ const buildHtmlEditorOptions = (): JsonObject => ({
export const editorOptionsPresets: EditorOptionsPreset[] = [
{
key: 'readOnly',
- label: 'Salt okunur',
+ label: 'App.PresetReadOnly.ReadOnlyLabel',
description: 'App.PresetReadOnly.ReadOnlyDescription',
value: { readOnly: true },
},
{
key: 'disabled',
- label: 'Pasif',
+ label: 'App.PresetDisabled.DisabledLabel',
description: 'App.PresetDisabled.DisabledDescription',
value: { disabled: true },
},
@@ -114,7 +114,7 @@ export const editorOptionsPresets: EditorOptionsPreset[] = [
{
key: 'fixedPoint2',
label: 'App.PresetFixedPoint2.FixedPoint2Label',
- description: 'format.type fixedPoint, precision 2.',
+ description: 'App.PresetFixedPoint2.FixedPoint2Description',
editors: ['dxNumberBox'],
value: { format: { type: 'fixedPoint', precision: 2 } },
},
@@ -131,7 +131,7 @@ export const editorOptionsPresets: EditorOptionsPreset[] = [
},
{
key: 'currency',
- label: 'Para birimi (TRY)',
+ label: 'App.PresetCurrency.CurrencyLabel',
description: 'App.PresetCurrency.CurrencyDescription',
editors: ['dxNumberBox'],
value: { format: { type: 'currency', precision: 2, currency: 'TRY' } },
@@ -174,7 +174,7 @@ export const editorOptionsPresets: EditorOptionsPreset[] = [
},
{
key: 'phoneMask',
- label: 'Telefon maskesi',
+ label: 'App.PresetPhoneMask.PhoneMaskLabel',
description: 'App.PresetPhoneMask.PhoneMaskDescription',
editors: ['dxTextBox', 'dxAutocomplete'],
value: {
@@ -194,7 +194,7 @@ export const editorOptionsPresets: EditorOptionsPreset[] = [
},
{
key: 'searchableList',
- label: 'Aranabilir liste',
+ label: 'App.PresetSearchableList.SearchableListLabel',
description: 'App.PresetSearchableList.SearchableListDescription',
editors: [
'dxSelectBox',
@@ -267,13 +267,13 @@ export const editorOptionsPresets: EditorOptionsPreset[] = [
{
key: 'height100',
label: 'App.PresetHeight100.Height100Label',
- description: 'height: 100',
+ description: 'App.PresetHeight100.Height100Description',
value: { height: 100 },
},
{
key: 'height200',
label: 'App.PresetHeight200.Height200Label',
- description: 'height: 200',
+ description: 'App.PresetHeight200.Height200Description',
value: { height: 200 },
},
]
diff --git a/ui/src/views/admin/listForm/edit/json-row-operations/editor-script/formScriptDialect.ts b/ui/src/views/admin/listForm/edit/json-row-operations/editor-script/formScriptDialect.ts
index b0d3fa66..36da1a2a 100644
--- a/ui/src/views/admin/listForm/edit/json-row-operations/editor-script/formScriptDialect.ts
+++ b/ui/src/views/admin/listForm/edit/json-row-operations/editor-script/formScriptDialect.ts
@@ -151,6 +151,28 @@ export const createFormScriptDialect = (context: FormScriptDialectContext): Scri
const asFormRule = (rule: ScriptRule) => rule as unknown as FormScriptRule
+ // Tarif listesi hem "Kural ekle" seçicisinde hem de kural kartında kullanılıyor.
+ // Tek bir çevrilmiş liste üretip ikisini de buradan besliyoruz; aksi halde kart
+ // ham çeviri anahtarlarını gösterir.
+ const localizedRecipes: ScriptRecipeView[] = recipeViews.map((recipe) => ({
+ ...recipe,
+ label: t('::' + recipe.label),
+ summary: t('::' + recipe.summary),
+ params: recipe.params.map((param) => ({
+ ...param,
+ label: t('::' + param.label),
+ help: param.help ? t('::' + param.help) : undefined,
+ placeholder: param.placeholder?.startsWith('App.')
+ ? t('::' + param.placeholder)
+ : param.placeholder,
+ // `_blank` gibi teknik degerler oldugu gibi kalmali; yalnizca anahtarlar cevrilir.
+ choices: param.choices?.map((choice) => ({
+ ...choice,
+ label: choice.label.startsWith('App.') ? t('::' + choice.label) : choice.label,
+ })),
+ })),
+ }))
+
return {
id: 'form',
title: 'Editor Script',
@@ -163,19 +185,7 @@ export const createFormScriptDialect = (context: FormScriptDialectContext): Scri
description: t('::' + group.description),
icon: groupIcons[group.key],
})),
- recipes: recipeViews.map((recipe) => ({
- ...recipe,
- label: t('::' + recipe.label),
- summary: t('::' + recipe.summary),
- params: recipe.params.map((param) => ({
- ...param,
- label: t('::' + param.label),
- help: param.help ? t('::' + param.help) : undefined,
- placeholder: param.placeholder?.startsWith('ListForms.')
- ? t('::' + param.placeholder)
- : param.placeholder,
- })),
- })),
+ recipes: localizedRecipes,
operators: DEFAULT_SCRIPT_OPERATORS,
conditionKinds: [
{
@@ -200,7 +210,7 @@ export const createFormScriptDialect = (context: FormScriptDialectContext): Scri
description: t('::' + snippet.description),
})),
getOptions: (optionSource) => (optionSource === FIELD_SOURCE ? fields : []),
- getRecipe: (recipeId) => recipeViews.find((recipe) => recipe.id === recipeId),
+ getRecipe: (recipeId) => localizedRecipes.find((recipe) => recipe.id === recipeId),
createRule: (recipeId) => createRule(recipeId as RecipeId) as unknown as ScriptRule,
isRuleComplete: (rule) => isRuleComplete(asFormRule(rule)),
// Guard'ların gerekip gerekmediği script'in tamamına bağlı, o yüzden tek bir
@@ -228,12 +238,13 @@ export const createFormScriptDialect = (context: FormScriptDialectContext): Scri
describeCondition(condition as unknown as FormScriptRule['condition'], t),
)
.filter((text) => text !== always)
+ // Kosulsuz kuralda "Her zaman ->" oneki bilgi tasimiyor, yalnizca gurultu.
+ if (!conditions.length) return action
const joiner =
rule.join === 'or'
? ` ${t('::App.Platform.Or')} `
: ` ${t('::App.Platform.And')} `
- const prefix = conditions.length ? conditions.join(joiner) : always
- return `${prefix} → ${action}`
+ return `${conditions.join(joiner)} → ${action}`
},
getTrigger: (rule) => effectiveTrigger(asFormRule(rule)),
}
diff --git a/ui/src/views/admin/listForm/edit/json-row-operations/editor-script/scriptRecipes.ts b/ui/src/views/admin/listForm/edit/json-row-operations/editor-script/scriptRecipes.ts
index 5ee2d241..8879f6ef 100644
--- a/ui/src/views/admin/listForm/edit/json-row-operations/editor-script/scriptRecipes.ts
+++ b/ui/src/views/admin/listForm/edit/json-row-operations/editor-script/scriptRecipes.ts
@@ -121,8 +121,16 @@ export type RecipeId =
| 'custom'
export const recipeGroups: { key: RecipeGroupKey; title: string; description: string }[] = [
- { key: 'calc', title: 'Hesaplama', description: 'App.ScriptBuilderCalc.CalcDescription' },
- { key: 'data', title: 'Veri', description: 'App.ScriptBuilderData.DataDescription' },
+ {
+ key: 'calc',
+ title: 'App.ScriptBuilderCalc.CalcTitle',
+ description: 'App.ScriptBuilderCalc.CalcDescription',
+ },
+ {
+ key: 'data',
+ title: 'App.ScriptBuilderData.DataTitle',
+ description: 'App.ScriptBuilderData.DataDescription',
+ },
{
key: 'view',
title: 'App.StaticLookup.View',
@@ -135,7 +143,7 @@ export const recipeGroups: { key: RecipeGroupKey; title: string; description: st
},
{
key: 'integration',
- title: 'Entegrasyon',
+ title: 'App.ScriptBuilderIntegration.IntegrationTitle',
description: 'App.ScriptBuilderIntegration.IntegrationDescription',
},
]
@@ -232,7 +240,7 @@ export const recipes: Recipe[] = [
summary: 'App.ScriptBuilderMultiply.MultiplySummary',
example: "set('TotalAmount', round(num('Quantity') * num('UnitPrice'), 2))",
params: [
- { key: 'left', label: 'Birinci alan', type: 'field' },
+ { key: 'left', label: 'App.ScriptBuilderMultiply.LeftLabel', type: 'field' },
{ key: 'right', label: 'App.ScriptBuilderRight.RightLabel', type: 'field' },
{ key: 'target', label: 'App.ScriptBuilderTarget.TargetLabel', type: 'field' },
{
@@ -294,9 +302,9 @@ export const recipes: Recipe[] = [
{ key: 'amount', label: 'App.ScriptBuilderAmount.AmountLabel', type: 'field' },
{
key: 'rate',
- label: 'Oran',
+ label: 'App.ScriptBuilderRate.RateLabel',
type: 'text',
- placeholder: '20 veya KdvOrani',
+ placeholder: 'App.ScriptBuilderRate.RatePlaceholder',
help: 'App.ScriptBuilderRate.Help',
},
{ key: 'target', label: 'App.ScriptBuilderTarget.TargetLabel', type: 'field' },
@@ -375,7 +383,7 @@ export const recipes: Recipe[] = [
},
{
id: 'sum',
- label: 'Toplama',
+ label: 'App.ScriptBuilderSum.SumLabel',
group: 'calc',
summary: 'App.ScriptBuilderSum.SumSummary',
example: "set('Total', round(sum('Net', 'Tax'), 2))",
@@ -472,7 +480,7 @@ export const recipes: Recipe[] = [
key: 'source',
label: 'App.ScriptBuilderSource.SourceLabel',
type: 'text',
- placeholder: 'unitPrice veya Customer.Name',
+ placeholder: 'App.ScriptBuilderCopy.SourcePlaceholder',
},
{ key: 'target', label: 'App.ScriptBuilderTarget.TargetLabel2', type: 'field' },
],
@@ -523,13 +531,13 @@ export const recipes: Recipe[] = [
},
{
id: 'readOnly',
- label: 'Salt okunur yap',
+ label: 'App.ScriptBuilderReadOnly.ReadOnlyLabel',
group: 'view',
summary: 'App.ScriptBuilderReadOnly.ReadOnlySummary',
conditionIsArgument: true,
example: "readOnly('SatisSebebi', str('Durum') === 'Aktif')",
params: [
- { key: 'target', label: 'Kilitlenecek alan', type: 'field' },
+ { key: 'target', label: 'App.ScriptBuilderReadOnly.TargetLabel', type: 'field' },
{
key: 'invert',
label: 'App.ScriptBuilderInvert.InvertLabel',
@@ -608,7 +616,7 @@ export const recipes: Recipe[] = [
{ key: 'url', label: 'URL', type: 'text', placeholder: '/report?id={Id}' },
{
key: 'target',
- label: 'Hedef',
+ label: 'App.ScriptBuilderOpenUrl.TargetLabel',
type: 'select',
optional: true,
choices: [
@@ -628,16 +636,21 @@ export const recipes: Recipe[] = [
},
{
id: 'apiToField',
- label: 'API sonucunu alana yaz',
+ label: 'App.ScriptBuilderApiToField.ApiToFieldLabel',
group: 'integration',
summary: 'App.ScriptBuilderApiToField.ApiToFieldSummary',
example: "set('Unvan', await api('/api/musteri/{value}', 'data.name'))",
params: [
{ key: 'target', label: 'App.ScriptBuilderTarget.TargetLabel2', type: 'field' },
- { key: 'url', label: 'API adresi', type: 'text', placeholder: '/api/musteri/{value}' },
+ {
+ key: 'url',
+ label: 'App.ScriptBuilderApiToField.UrlLabel',
+ type: 'text',
+ placeholder: '/api/musteri/{value}',
+ },
{
key: 'path',
- label: 'Cevap yolu',
+ label: 'App.ScriptBuilderApiToField.PathLabel',
type: 'text',
optional: true,
placeholder: 'data.name',
@@ -663,7 +676,7 @@ export const recipes: Recipe[] = [
params: [
{
key: 'code',
- label: 'Kod',
+ label: 'App.ScriptBuilderCustom.CodeLabel',
type: 'text',
placeholder: 'UiEvalService.ApiGenerateBackgroundWorkers()',
},