我對輸入的翻譯道具有疑問placeholder。我有一個包裝器組件<Text />,它呈現<input>一個。我試過這樣翻譯 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} />我嘗試了很多時間來解決這個問題,沒有找到解決方案......
React Lingui - 翻譯輸入占位符
慕容708150
2023-02-17 17:21:58