我對(duì)輸入的翻譯道具有疑問placeholder。我有一個(gè)包裝器組件<Text />,它呈現(xiàn)<input>一個(gè)。我試過這樣翻譯 placholder:import { Trans, t } from '@lingui/macro'const passwordPlaceholder = t('password.placeholder')`Enter password`// this doesn't works<Text as='input' type='password' name='password' placeholder={t(passwordPlaceholder)} required />// neither<Text as='input' type='password' name='password' placeholder={<Trans id={passwordPlaceholder} />} />// not<Text as='input' type='password' name='password' placeholder={passwordPlaceholder} />我嘗試了很多時(shí)間來(lái)解決這個(gè)問題,沒有找到解決方案......
React Lingui - 翻譯輸入占位符
慕容708150
2023-02-17 17:21:58