score:1
Accepted answer
agree with splitting it up is a bad idea...makes translation a bigger pain than needed.
looking at your tags your using react and node.js -> for react you could take the translated content from polyglot and use dangerouslysetinnerhtml https://facebook.github.io/react/docs/dom-elements.html#dangerouslysetinnerhtml
that's what would work - but honestly i would have a look at i18next (spoiler i'm the maintainer of that framework). with the react-i18next you can do those markup translations a lot nicer: https://github.com/i18next/react-i18next/
using the trans component:
<trans i18nkey="usermessagesunread" count={count}>
hello <strong title={t('nametitle')}>{{name}}</strong>, you have {{count}} unread message. <link to="/msgs">go to messages</link>.
</trans>
Source: stackoverflow.com
Related Query
- translate text with markup using polyglot.js
- Using css modules with Extract Text Plugin
- Material UI Stepper using custom icon deletes the step number. how to add the number or random text back with a custom icon?
- Saving HTML markup from Rich Text Editor into MongoDB using React.js
- Text with a link using ES6 template
- How to create circle/square shapes using React with text inside them without using SVG images?
- Using React.js with Sublime Text 3
- A blinking text with React using the CSS property visibility
- blinking text with React using state and setTimeOut
- How to use Font Awesome Icons with Text using ternary operator in React JS?
- Use react to focus input element with caret/text-cursor at end of text using onKeyDown
- replace string text with html tag using regex
- testing react function with state update on input text using jest, rtl, and ionic
- How to wrap text on MathJax using React( with material-ui and react-mathjax-node)
- CKEditor display text with NextJS using useState()
- Cant get a text box state to refresh with user input, keeps going to default state despite using setState
- Using ReactJS how do rows with input text fields maintain state after being sorted
- Using an object as a value with Material-UI select and displaying text when chosen
- A generic change handler for text inputs using Typescript/React with dictionary type
- How to translate long text long text, using react-i18next?
- Using WebFontLoader with React Konva causes text offsets?
- Error: Problem with node not being found using enzyme. Method text
- How to Translate string in array of objects with using react-i18next Without a functional component of a react
- How to create a form with text and file input in react and send form data to server using Nodejs?
- Unable to display helper text in MUI date picker when using along with react-hook-form library
- Input text no longer editable when using register with react-hook-form
- Problems with react to translate words using google translate api
- Text breaks after using the function. Not able to translate the text
- Cross-browser multi-line text using truncate a text or line with ellipsis using Typescript (React)
- Pros/cons of using redux-saga with ES6 generators vs redux-thunk with ES2017 async/await
More Query from same tag
- Can not properly create a main layout with nextjs
- Redux-Form is not connected to Router correctly
- React checkedLink how to access value on change
- React-router-dom: Nested routes is not working but routes instead from within the root component App
- Next.js refreshing page breaks css classNames
- ReactJS passing Stateful variables to child components
- Render Props inside of Header Component Next.js React
- Is there a way to modify the page title with React-Router v4+?
- How to add delete button functionality to React app
- How can I have a field that accepts two different mask formats?
- Toggling value inside React component with useState not working
- react grid - calling a function for rendering a cell
- Carousel Bootstrap not working as a slide
- Why is react-sparklines chart rendered differently on firefox than on chrome?
- i am trying to collapse the nav bar on onclick method but it is not working
- Cannot load layout from local storage - getLayout function not working
- How do I link my javascript files in react when converting from HTML,CSS,JS into JSX, CSS, JS?
- How to toggle class using React Hooks as per localstorage value in App.js?
- How to open exteranal application on top of desktop using electron
- How to get a form to disapear upon submission in React
- How to add String variable or a --i:0 property on inline style ReactJS?
- How to use setState function synchronously in zustand?
- Sending information through props
- background image in styled components react
- How do I download a pdf file onClick with react-pdf?
- How to do SSR for responsive apps without knowing the device's screen size upfront?
- d3: drawing a multi-line line graph from a 2d array of objects
- Best way to detect "orphan words" in wrapped text
- Dispatching an array of objects individually
- React render not working with createElement