🐛 fix(InputEditor): ensure lexical placeholder reactively updates on locale change (#11352)

* 🐛 fix(InputEditor): ensure lexical placeholder reactively updates on locale change

Added useTranslation hook to trigger re-render when locale changes.

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Innei
2026-01-08 22:01:19 +08:00
committed by GitHub
parent 6d4d3cbd70
commit 72e796bae5

View File

@@ -1,7 +1,7 @@
import { KeyEnum } from '@lobechat/types';
import { Flexbox, Hotkey, combineKeys } from '@lobehub/ui';
import { memo } from 'react';
import { Trans } from 'react-i18next';
import { Trans, useTranslation } from 'react-i18next';
import { useUserStore } from '@/store/user';
import { preferenceSelectors } from '@/store/user/selectors';
@@ -12,6 +12,9 @@ const Placeholder = memo(() => {
? KeyEnum.Enter
: combineKeys([KeyEnum.Mod, KeyEnum.Enter]);
// Don't remove this line for i18n reactivity
void useTranslation('chat');
return (
<Flexbox align={'center'} as={'span'} gap={4} horizontal wrap={'wrap'}>
<Trans