From 3e8cb01f847e079b660bbc77273cf76e5f7e4db3 Mon Sep 17 00:00:00 2001 From: Dustin Healy <54083382+dustinhealy@users.noreply.github.com> Date: Tue, 25 Nov 2025 12:19:49 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=90=20refactor:=20Interpolate=20Locali?= =?UTF-8?q?zation=20Keys=20(#10650)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: replace string concatenation of localization keys with interpolations and add keys for unlocalized string literals * chore: update test for new localization key --------- Co-authored-by: Danny Avila --- .../Agents/MarketplaceAdminSettings.tsx | 6 +-- .../src/components/Chat/Input/MCPSelect.tsx | 2 +- .../Chat/Menus/Presets/EditPresetDialog.tsx | 2 +- .../Chat/Menus/Presets/PresetItems.tsx | 6 +-- client/src/components/Conversations/Convo.tsx | 4 +- .../ConvoOptions/DeleteButton.tsx | 9 ++++- client/src/components/Nav/SearchBar.tsx | 2 +- .../Nav/SettingsTabs/Chat/ChatDirection.tsx | 6 +-- .../Nav/SettingsTabs/Data/SharedLinks.tsx | 8 +++- .../General/ArchivedChatsTable.tsx | 11 +++++- .../src/components/Prompts/AdminSettings.tsx | 2 +- .../Prompts/Groups/ChatGroupItem.tsx | 6 +-- .../Prompts/Groups/DashGroupItem.tsx | 6 +-- .../components/Prompts/VariablesDropdown.tsx | 7 +--- .../Sharing/PeoplePickerAdminSettings.tsx | 6 +-- .../SidePanel/Agents/AdminSettings.tsx | 6 +-- .../SidePanel/Agents/AgentConfig.tsx | 15 +++++-- .../SidePanel/Agents/AgentPanel.test.tsx | 9 +++-- .../SidePanel/Agents/AgentPanel.tsx | 18 ++------- .../SidePanel/Agents/AgentSelect.tsx | 2 +- .../SidePanel/Agents/DeleteButton.tsx | 4 +- .../SidePanel/Agents/DuplicateAgent.tsx | 2 +- .../SidePanel/Builder/AssistantSelect.tsx | 2 +- .../SidePanel/Builder/ContextButton.tsx | 2 +- .../src/components/SidePanel/MCP/MCPPanel.tsx | 2 +- .../SidePanel/Memories/AdminSettings.tsx | 6 +-- client/src/locales/en/translation.json | 39 +++++++++++++++++-- client/src/routes/RouteErrorBoundary.tsx | 25 ++++++------ 28 files changed, 130 insertions(+), 85 deletions(-) diff --git a/client/src/components/Agents/MarketplaceAdminSettings.tsx b/client/src/components/Agents/MarketplaceAdminSettings.tsx index e09f168afe..7c1a29d0fb 100644 --- a/client/src/components/Agents/MarketplaceAdminSettings.tsx +++ b/client/src/components/Agents/MarketplaceAdminSettings.tsx @@ -154,9 +154,9 @@ const MarketplaceAdminSettings = () => { - {`${localize('com_ui_admin_settings')} - ${localize( - 'com_ui_marketplace', - )}`} + + {localize('com_ui_admin_settings_section', { section: localize('com_ui_marketplace') })} +
{/* Role selection dropdown */}
diff --git a/client/src/components/Chat/Input/MCPSelect.tsx b/client/src/components/Chat/Input/MCPSelect.tsx index 9482581802..5d088d26a1 100644 --- a/client/src/components/Chat/Input/MCPSelect.tsx +++ b/client/src/components/Chat/Input/MCPSelect.tsx @@ -21,7 +21,7 @@ function MCPSelectContent() { const renderSelectedValues = useCallback( (values: string[], placeholder?: string) => { if (values.length === 0) { - return placeholder || localize('com_ui_select') + '...'; + return placeholder || localize('com_ui_select_placeholder'); } if (values.length === 1) { return values[0]; diff --git a/client/src/components/Chat/Menus/Presets/EditPresetDialog.tsx b/client/src/components/Chat/Menus/Presets/EditPresetDialog.tsx index bd64665cd5..7914820805 100644 --- a/client/src/components/Chat/Menus/Presets/EditPresetDialog.tsx +++ b/client/src/components/Chat/Menus/Presets/EditPresetDialog.tsx @@ -145,7 +145,7 @@ const EditPresetDialog = ({ - {`${localize('com_ui_edit')} ${localize('com_endpoint_preset')} - ${preset?.title}`} + {localize('com_ui_edit_preset_title', { title: preset?.title })}
diff --git a/client/src/components/Chat/Menus/Presets/PresetItems.tsx b/client/src/components/Chat/Menus/Presets/PresetItems.tsx index 6a472a0142..a242184870 100644 --- a/client/src/components/Chat/Menus/Presets/PresetItems.tsx +++ b/client/src/components/Chat/Menus/Presets/PresetItems.tsx @@ -63,7 +63,7 @@ const PresetItems: FC<{ diff --git a/client/src/components/Conversations/Convo.tsx b/client/src/components/Conversations/Convo.tsx index 048c2f129d..d44ef58ed8 100644 --- a/client/src/components/Conversations/Convo.tsx +++ b/client/src/components/Conversations/Convo.tsx @@ -137,7 +137,9 @@ export default function Conversation({ conversation, retainView, toggleNav }: Co )} role="button" tabIndex={renaming ? -1 : 0} - aria-label={`${title || localize('com_ui_untitled')} conversation`} + aria-label={localize('com_ui_conversation_label', { + title: title || localize('com_ui_untitled'), + })} onClick={(e) => { if (renaming) { return; diff --git a/client/src/components/Conversations/ConvoOptions/DeleteButton.tsx b/client/src/components/Conversations/ConvoOptions/DeleteButton.tsx index d0de38175e..a8fb82c77e 100644 --- a/client/src/components/Conversations/ConvoOptions/DeleteButton.tsx +++ b/client/src/components/Conversations/ConvoOptions/DeleteButton.tsx @@ -1,4 +1,5 @@ import React, { useCallback } from 'react'; +import { Trans } from 'react-i18next'; import { QueryKeys } from 'librechat-data-provider'; import { useQueryClient } from '@tanstack/react-query'; import { useParams, useNavigate } from 'react-router-dom'; @@ -80,7 +81,7 @@ export function DeleteConversationDialog({ return ( @@ -88,7 +89,11 @@ export function DeleteConversationDialog({ {localize('com_ui_delete_conversation')}
- {localize('com_ui_delete_confirm')} {title} ? + }} + />
@@ -262,7 +264,9 @@ export default function SharedLinks() { setDeleteRow(row.original); setIsDeleteOpen(true); }} - aria-label={`${localize('com_ui_delete')} - ${row.original.title || localize('com_ui_untitled')}`} + aria-label={localize('com_ui_delete_shared_link', { + title: row.original.title || localize('com_ui_untitled'), + })} >