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

translations inside jt are not extracted #179

Open
AlexMost opened this issue Aug 2, 2019 · 1 comment
Open

translations inside jt are not extracted #179

AlexMost opened this issue Aug 2, 2019 · 1 comment
Labels

Comments

@AlexMost
Copy link
Member

AlexMost commented Aug 2, 2019

Example:

<div>{jt`${ <strong>${ jt`oh no` }</strong>} you did something wrong`}</div>

ttag update will not extract oh no

#177 (comment)

@AlexMost AlexMost added the bug label Aug 2, 2019
@abidjappie
Copy link

abidjappie commented Dec 14, 2023

I attempted to recreate an analogy of this issue in the test suite. I know the JSX is slightly different, but I think the conclusion might be similar:

// Analogy test case
const strong = '<Strong>';
expect(jt`${strong + `${jt`oh no`}` + strong} you did something wrong`)

This is broken down using buildArr with the following args:

Strs [ '', ' you did something wrong' ]
Exprs [ '<Strong>oh no<Strong>' ]

and results in:

      -[
      -  ""
      -  "<Strong>oh no<Strong>"
      -  " you did something wrong"
      -]

The problem is because the first tagged templates return value is used directly in the final output of the jt. I'm not sure if there's anyway to fix this right now, just wanted to post my findings.

Please let me know if I'm looking in the wrong place, I'd like to help out if I can!
EDIT: I should probably investigate inside the getMsgid 🙇

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

No branches or pull requests

2 participants