Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jemikanegara committed Jun 21, 2024
1 parent 5bf6518 commit 4c2699f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,9 @@ function modifyHtmlStrings(rootElement, language, apiKey, shouldOptimizeSEO) {

// if the text is already translated in the previous page, then find the original text
if (window.langHistory?.length) {
const [prev] = window.langHistory[window.langHistory.length - 1];
if (prev != options.originalLanguage) {
const existingCache = Object.entries(allLangCacheInAllPages[prev])
// const [prev] = window.langHistory[window.langHistory.length - 1];
// if (prev != options.originalLanguage) {
const existingCache = Object.values(allLangCacheInAllPages).reduce((prev, value) => [...prev, ...Object.entries(value)], [])
.find(([key, value]) => {
return value == textNode.textContent
})
Expand All @@ -702,10 +702,10 @@ function modifyHtmlStrings(rootElement, language, apiKey, shouldOptimizeSEO) {
textNode.context.replace(textNode.textContent, textNode.originalTextContent)
}
}
}
// }
}

// if (textNode.textContent == "Cama adicional") console.log("textNodeThatNotInPrevPage GO", textNode.originalTextContent, textNode.textContent)
// if (textNode.textContent == "Cama adicional") console.log("textNodeThatNotInPrevPage original vs textContent", textNode.originalTextContent, textNode.textContent)
return [...prevTextNode, textNode];
// if (textNode.originalTextContent != textNode.textContent) {
// return [...prevTextNode, textNode];
Expand Down

0 comments on commit 4c2699f

Please sign in to comment.