mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-27 13:29:15 +07:00
🐛 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user