Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trans macro inside ConditionalExpressions are not processed #16

Open
thekip opened this issue Feb 14, 2023 · 0 comments
Open

Trans macro inside ConditionalExpressions are not processed #16

thekip opened this issue Feb 14, 2023 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers hacktoberfest

Comments

@thekip
Copy link
Collaborator

thekip commented Feb 14, 2023

Related PR in upstream repo: lingui/js-lingui#1436

To Reproduce

import { Trans } from '@lingui/macro'

export default function Component(props) {
  return <Trans>Hello, {props.world ? <Trans>world</Trans> : <Trans>guys</Trans>}</Trans>
}

Expected behaviour

import { Trans } from '@lingui/react'

export default function Component(props) {
  return (
    <Trans
      id='Hello, {0}'
      values={{
        0: props.world ? <Trans id='world' /> : <Trans id='guys' />
      }}
    />
  )
}

Actual behaviour

import { Trans } from '@lingui/react'

export default function Component(props) {
  return (
    <Trans
      id='Hello, {0}'
      values={{
        0: props.world ? <Trans>world</Trans> : <Trans>guys</Trans>
      }}
    />
  )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers hacktoberfest
Projects
None yet
Development

No branches or pull requests

2 participants