🌐 refactor: Interpolate Localization Keys (#10650)

* 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 <danny@librechat.ai>
This commit is contained in:
Dustin Healy 2025-11-25 12:19:49 -08:00 committed by Danny Avila
parent 39cecc97bd
commit b6dcefc53a
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
28 changed files with 130 additions and 85 deletions

View file

@ -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];

View file

@ -145,7 +145,7 @@ const EditPresetDialog = ({
<OGDialog open={presetModalVisible} onOpenChange={handleOpenChange}>
<OGDialogContent className="h-[100dvh] max-h-[100dvh] w-full max-w-full overflow-y-auto bg-white dark:border-gray-700 dark:bg-gray-850 dark:text-gray-300 md:h-auto md:max-h-[90vh] md:max-w-[75vw] md:rounded-lg lg:max-w-[950px]">
<OGDialogTitle>
{`${localize('com_ui_edit')} ${localize('com_endpoint_preset')} - ${preset?.title}`}
{localize('com_ui_edit_preset_title', { title: preset?.title })}
</OGDialogTitle>
<div className="flex w-full flex-col gap-2 px-1 pb-4 md:gap-4">

View file

@ -63,7 +63,7 @@ const PresetItems: FC<{
<button
type="button"
className="mr-1 flex h-[32px] cursor-pointer items-center rounded bg-transparent px-2 py-1 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-100 hover:text-red-700 focus:ring-ring dark:bg-transparent dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-red-700"
aria-label={localize('com_ui_clear') + ' ' + localize('com_ui_all')}
aria-label={localize('com_ui_clear_all')}
>
<svg
width="24"
@ -76,12 +76,12 @@ const PresetItems: FC<{
>
<path d="M9.293 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.707A1 1 0 0 0 13.707 4L10 .293A1 1 0 0 0 9.293 0M9.5 3.5v-2l3 3h-2a1 1 0 0 1-1-1M6.854 7.146 8 8.293l1.146-1.147a.5.5 0 1 1 .708.708L8.707 9l1.147 1.146a.5.5 0 0 1-.708.708L8 9.707l-1.146 1.147a.5.5 0 0 1-.708-.708L7.293 9 6.146 7.854a.5.5 0 1 1 .708-.708"></path>
</svg>
{localize('com_ui_clear')} {localize('com_ui_all')}
{localize('com_ui_clear_all')}
</button>
</DialogTrigger>
<DialogTemplate
showCloseButton={false}
title={`${localize('com_ui_clear')} ${localize('com_endpoint_presets')}`}
title={localize('com_ui_clear_presets')}
className="max-w-[450px]"
main={
<>