From 9478d4f69dc2db0e756ca579d8535cf88777a591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96zt=C3=BCrk?= Date: Sat, 17 Jan 2026 23:13:25 +0300 Subject: [PATCH] =?UTF-8?q?Card,=20Pivot,=20Tree=20i=C3=A7erisinde=20t?= =?UTF-8?q?=C3=BCm=20translate=20de=C4=9Ferleri?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Seeds/LanguagesData.json | 198 ++++++++++++++++++ ui/src/views/list/Card.tsx | 38 ++-- ui/src/views/list/CardItem.tsx | 3 +- ui/src/views/list/Chart.tsx | 25 ++- ui/src/views/list/ChartDrawer.tsx | 52 ++--- ui/src/views/list/Pivot.tsx | 14 +- ui/src/views/list/Tree.tsx | 7 +- 7 files changed, 275 insertions(+), 62 deletions(-) diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json index cdaf0945..4c3379fe 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json @@ -10794,6 +10794,204 @@ "key": "App.Platform.DeleteAction", "tr": "Sil", "en": "Delete" + }, + { + "resourceName": "Platform", + "key": "App.Platform.Card.Selected", + "tr": "seçili", + "en": "selected" + }, + { + "resourceName": "Platform", + "key": "App.Platform.Card.SelectAll", + "tr": "Tümünü Seç", + "en": "Select All" + }, + { + "resourceName": "Platform", + "key": "App.Platform.Card.ExportSelectedToExcel", + "tr": "Seçilenleri Excel'e Aktar", + "en": "Export Selected to Excel" + }, + { + "resourceName": "Platform", + "key": "App.Platform.Card.ExportAllToExcel", + "tr": "Tümünü Excel'e Aktar", + "en": "Export All to Excel" + }, + { + "resourceName": "Platform", + "key": "App.Platform.Card.NoSorting", + "tr": "Sıralama Yok", + "en": "No Sorting" + }, + { + "resourceName": "Platform", + "key": "App.Platform.Card.ChangeSortDirection", + "tr": "Sıralama yönünü değiştir", + "en": "Change sort direction" + }, + { + "resourceName": "Platform", + "key": "App.Platform.Card.ShowIn1Column", + "tr": "1 Sütunda Göster", + "en": "Show in 1 Column" + }, + { + "resourceName": "Platform", + "key": "App.Platform.Card.ShowIn2Columns", + "tr": "2 Sütunda Göster", + "en": "Show in 2 Columns" + }, + { + "resourceName": "Platform", + "key": "App.Platform.Card.ShowIn3Columns", + "tr": "3 Sütunda Göster", + "en": "Show in 3 Columns" + }, + { + "resourceName": "Platform", + "key": "App.Platform.Card.ShowIn4Columns", + "tr": "4 Sütunda Göster", + "en": "Show in 4 Columns" + }, + { + "resourceName": "Platform", + "key": "App.Platform.Card.ShowIn5Columns", + "tr": "5 Sütunda Göster", + "en": "Show in 5 Columns" + }, + { + "resourceName": "Platform", + "key": "App.Platform.Card.NoRecordsFound", + "tr": "Uygun kayıt bulunamadı", + "en": "No records found" + }, + { + "resourceName": "Platform", + "key": "App.Platform.Card.TryDifferentFilters", + "tr": "Farklı filtreler deneyin veya yeni bir kayıt ekleyin.", + "en": "Try different filters or add a new record." + }, + { + "resourceName": "Platform", + "key": "App.Platform.Card.Loading", + "tr": "Yükleniyor...", + "en": "Loading..." + }, + { + "resourceName": "Platform", + "key": "App.Platform.Card.TotalRecords", + "tr": "Toplam {0} kayıt", + "en": "Total {0} records" + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.ChartSeries", + "tr": "Grafik Serileri", + "en": "Chart Series" + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.AddNewSeries", + "tr": "Yeni Seri Ekle", + "en": "Add New Series" + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.Series", + "tr": "Seri", + "en": "Series" + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.ChartType", + "tr": "Grafik Tipi", + "en": "Chart Type" + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.Name", + "tr": "Ad", + "en": "Name" + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.SeriesName", + "tr": "Seri adı", + "en": "Series name" + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.ArgumentField", + "tr": "Argüman Alanı (X-Ekseni)", + "en": "Argument Field (X-Axis)" + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.ValueField", + "tr": "Değer Alanı (Y-Ekseni)", + "en": "Value Field (Y-Axis)" + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.SummaryType", + "tr": "Özet Tipi", + "en": "Summary Type" + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.SelectField", + "tr": "Alan seçin...", + "en": "Select field..." + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.Cancel", + "tr": "İptal", + "en": "Cancel" + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.Save", + "tr": "Kaydet", + "en": "Save" + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.ChartSaved", + "tr": "Grafik kaydedildi", + "en": "Chart saved" + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.Error", + "tr": "Hata", + "en": "Error" + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.NameRequired", + "tr": "Ad Gerekli", + "en": "Name Required" + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.ArgumentFieldRequired", + "tr": "Argüman Alanı Gerekli", + "en": "Argument Field Required" + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.ValueFieldRequired", + "tr": "Değer Alanı Gerekli", + "en": "Value Field Required" + }, + { + "resourceName": "Platform", + "key": "App.Platform.ChartDrawer.SummaryTypeRequired", + "tr": "Özet Tipi Gerekli", + "en": "Summary Type Required" } ] } diff --git a/ui/src/views/list/Card.tsx b/ui/src/views/list/Card.tsx index dfa330a6..9ff20758 100644 --- a/ui/src/views/list/Card.tsx +++ b/ui/src/views/list/Card.tsx @@ -15,6 +15,7 @@ import { usePWA } from '@/utils/hooks/usePWA' import CardItem from './CardItem' import { layoutTypes } from '../admin/listForm/edit/types' import { useListFormCustomDataSource } from './useListFormCustomDataSource' +import { useLocalization } from '@/utils/hooks/useLocalization' interface CardProps { listFormCode: string @@ -32,6 +33,7 @@ type Option = { const Card = (props: CardProps) => { const { listFormCode, searchParams, gridDto } = props + const { translate } = useLocalization() const { createSelectDataSource } = useListFormCustomDataSource({} as any) const [data, setData] = useState([]) const [totalCount, setTotalCount] = useState(0) @@ -528,7 +530,7 @@ const Card = (props: CardProps) => { className="cursor-pointer" /> - {selectedKeys.size > 0 ? `${selectedKeys.size} seçili` : 'Tümünü Seç'} + {selectedKeys.size > 0 ? `${selectedKeys.size} ${translate('::App.Platform.Card.Selected')}` : translate('::App.Platform.Card.SelectAll')} )} @@ -536,10 +538,10 @@ const Card = (props: CardProps) => { {selectionMode !== 'none' && selectedKeys.size > 0 && !gridDto?.gridOptions?.selectionDto?.allowSelectAll && (
- {selectedKeys.size} seçili + {selectedKeys.size} {translate('::App.Platform.Card.Selected')}
- )} + )}
@@ -550,9 +552,9 @@ const Card = (props: CardProps) => { size="xs" variant="default" onClick={() => handleExport('xlsx', selectionMode !== 'none' && selectedKeys.size > 0)} - title={selectionMode !== 'none' && selectedKeys.size > 0 ? `Seçilenleri Excel'e Aktar (${selectedKeys.size})` : "Tümünü Excel'e Aktar"} + title={selectionMode !== 'none' && selectedKeys.size > 0 ? `${translate('::App.Platform.Card.ExportSelectedToExcel')} (${selectedKeys.size})` : translate('::App.Platform.Card.ExportAllToExcel')} > - 📊 {selectionMode !== 'none' && selectedKeys.size > 0 ? `Seçilenleri Excel'e Aktar (${selectedKeys.size})` : `Tümünü Excel'e Aktar`} + 📊 {selectionMode !== 'none' && selectedKeys.size > 0 ? `${translate('::App.Platform.Card.ExportSelectedToExcel')} (${selectedKeys.size})` : translate('::App.Platform.Card.ExportAllToExcel')}
)} @@ -576,7 +578,7 @@ const Card = (props: CardProps) => { }} value={sortColumn || ''} > - + {gridDto.columnFormats .filter((col) => col.visible && col.dataType !== 'buttons') .map((col) => ( @@ -589,7 +591,7 @@ const Card = (props: CardProps) => { @@ -601,7 +603,7 @@ const Card = (props: CardProps) => { setSearchText(e.target.value)} onKeyDown={(e) => { @@ -632,7 +634,7 @@ const Card = (props: CardProps) => { setLayoutCount(1) setStates({ listFormCode, layout: 'card', cardLayoutColumn: 1 }) }} - title="1 Sütunda Göster" + title={translate('::App.Platform.Card.ShowIn1Column')} > 1 @@ -644,7 +646,7 @@ const Card = (props: CardProps) => { setLayoutCount(2) setStates({ listFormCode, layout: 'card', cardLayoutColumn: 2 }) }} - title="2 Sütunda Göster" + title={translate('::App.Platform.Card.ShowIn2Columns')} > 2 @@ -656,7 +658,7 @@ const Card = (props: CardProps) => { setLayoutCount(3) setStates({ listFormCode, layout: 'card', cardLayoutColumn: 3 }) }} - title="3 Sütunda Göster" + title={translate('::App.Platform.Card.ShowIn3Columns')} > 3 @@ -668,7 +670,7 @@ const Card = (props: CardProps) => { setLayoutCount(4) setStates({ listFormCode, layout: 'card', cardLayoutColumn: 4 }) }} - title="4 Sütunda Göster" + title={translate('::App.Platform.Card.ShowIn4Columns')} > 4 @@ -680,7 +682,7 @@ const Card = (props: CardProps) => { setLayoutCount(5) setStates({ listFormCode, layout: 'card', cardLayoutColumn: 5 }) }} - title="5 Sütunda Göster" + title={translate('::App.Platform.Card.ShowIn5Columns')} > 5 @@ -699,7 +701,7 @@ const Card = (props: CardProps) => { isPwaMode ? '_self' : '_blank', ) }} - title="Form Manager" + title={translate('::ListForms.ListForm.Manage')} > @@ -714,10 +716,10 @@ const Card = (props: CardProps) => {

- Uygun kayıt bulunamadı + {translate('::App.Platform.Card.NoRecordsFound')}

- Farklı filtreler deneyin veya yeni bir kayıt ekleyin. + {translate('::App.Platform.Card.TryDifferentFilters')}

) : ( @@ -766,7 +768,7 @@ const Card = (props: CardProps) => {

- Yükleniyor... ({renderedCount}/{data.length}) + {translate('::App.Platform.Card.Loading')} ({renderedCount}/{data.length})

)} @@ -777,7 +779,7 @@ const Card = (props: CardProps) => {
- Toplam {totalCount} kayıt + {translate('::App.Platform.Card.TotalRecords').replace('{0}', totalCount.toString())} setSearchText(e.target.value)} onKeyDown={(e) => { @@ -335,23 +342,23 @@ const Chart = (props: ChartProps) => { {checkPermission(gridDto?.gridOptions.permissionDto.u) && ( @@ -368,7 +375,7 @@ const Chart = (props: ChartProps) => { isPwaMode ? '_self' : '_blank', ) }} - title="Form Manager" + title={translate('::ListForms.ListForm.Manage')} > diff --git a/ui/src/views/list/ChartDrawer.tsx b/ui/src/views/list/ChartDrawer.tsx index 8302b0b1..9a6b9552 100644 --- a/ui/src/views/list/ChartDrawer.tsx +++ b/ui/src/views/list/ChartDrawer.tsx @@ -19,17 +19,6 @@ interface ChartDrawerProps { onPreviewChange: (series: ChartSeriesDto[]) => void } -const schema = object().shape({ - series: array().of( - object().shape({ - name: string().required('Name Required'), - argumentField: string().required('Argument Field Required'), - valueField: string().required('Value Field Required'), - summaryType: string().required('Summary Type Required'), - }), - ), -}) - const ChartDrawer = ({ open, onClose, @@ -42,6 +31,17 @@ const ChartDrawer = ({ const { userName } = useStoreState((s) => s.auth.user) const [selectedSeriesIndex, setSelectedSeriesIndex] = useState(-1) + const schema = object().shape({ + series: array().of( + object().shape({ + name: string().required(translate('::App.Platform.ChartDrawer.NameRequired')), + argumentField: string().required(translate('::App.Platform.ChartDrawer.ArgumentFieldRequired')), + valueField: string().required(translate('::App.Platform.ChartDrawer.ValueFieldRequired')), + summaryType: string().required(translate('::App.Platform.ChartDrawer.SummaryTypeRequired')), + }), + ), + }) + // Chart type icons const chartTypeIcons = [ { type: 'line', label: 'Line', icon: '📈' }, @@ -111,14 +111,14 @@ const ChartDrawer = ({ onSubmit={async (values, { setSubmitting }) => { try { await onSave(values.series) - toast.push(Chart kaydedildi, { + toast.push({translate('::App.Platform.ChartDrawer.ChartSaved')}, { placement: 'top-end', }) onClose() } catch (error: any) { toast.push( - Hata + {translate('::App.Platform.ChartDrawer.Error')} {error} , { placement: 'top-end' }, @@ -145,7 +145,7 @@ const ChartDrawer = ({

📊 - Chart Series + {translate('::App.Platform.ChartDrawer.ChartSeries')}

@@ -186,7 +186,7 @@ const ChartDrawer = ({ > {/* Header */}
- Seri #{index + 1} + {translate('::App.Platform.ChartDrawer.Series')} #{index + 1}
diff --git a/ui/src/views/list/Pivot.tsx b/ui/src/views/list/Pivot.tsx index 3542e05a..7a442153 100644 --- a/ui/src/views/list/Pivot.tsx +++ b/ui/src/views/list/Pivot.tsx @@ -44,6 +44,7 @@ import { usePWA } from '@/utils/hooks/usePWA' import { layoutTypes } from '../admin/listForm/edit/types' import { useListFormCustomDataSource } from './useListFormCustomDataSource' import { useListFormColumns } from './useListFormColumns' +import { useStoreState } from '@/store' interface PivotProps { listFormCode: string @@ -66,6 +67,7 @@ const Pivot = (props: PivotProps) => { const gridRef = useRef() const chartRef = useRef(null) const refListFormCode = useRef('') + const config = useStoreState((state) => state.abpConfig.config) const [gridDataSource, setGridDataSource] = useState>() const [columnData, setColumnData] = useState() @@ -248,7 +250,7 @@ const Pivot = (props: PivotProps) => { ) setGridDataSource(dataSource) - }, [gridDto, searchParams]) + }, [gridDto, config, searchParams]) useEffect(() => { refListFormCode.current = listFormCode @@ -321,9 +323,9 @@ const Pivot = (props: PivotProps) => { variant={'default'} className="text-sm flex items-center gap-1" onClick={clearPivotFilters} - title="Remove Filter" + title={translate('::ListForms.ListForm.RemoveFilter')} > - Remove Filters + {translate('::ListForms.ListForm.RemoveFilter')} {checkPermission(gridDto?.gridOptions.permissionDto.u) && ( @@ -350,7 +352,7 @@ const Pivot = (props: PivotProps) => { isPwaMode ? '_self' : '_blank', ) }} - title="Form Manager" + title={translate('::ListForms.ListForm.Manage')} > diff --git a/ui/src/views/list/Tree.tsx b/ui/src/views/list/Tree.tsx index 8b3d14d3..6a3bdcb9 100644 --- a/ui/src/views/list/Tree.tsx +++ b/ui/src/views/list/Tree.tsx @@ -63,6 +63,7 @@ import { layoutTypes } from '../admin/listForm/edit/types' import { useListFormCustomDataSource } from './useListFormCustomDataSource' import { useListFormColumns } from './useListFormColumns' import { DataType } from 'devextreme/common' +import { useStoreState } from '@/store/store' interface TreeProps { listFormCode: string @@ -94,6 +95,7 @@ const Tree = (props: TreeProps) => { const [widgetGroupHeight, setWidgetGroupHeight] = useState(0) const [expandedRowKeys, setExpandedRowKeys] = useState([]) + const config = useStoreState((state) => state.abpConfig.config) const preloadExportLibs = () => { import('exceljs') @@ -635,7 +637,7 @@ const Tree = (props: TreeProps) => { }, [gridDto]) useEffect(() => { - if (!gridDto) return + if (!gridDto || !config) return const cols = getBandedColumns() setColumnData(cols) @@ -648,7 +650,7 @@ const Tree = (props: TreeProps) => { cols, ) setTreeListDataSource(dataSource) - }, [gridDto, searchParams]) + }, [gridDto, searchParams, config]) useEffect(() => { const activeFilters = extraFilters.filter((f) => f.value) @@ -1120,6 +1122,7 @@ const Tree = (props: TreeProps) => {