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

t,jt functions don't translate phrases where one variable uses several times #212

Closed
oknesar opened this issue Dec 15, 2020 · 2 comments · Fixed by #248
Closed

t,jt functions don't translate phrases where one variable uses several times #212

oknesar opened this issue Dec 15, 2020 · 2 comments · Fixed by #248

Comments

@oknesar
Copy link

oknesar commented Dec 15, 2020

I have two phrases
image
both of them are translated
image
but 2nd(where I use br twice) doesn't get a translation
image

the problem is here

function getVariablesMap(msgid) {

image
because of the variable used twice, it overwrites into variableNumberMap object

@ooaeoaii
Copy link

ooaeoaii commented May 7, 2021

I recently faced with same problem when I have repeating vars in one sentence and I really don't want to cut it into two parts!

Ex:

t`some text ${var} some text ${var}`

I fixed it like this but it looks too ugly:

const var2 = var;
t`some text ${var} some text ${var2}`

Bumping this issue

@kevinlul
Copy link

kevinlul commented Aug 4, 2022

I just encountered this bug as well. I wonder what the root cause is? Nevermind, just found the fixing #248... almost two months

mmso pushed a commit to ProtonMail/ttag that referenced this issue Jul 5, 2023
mmso pushed a commit to ProtonMail/ttag that referenced this issue Jul 5, 2023
mmso pushed a commit to ProtonMail/ttag that referenced this issue Jul 5, 2023
mmso pushed a commit to ProtonMail/ttag that referenced this issue Jul 5, 2023
AlexMost pushed a commit that referenced this issue Sep 25, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
* Fix variable multi-usage

Closes #212

* Add test for multi-var case

Related to #212
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