@@ -113,7 +113,7 @@ export default function ProjectManageModal(props: ProjectManageModalProps): Reac
113113 await loadProjectNames ( props . storage ) ;
114114 } catch ( error ) {
115115 console . error ( 'Error renaming project:' , error ) ;
116- props . setAlertErrorMessage ( 'Failed to rename project' ) ;
116+ props . setAlertErrorMessage ( t ( 'FAILED_TO_RENAME_PROJECT' ) ) ;
117117 }
118118
119119 setRenameModalOpen ( false ) ;
@@ -134,7 +134,7 @@ export default function ProjectManageModal(props: ProjectManageModalProps): Reac
134134 await loadProjectNames ( props . storage ) ;
135135 } catch ( error ) {
136136 console . error ( 'Error copying project:' , error ) ;
137- props . setAlertErrorMessage ( 'Failed to copy project' ) ;
137+ props . setAlertErrorMessage ( t ( 'FAILED_TO_COPY_PROJECT' ) ) ;
138138 }
139139
140140 setCopyModalOpen ( false ) ;
@@ -154,11 +154,12 @@ export default function ProjectManageModal(props: ProjectManageModalProps): Reac
154154 ) ;
155155 } catch ( e ) {
156156 console . error ( 'Failed to create a new project:' , e ) ;
157- props . setAlertErrorMessage ( 'Failed to create a new project.' ) ;
157+ props . setAlertErrorMessage ( t ( 'FAILED_TO_CREATE_PROJECT' ) ) ;
158158 }
159159
160160 setNewItemName ( '' ) ;
161161 await loadProjectNames ( props . storage ) ;
162+ handleSelectProject ( newProjectName ) ;
162163 } ;
163164
164165 /** Handles project deletion with proper cleanup. */
@@ -191,7 +192,7 @@ export default function ProjectManageModal(props: ProjectManageModalProps): Reac
191192 await storageProject . deleteProject ( props . storage , projectNameToDelete ) ;
192193 } catch ( e ) {
193194 console . error ( 'Failed to delete the project:' , e ) ;
194- props . setAlertErrorMessage ( 'Failed to delete the project.' ) ;
195+ props . setAlertErrorMessage ( t ( 'FAILED_TO_DELETE_PROJECT' ) ) ;
195196 }
196197 } ;
197198
@@ -222,12 +223,12 @@ export default function ProjectManageModal(props: ProjectManageModalProps): Reac
222223
223224 /** Gets the rename modal title. */
224225 const getRenameModalTitle = ( ) : string => {
225- return `Rename Project : ${ currentRecord ? currentRecord . projectName : '' } ` ;
226+ return `${ t ( 'RENAME_PROJECT' ) } : ${ currentRecord ? currentRecord . projectName : '' } ` ;
226227 } ;
227228
228229 /** Gets the copy modal title. */
229230 const getCopyModalTitle = ( ) : string => {
230- return `Copy Project : ${ currentRecord ? currentRecord . projectName : '' } ` ;
231+ return `${ t ( 'COPY_PROJECT' ) } : ${ currentRecord ? currentRecord . projectName : '' } ` ;
231232 } ;
232233
233234 /** Creates the container style object. */
@@ -246,7 +247,7 @@ export default function ProjectManageModal(props: ProjectManageModalProps): Reac
246247 /** Table column configuration. */
247248 const columns : Antd . TableProps < ProjectRecord > [ 'columns' ] = [
248249 {
249- title : 'Name' ,
250+ title : t ( 'NAME' ) ,
250251 dataIndex : 'projectName' ,
251252 key : 'projectName' ,
252253 ellipsis : {
@@ -259,7 +260,7 @@ export default function ProjectManageModal(props: ProjectManageModalProps): Reac
259260 ) ,
260261 } ,
261262 {
262- title : 'Actions' ,
263+ title : t ( 'ACTIONS' ) ,
263264 key : 'actions' ,
264265 width : ACTIONS_COLUMN_WIDTH ,
265266 render : ( _ , record : ProjectRecord ) => (
@@ -291,8 +292,8 @@ export default function ProjectManageModal(props: ProjectManageModalProps): Reac
291292 { allProjectRecords . length > 1 && (
292293 < Antd . Tooltip title = { t ( 'Delete' ) } >
293294 < Antd . Popconfirm
294- title = { `Delete ${ record . projectName } ?` }
295- description = "This action cannot be undone."
295+ title = { t ( 'DELETE_PROJECT_CONFIRM' , { projectName : record . projectName } ) }
296+ description = { t ( 'DELETE_CANNOT_BE_UNDONE' ) }
296297 onConfirm = { ( ) => handleDeleteProject ( record . projectName ) }
297298 okText = { t ( 'Delete' ) }
298299 cancelText = { t ( 'Cancel' ) }
@@ -377,30 +378,18 @@ export default function ProjectManageModal(props: ProjectManageModalProps): Reac
377378 title = { t ( 'Project Management' ) }
378379 open = { props . isOpen }
379380 onCancel = { props . onCancel }
380- footer = { [
381- < Antd . Button key = "close" onClick = { props . onCancel } >
382- { t ( 'Close' ) }
383- </ Antd . Button > ,
384- ] }
381+ footer = { null }
385382 width = { MODAL_WIDTH }
386383 >
387384 { props . noProjects && (
388385 < Antd . Alert
389- message = "No projects found"
390- description = "Please create a new project to get started."
386+ message = { t ( 'NO_PROJECTS_FOUND' ) }
387+ description = { t ( 'CREATE_PROJECT_TO_START' ) }
391388 type = "info"
392389 showIcon
393390 style = { getAlertStyle ( ) }
394391 />
395392 ) }
396- < div style = { getContainerStyle ( ) } >
397- < ProjectNameComponent
398- newItemName = { newItemName }
399- setNewItemName = { setNewItemName }
400- onAddNewItem = { handleAddNewItem }
401- projectNames = { allProjectNames }
402- />
403- </ div >
404393 { ! props . noProjects && (
405394 < Antd . Table < ProjectRecord >
406395 columns = { columns }
@@ -412,17 +401,26 @@ export default function ProjectManageModal(props: ProjectManageModalProps): Reac
412401 showSizeChanger : false ,
413402 showQuickJumper : false ,
414403 showTotal : ( total , range ) =>
415- ` ${ range [ 0 ] } - ${ range [ 1 ] } of ${ total } items` ,
404+ t ( 'PAGINATION_ITEMS' , { range0 : range [ 0 ] , range1 : range [ 1 ] , total } ) ,
416405 } : false }
417406 bordered
418407 locale = { {
419- emptyText : 'No projects found' ,
408+ emptyText : t ( 'NO_PROJECTS_FOUND' ) ,
420409 } }
421410 onRow = { ( record ) => ( {
422411 onDoubleClick : ( ) => handleSelectProject ( record . projectName ) ,
423412 } ) }
424413 />
425414 ) }
415+ < br />
416+ < div style = { getContainerStyle ( ) } >
417+ < ProjectNameComponent
418+ newItemName = { newItemName }
419+ setNewItemName = { setNewItemName }
420+ onAddNewItem = { handleAddNewItem }
421+ projectNames = { allProjectNames }
422+ />
423+ </ div >
426424 </ Antd . Modal >
427425 </ >
428426 ) ;
0 commit comments