react-translate-component icon indicating copy to clipboard operation
react-translate-component copied to clipboard

Add children to Translate

Open davidlubomirov opened this issue 4 years ago • 1 comments

Hello,

I'm trying to achieve the following HTML in React:

<a className="collapsible-header">
// the value on the next line is the text which needs translation
    language
    <i className="material-icons">arrow_drop_down</i>
</a> 

and I'm trying this:

<Translate
     content="language"
     component="a"
     className="collapsible-header"
     children={
          <i className="material-icons">arrow_drop_down"</i>
      }
/>

But the "i" tag isn't rendered.

If the "children" isn't supported, is there another way for this ?

davidlubomirov avatar May 20 '20 14:05 davidlubomirov

@davidlubomirov I'm not sure what actually need to be translated. Perhaps it's "arrow_drop_down"?

Would doing it like this solve the issue?

<a className="collapsible-header">
  <Translate 
    component="i" 
    className="material-icons" 
    content="some.translation.key"
  />
</a>

martinandert avatar May 22 '20 11:05 martinandert