diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 3c87fc2..0622534 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -453,7 +453,7 @@ "message": "Error: Authentication of DeepL API failed. Please set the authentication key and plan correctly on the settings page." }, "sonaveebWordIdNotFound": { - "message": "Sõnaveeb word id not found" + "message": "Word not found" }, "unknownError": { "message": "Error: Unknown error" diff --git a/src/content/components/TranslateContainer.js b/src/content/components/TranslateContainer.js index 62af2a5..911e82e 100644 --- a/src/content/components/TranslateContainer.js +++ b/src/content/components/TranslateContainer.js @@ -39,6 +39,7 @@ export default class TranslateContainer extends Component { shouldShowPanel: false, panelPosition: { x: 0, y: 0 }, currentLang: getSettings("targetLang"), + rawHTML: false, resultText: "", candidateText: "", isError: false, @@ -96,6 +97,7 @@ export default class TranslateContainer extends Component { this.setState({ shouldShowPanel: true, panelPosition: panelPosition, + rawHTML: result.rawHTML, resultText: result.resultText, candidateText: getSettings("ifShowCandidate") ? result.candidateText : "", isError: result.isError, @@ -121,6 +123,7 @@ export default class TranslateContainer extends Component { position={this.state.panelPosition} selectedText={this.selectedText} currentLang={this.state.currentLang} + rawHTML={this.state.rawHTML} resultText={this.state.resultText} candidateText={this.state.candidateText} isError={this.state.isError} diff --git a/src/content/components/TranslatePanel.js b/src/content/components/TranslatePanel.js index 11b6e87..c1d282c 100644 --- a/src/content/components/TranslatePanel.js +++ b/src/content/components/TranslatePanel.js @@ -163,7 +163,7 @@ export default class TranslatePanel extends Component { }; render = () => { - const { shouldShow, selectedText, currentLang, resultText, candidateText, isError, errorMessage } = this.props; + const { shouldShow, selectedText, currentLang, rawHTML, resultText, candidateText, isError, errorMessage } = this.props; const { width, height } = this.state.shouldResize ? { width: parseInt(getSettings("width")), height: parseInt(getSettings("height")) } : { width: this.state.panelWidth, height: this.state.panelHeight }; @@ -193,12 +193,14 @@ export default class TranslatePanel extends Component { ref="panel" style={panelStyles} > + {translationApi === "sonaveeb" && ( )}
-

- {splitLine(resultText)} -

+ {rawHTML + ? (

) + : (

{splitLine(resultText)}

) + }

{splitLine(candidateText)}