From 6a0b22082fd6043c88d3b10e4f0a0aa65d706c99 Mon Sep 17 00:00:00 2001 From: Brian Lambert Date: Wed, 3 Apr 2024 12:43:08 -0700 Subject: [PATCH] Fix remaining calls to localize in React components (#2629) --- .../browser/components/actionBarFilter.tsx | 2 +- .../browser/components/actionBarFind.tsx | 6 +++--- .../customFolderMenuItems.tsx | 7 ++++--- .../interpreterActions.tsx | 8 ++++---- .../primaryInterpreter.tsx | 2 +- .../addEditRowFilterModalPopup.tsx | 8 ++++---- .../components/columnSearch.tsx | 2 +- .../components/rowFilterBar/rowFilterBar.tsx | 4 ++-- .../newProjectModalDialog.tsx | 2 +- .../browser/components/actionBar.tsx | 8 +++++--- .../positronHelp/browser/components/actionBars.tsx | 2 +- .../positronNotebook/browser/AddCellButtons.tsx | 4 ++-- .../browser/PositronNotebookComponent.tsx | 2 +- .../browser/notebookCells/DeferredImage.tsx | 2 +- .../browser/notebookCells/NotebookCellActionBar.tsx | 2 +- .../browser/modalDialogs/setPlotSizeModalDialog.tsx | 2 +- .../modalDialogs/deleteAllVariablesModalDialog.tsx | 13 ++++++++----- 17 files changed, 41 insertions(+), 35 deletions(-) diff --git a/src/vs/platform/positronActionBar/browser/components/actionBarFilter.tsx b/src/vs/platform/positronActionBar/browser/components/actionBarFilter.tsx index 3d8de646133..c3bcec175f7 100644 --- a/src/vs/platform/positronActionBar/browser/components/actionBarFilter.tsx +++ b/src/vs/platform/positronActionBar/browser/components/actionBarFilter.tsx @@ -51,7 +51,7 @@ export const ActionBarFilter = (props: ActionBarFilterProps) => { ref={inputRef} type='text' className='text-input' - placeholder={localize('positronFilterPlacehold', "filter")} + placeholder={(() => localize('positronFilterPlacehold', "filter"))()} value={filterText} onFocus={() => setFocused(true)} onBlur={() => setFocused(false)} diff --git a/src/vs/platform/positronActionBar/browser/components/actionBarFind.tsx b/src/vs/platform/positronActionBar/browser/components/actionBarFind.tsx index 992e02df190..36b42348009 100644 --- a/src/vs/platform/positronActionBar/browser/components/actionBarFind.tsx +++ b/src/vs/platform/positronActionBar/browser/components/actionBarFind.tsx @@ -53,7 +53,7 @@ export const ActionBarFind = (props: ActionBarFindProps) => { ref={inputRef} type='text' className='text-input' - placeholder={localize('positronFindPlacehold', "find")} + placeholder={(() => localize('positronFindPlacehold', "find"))()} value={findText} onFocus={() => setFocused(true)} onBlur={() => setFocused(false)} @@ -64,8 +64,8 @@ export const ActionBarFind = (props: ActionBarFindProps) => { )} - props.onFindPrevious!()} /> - props.onFindNext!()} /> + localize('positronFindPrevious', "Find previous"))()} disabled={!props.findResults} onPressed={() => props.onFindPrevious!()} /> + localize('positronFindNext', "Find next"))()} disabled={!props.findResults} onPressed={() => props.onFindNext!()} /> ); }; diff --git a/src/vs/workbench/browser/parts/positronTopActionBar/customFolderModalPopup/customFolderMenuItems.tsx b/src/vs/workbench/browser/parts/positronTopActionBar/customFolderModalPopup/customFolderMenuItems.tsx index 1c231701841..c1e129c0efb 100644 --- a/src/vs/workbench/browser/parts/positronTopActionBar/customFolderModalPopup/customFolderMenuItems.tsx +++ b/src/vs/workbench/browser/parts/positronTopActionBar/customFolderModalPopup/customFolderMenuItems.tsx @@ -99,7 +99,7 @@ export const CustomFolderMenuItems = (props: CustomFolderMenuItemsProps) => { return ( <> - {props.recentlyOpened.workspaces.slice(0, 10).map(recent => { + {props.recentlyOpened.workspaces.slice(0, 10).map((recent, index) => { // Setup the handler. let uri: URI; let label: string; @@ -120,6 +120,7 @@ export const CustomFolderMenuItems = (props: CustomFolderMenuItemsProps) => { // Render. return ( { @@ -156,11 +157,11 @@ export const CustomFolderMenuItems = (props: CustomFolderMenuItemsProps) => { + label={(() => localize('positronOpenFolder', "Open Folder..."))()} /> localize('positronCloseFolder', "Close Folder"))()} separator={true} when={ContextKeyExpr.and( WorkbenchStateContext.isEqualTo('folder'), diff --git a/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/interpreterActions.tsx b/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/interpreterActions.tsx index 9c2b39ea58d..460e0a5b566 100644 --- a/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/interpreterActions.tsx +++ b/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/interpreterActions.tsx @@ -104,7 +104,7 @@ export const InterpreterActions = (props: PropsWithChildren localize('positronInterruptInterpreter', "Interrupt the interpreter"))()} style={{ color: 'red' }} /> @@ -123,7 +123,7 @@ export const InterpreterActions = (props: PropsWithChildren localize('positronRestartInterpreter', "Restart the interpreter"))()} /> } @@ -142,7 +142,7 @@ export const InterpreterActions = (props: PropsWithChildren localize('positronStopTheInterpreter', "Stop the interpreter"))()} /> } @@ -159,7 +159,7 @@ export const InterpreterActions = (props: PropsWithChildren props.onStart()}> localize('positronStartTheInterpreter', "Start the interpreter"))()} /> } diff --git a/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/primaryInterpreter.tsx b/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/primaryInterpreter.tsx index 4b4ca3a3aac..635b0f3e2eb 100644 --- a/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/primaryInterpreter.tsx +++ b/src/vs/workbench/browser/parts/positronTopActionBar/interpretersManagerModalPopup/primaryInterpreter.tsx @@ -90,7 +90,7 @@ export const PrimaryInterpreter = (props: PrimaryInterpreterProps) => { localize('positronShowAllVersions', "Show all versions"))()} /> } diff --git a/src/vs/workbench/browser/positronDataExplorer/components/dataExplorerPanel/components/addEditRowFilterModalPopup/addEditRowFilterModalPopup.tsx b/src/vs/workbench/browser/positronDataExplorer/components/dataExplorerPanel/components/addEditRowFilterModalPopup/addEditRowFilterModalPopup.tsx index 7e5113fcd1c..58cb5feb0a7 100644 --- a/src/vs/workbench/browser/positronDataExplorer/components/dataExplorerPanel/components/addEditRowFilterModalPopup/addEditRowFilterModalPopup.tsx +++ b/src/vs/workbench/browser/positronDataExplorer/components/dataExplorerPanel/components/addEditRowFilterModalPopup/addEditRowFilterModalPopup.tsx @@ -549,10 +549,10 @@ export const AddEditRowFilterModalPopup = (props: AddEditRowFilterModalPopupProp keybindingService={props.renderer.keybindingService} layoutService={props.renderer.layoutService} dataExplorerClientInstance={props.dataExplorerClientInstance} - title={localize( + title={(() => localize( 'positron.addEditRowFilter.selectColumn', "Select Column" - )} + ))()} selectedColumnSchema={selectedColumnSchema} onSelectedColumnSchemaChanged={columnSchema => { // Set the selected column schema. @@ -569,10 +569,10 @@ export const AddEditRowFilterModalPopup = (props: AddEditRowFilterModalPopupProp disabled={selectedColumnSchema === undefined} keybindingService={props.renderer.keybindingService} layoutService={props.renderer.layoutService} - title={localize( + title={(() => localize( 'positron.addEditRowFilter.selectCondition', "Select Condition" - )} + ))()} entries={conditionEntries()} selectedIdentifier={selectedCondition} onSelectionChanged={identifier => { diff --git a/src/vs/workbench/browser/positronDataExplorer/components/dataExplorerPanel/components/addEditRowFilterModalPopup/components/columnSearch.tsx b/src/vs/workbench/browser/positronDataExplorer/components/dataExplorerPanel/components/addEditRowFilterModalPopup/components/columnSearch.tsx index 4aea175ba7b..f6ec75fcdc1 100644 --- a/src/vs/workbench/browser/positronDataExplorer/components/dataExplorerPanel/components/addEditRowFilterModalPopup/components/columnSearch.tsx +++ b/src/vs/workbench/browser/positronDataExplorer/components/dataExplorerPanel/components/addEditRowFilterModalPopup/components/columnSearch.tsx @@ -42,7 +42,7 @@ export const ColumnSearch = (props: ColumnSearchProps) => { ref={inputRef} type='text' className='text-input' - placeholder={localize('positron.searchPlacehold', "search")} + placeholder={(() => localize('positron.searchPlacehold', "search"))()} value={searchText} onFocus={() => setFocused(true)} onBlur={() => setFocused(false)} diff --git a/src/vs/workbench/browser/positronDataExplorer/components/dataExplorerPanel/components/rowFilterBar/rowFilterBar.tsx b/src/vs/workbench/browser/positronDataExplorer/components/dataExplorerPanel/components/rowFilterBar/rowFilterBar.tsx index 2774c3da843..c24ee5d628e 100644 --- a/src/vs/workbench/browser/positronDataExplorer/components/dataExplorerPanel/components/rowFilterBar/rowFilterBar.tsx +++ b/src/vs/workbench/browser/positronDataExplorer/components/dataExplorerPanel/components/rowFilterBar/rowFilterBar.tsx @@ -150,7 +150,7 @@ export const RowFilterBar = () => {