question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

<5> some text.. </5> obviously not replacing <Link>

See original GitHub issue

`
import { withRouter, Link } from “react-router-dom”;

<Trans i18nKey="register.alreadySignedup">
      Already signed up? <Link to="/signin">Login here</Link>{" "}
      instead.
 </Trans>

` I want to make this already signed up link with 2 different languages. The problem is the text inside <Link> component stays as text. I want it to appear as link Here is my translations files

tr { "register": { "alreadySignedup": "Zaten üye misin? <5>Buradan giriş yap</5>" } }

// en { "register": { "alreadySignedup": "Already signed up? <5>Login here</5> instead." } }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jamuhlcommented, Dec 10, 2019

Trans node children (comment is the index):

...you agree to the // 0
<Link to="/terms">Terms of Service</Link> // 1
 and // 2
<Link to="/privacy">Privacy Policy</Link> // 3
. // 4

so translation has to be ... you agree to the <1>Terms of Service</1> and <3>Privacy Policy</3>

https://react.i18next.com/latest/trans-component#how-to-get-the-correct-translation-string

1reaction
jamuhlcommented, Jun 30, 2019

ah…there the 5 is coming from…the number reflects the index of child node (Trans -> prop.childrens[i])

For getting that numbers right you might read: https://react.i18next.com/latest/trans-component#how-to-get-the-correct-translation-string

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding SC 2.4.4:Link Purpose (In Context) (Level A)
A best practice for links to conforming alternate versions is to ensure that the link text to the conforming alternate version indicates in...
Read more >
Find and replace text
Go to Home > Replace. Enter the word or phrase you want to replace in Find what. Enter your new text in Replace...
Read more >
Links - Usability & Web Accessibility - Yale University
But, assistive technology considers an ARIA label to replace the link text. For that reason, links with ARIA labels may create a worse...
Read more >
Find and Replace | Figma Community
Search for texts on your page and replace them just like a text editor. You can search for objects on your page by...
Read more >
MySQL REPLACE() function
MySQL REPLACE() replaces all the occurrances of a substring within a ... .bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> </head> ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found