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

Escaped curly-braces doesn't preserve in development mode #1901

Closed
timofei-iatsenko opened this issue Apr 2, 2024 · 1 comment · Fixed by #1913
Closed

Escaped curly-braces doesn't preserve in development mode #1901

timofei-iatsenko opened this issue Apr 2, 2024 · 1 comment · Fixed by #1913

Comments

@timofei-iatsenko
Copy link
Collaborator

Describe the bug

Escaped placeholders still get processed as placeholder in development mode.

To Reproduce

repro: https://github.com/ninesunsabiu/lingui-brace-bug/blob/main/src/App.tsx

const literalBrace = i18n._(msg`Hey '{name}'!`)

Rendered as Hey !. {name} treated as placeholder and replaced to empty string

Expected behavior
It should print Hey {name}!, placeholder is not processed and kept as-is.

Root Cause
This happend because message get double compiled in Dev mode.

First compilation (compiled in catalog):

Hey '{name}' -> Hey {name}

Second compilation happened for already compiled message from catalog in runtime in i18n:

Hey {name} -> Hey <replaced to value>

@ninesunsabiu
Copy link
Contributor

Any progress updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants