Missing key id, throws error in i18n.t('mykeyId')`MyDefault`
See original GitHub issuei18n.t('ui.video')`Video`
throws
at zip (core.development.js:145)
at I18n.t (core.development.js:155)
at ProxyComponent.renderModal (EditForm.js:50)
ui.video
is missing from the translations. But that shouldn’t matter. This should never throw an error, a warning maybe, but not a hard error
context: Versions: “@lingui/babel-preset-react”: “2.0.7”, “@lingui/cli”: “2.0.7”, “@lingui/react”: “2.0.7”,
class EditForm extends React.PureComponent {
[...]
renderModal() {
const { i18n } = this.props;
const { modal, videoId } = this.state;
return (
<MobileFullSceenModal
title={i18n.t('ui.video')`Video`}
open={modal}
onClose={this.handleCloseModal}
>
<VideoPlayer videoId={videoId} />
</MobileFullSceenModal>
);
}
render() {
const { id, item } = this.props;
return (
<Form
formName={config.formName}
render={({ submitting, validating, handleSubmit }) => (
<form onSubmit={handleSubmit}>
{this.renderModal()}
<Field
id="videoId"
name="videoId"
component={TextInput}
label="VideoId"
format={extractYouTubeId}
parse={extractYouTubeId}
/>
<SubmitButton
submitting={submitting || validating}
submitSuccess={submitSucceeded}
>
<Trans id="ui.submit">Submit</Trans>
</SubmitButton>
</form>
)}
/>
);
}
}
export default connect(null, { listVideos })(withI18n()(EditForm));
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Untitled
Remove key from car or block signal from fob to where vehicle tells you the key is not detected! 5. Select Settings >...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this had to do with the order of the babel entry. It works for me now
@mschipperheyn Could you please try to update to latest versions? I’ve just tried your example and it works.
If it won’t help, also try to remove
@lingui/babel-preset-react
preset and instead add both lingui plugins (@lingui/babel-plugin-transform-js
,@lingui/babel-plugin-transform-react
) to the top of your plugins.