Git Product home page Git Product logo

Comments (3)

ryandrewjohnson avatar ryandrewjohnson commented on May 27, 2024 1

@mehmetnyarar In the meantime, although not ideal I'd just split your translation strings:

{
  "goto.homepage.prefix" "Go to",
  "goto.homepage.label" "home page",
  "goto.homepage.suffix" "copy that goes after link goes here."
}

// then in your react component
<p>{ translate('goto.homepage.prefix') } <Link to='/home'>{translate('goto.homepage.label')}</Link> { translate('goto.homepage.suffix') }</p>

from react-localize-redux.

ryandrewjohnson avatar ryandrewjohnson commented on May 27, 2024

The issue here is <Link/> is not a valid HTML element, but a React element. The library does not currently support Rect elements included in translations, as it is outside the scope of this library.

I'm going to close this issue as it's a duplicate of #46. Please feel free to continue the conversation in that issue.

from react-localize-redux.

mehmetnyarar avatar mehmetnyarar commented on May 27, 2024

@ryandrewjohnson thanks for your time. Unfortunately that approach won't work for me since the structure of the sentence changes between languages (en, ru, tr).

I've created a child component which is basically a switch statement and returns JSX based on active language. For now it works for 3 languages but the solution won't scale once you have many languages or many components needing inline links .

from react-localize-redux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.