From 6219f109029fae9098f7f5d059898bf3a95a7616 Mon Sep 17 00:00:00 2001 From: Daryl Collins Date: Sat, 18 Sep 2021 03:48:07 -0700 Subject: [PATCH] Revert "Disable email verification method, remove spammy debug logs, fix white screen when trying to render translation terms with invalid language" This reverts commit d69508c3e9ffb0cce2929d406464960013e0c234. --- packages/frontend/src/components/Routing.js | 11 +---------- packages/frontend/src/components/SafeTranslate.js | 2 ++ 2 files changed, 3 insertions(+), 10 deletions(-) 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)); }