react-intl

    2熱度

    1回答

    我有一個模板化的TextAreaField,它使用FormControl從react-bootstrap爲它提供良好的引導程序外觀。 我希望能夠通過react-intl使用國際化郵件。它適用於FormControl以外的所有組件,但不適用於道具。當我嘗試通過FormattedMessage到placeholder它只顯示[object Object] 任何想法? TextAreaField.js

    2熱度

    1回答

    所以我index.js有這樣的事情: import trFi from './translations/fi_FI.json'; import trSv from './translations/sv_SE.json'; ReactDOM.render( <IntlProvider locale={my_locale} messages={{ fi: trFi,

    0熱度

    1回答

    我一直在嘗試模擬onPress使用酶淺呈現。 但是我無法訪問TouchableOpacity由於反應國際 我見過的輔助函數注入intl到反應組件,但這些似乎只適用於反應,而不是反應本地。 it("should handle button presses",() => { const onPress = sinon.spy(); const button = shallow(

    0熱度

    1回答

    我正在使用react-intl和react-helmet!我試圖將元描述傳遞給頭盔作爲翻譯文本,但似乎這是不可能的! 這裏是我做的: <Helmet meta={[{ name: 'description', content: { id: 'homepage.description'} }]} link={[{ rel: 'icon', href: 'favicon/favic

    3熱度

    1回答

    我有utils.js文件。 export function categoryIdToCategoryName(categoryId) { let name; switch (categoryId) { case constants.RISK_CATEGORY_LOW: name = 'low'; break; case constants.RISK_

    2熱度

    1回答

    我使用react-intl來翻譯應用程序。 我得到了幾秒鐘的時間,這反應了完成一項任務需要多長時間,我想把這個時間表現爲相對時間。 (「2分」,而不是純粹的120秒) 但是當我使用 <FormattedRelative value={0} initialNow={1248341} /> 的反應,國際的回報「22分鐘前」,而不是「2周」有沒有辦法擺脫那個「前」短語並只顯示給定時間值的翻譯短語?

    0熱度

    1回答

    我正在使用FormattedDate來顯示時間,我想知道是否可以對每個單獨部分的時間進行樣式設置。 我成功地設計了小時和分鐘的風格,但「PM」的「AM」如何呢? 我的目標是有類似的東西附加圖像

    0熱度

    2回答

    我正在嘗試爲我的反應應用程序找到最佳翻譯的概念。 我有翻譯高階組件,並通過使用它: export default translate('MyComponent')(MyComponent); 和部件我可以通過道具的所有文本里面 - 它工作正常,我。 但是,我有很多純JavaScript文件常量,也需要一個tranlations那裏。例如存在驗證架構的錯誤消息,或者constats與選擇元素,如

    0熱度

    1回答

    我一直在努力,因爲當我運行測試,我有這個錯誤嘲諷React-Intl library與Jest: Invariant Violation: [React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry. 這個庫的documentation說,

    4熱度

    1回答

    我想用react-intl來做語言翻譯。當我使用這個<FormattedMessage id='importantNews' />時,它工作得很完美。但是,當我使用intl.formatMessage()下面的代碼時,它不起作用並拋出一些錯誤。我不知道它有什麼問題。 import { injectIntl, FormattedMessage } from 'react-intl'; funct