1

I need some help. I'm new to React and I'm trying to translate app with ReactIntl and FormattedMessage. My question is: "Can I translate content of css pseudo element ::before, that is located in my App.css file?" And if it's possible, how? :-)

    .btnAdd::before {
  content: "Add";
}

Thanks!

Danijela_
  • 13
  • 4

1 Answers1

0

A great way is to use html's lang attribute!
Like this:

html[lang="en"] .btnAdd:before {
    content: 'Add';
}
html[lang="pl"] .btnAdd:before {
    content: 'Dodaj';
}
html[lang="it"] .btnAdd:before {
    content: 'Aggiungi';
}
Annak942
  • 146
  • 8