diff --git a/packages/frontend/src/components/Routing.js b/packages/frontend/src/components/Routing.js index d7797fd21c..e20acb0179 100644 --- a/packages/frontend/src/components/Routing.js +++ b/packages/frontend/src/components/Routing.js @@ -1,5 +1,4 @@ import { ConnectedRouter } from 'connected-react-router'; -import isString from 'lodash.isstring'; import { parseSeedPhrase } from 'near-seed-phrase'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; @@ -144,15 +143,7 @@ class Routing extends Component { languages, options: { defaultLanguage: 'en', - onMissingTranslation: ({ translationId, defaultTranslation }) => { - if (isString(defaultTranslation)) { - // do anything to change the defaultTranslation as you wish - return defaultTranslation; - } else { - // that's the code that can fix the issue - return ReactDOMServer.renderToStaticMarkup(defaultTranslation); - } - }, + onMissingTranslation: ({ defaultTranslation }) => defaultTranslation, renderToStaticMarkup: ReactDOMServer.renderToStaticMarkup, renderInnerHtml: true } diff --git a/packages/frontend/src/components/SafeTranslate.js b/packages/frontend/src/components/SafeTranslate.js index 23c9309d50..2014785eaf 100644 --- a/packages/frontend/src/components/SafeTranslate.js +++ b/packages/frontend/src/components/SafeTranslate.js @@ -9,11 +9,13 @@ import { Translate } from 'react-localize-redux'; function processDataValue(value) { // 99% of the time we'll just have a single `data` string if (isString(value)) { + console.log('processing string', value); return escapeHtml(value); } // Sometimes we may have a hashmap containing multiple variables to interpolate if (isPlainObject(value)) { + console.log('processing object', value); return mapValues(value, (v) => processDataValue(v)); }