Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Add a hotfix replacing the pipe character (#5496)
Olga Bulata0fd32a0e6d5
diff --git a/frontend/i18n/scripts/translations.mjs b/frontend/i18n/scripts/translations.mjsindex f43365f63..edc1859b1 100644--- a/frontend/i18n/scripts/translations.mjs+++ b/frontend/i18n/scripts/translations.mjs@@ -121,6 +121,16 @@ const extractZip = async (zipPath, debug) => {deprecatedKeys,invalidKeys)+ // Hotfix for the pipe character in Hindi translations+ // https://github.com/WordPress/openverse/issues/5495+ const enContent = readToJson(enJsonFile)+ if (targetName === "hi.json") {+ for (const [key, value] of Object.entries(cleanedContent)) {+ if (value.includes("|") && !enContent[key].includes("|")) {+ cleanedContent[key] = value.replace(/\|/g, "")+ }+ }+ }// Only save if there are translationsif (Object.keys(cleanedContent).length > 0) {