Created
July 11, 2024 09:19
-
-
Save JohnRSim/167975e289633fcb6bb6b2a1f992ecb6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to update the translations object with new strings that need translating | |
function updateTranslations(textNodes, translations) { | |
textNodes.forEach(node => { | |
const originalText = node.nodeValue.trim(); | |
if (!translations.hasOwnProperty(originalText)) { | |
translations[originalText] = ""; | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment