I am using lingui.js and following https://lingui.js.org/tutorials/react.html. I am able to setup the project and it runs fine also generates the PO file and translation content for content/element that are wrapped around Trans
macro <Trans>Send Verification Code</Trans>
. However I am not able to find help how do I setup the messaged that we display on button click or placeholders that we set for input element like:
how do I set the translation for string Please select security code preference
from below?
handleOnSelect = (event: any) => {
if (!this.state.selectedOption.value) {
Toast.error("Please select security code preference");
}
}
When I tried doing the translation like below it does not extract the string Please select security code preference
to PO file
handleOnSelect = (event: any) => {
if (!this.state.selectedOption.value) {
Toast.error(i18n._("Please select security code preference"));
}
}
Also how do I do configure for placeholder from below Element?
<Select
name="sendTo"
id="sendTo"
onChange={this.handleSendToChanged}
placeholder={`Select`}
options={this.state.selectOptions}
value={this.state.selectedOption}
/>
Can you please help me know/configure this part?