[object Object] on a standard Trans in selects
See original GitHub issueDescribe the bug
I get [object Object] on some standard <Trans id="ui.foo">Foo</Trans>
renders.
This happens only in some cases, and it seems to occur on Selects. The id is in the po file and compiled to js.
I’ve tried downgrading to 2.7.4 which didn’t help.
To Reproduce
https://codesandbox.io/s/boring-glitter-i847j
Expected behavior Display js file or default.
Workaround
Replacing the Trans in question with an i18n._(t('ui.xyz')
XYZ)
resolves the issue. I will update the code sandbox with this.
Additional context
- jsLingui version 2.7.4 | 2.8.3
- Babel version 7.5.5
- Your Babel config (e.g.
.babelrc
)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Standard Objects | Object Reference for the ...
Represents the selections made by the user against a specific Ad Quote Line item for a particular category. This object is available in...
Read more >Object Reference for Salesforce and Lightning Platform
Objects already created for you by Salesforce are called standard ... Multi-select picklist fields contain a list of one or more items from ......
Read more >5 Things You Should Never Do In A Manual Transmission ...
5 Things You Should Never Do With A Manual Transmission Vehicle. Five bad stick shift driving habits. Is it okay to rest your...
Read more >Create a Z object in Migration Cockpit – User-Defined
Guide for the creation of an Z object for Migration Cockpit Here we ... With the rule there also Translation Objects, almost all...
Read more >Manual transmission
In most vehicles with a manual transmission, the driver selects gears by manipulating a lever called a gear stick (also called a gearshift,...
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 Free
Top 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
Hey @mschipperheyn, unfortunately this isn’t related to Lingui as React itself doesn’t allow
<option>
to have React elements. See https://github.com/lingui/js-lingui/issues/655#issuecomment-621637390This would cause the same problem:
We have to use
i18n._
ort
macro hereFWIW, here’s my work around https://codesandbox.io/s/silly-keller-475lp: