From f1742faa24f2cb6daeb1e1dcf931eb772e6a517d Mon Sep 17 00:00:00 2001 From: vineethvk11 Date: Sat, 23 Mar 2024 13:52:50 +0530 Subject: [PATCH] fixing html encoding issue in i18n --- src/UI/PuterDialog.js | 2 +- src/UI/UIWindowPublishWebsite.js | 2 +- src/UI/UIWindowSignup.js | 2 +- src/i18n/i18n.js | 5 +---- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/UI/PuterDialog.js b/src/UI/PuterDialog.js index 21ffc822..d2d37d61 100644 --- a/src/UI/PuterDialog.js +++ b/src/UI/PuterDialog.js @@ -29,7 +29,7 @@ async function PuterDialog(options) { -

${i18n('powered_by_puter_js')}

+

${i18n('powered_by_puter_js', [], false)}

${i18n('tos_fineprint')}

`; diff --git a/src/UI/UIWindowPublishWebsite.js b/src/UI/UIWindowPublishWebsite.js index a0dbb9cc..2ad81682 100644 --- a/src/UI/UIWindowPublishWebsite.js +++ b/src/UI/UIWindowPublishWebsite.js @@ -26,7 +26,7 @@ async function UIWindowPublishWebsite(target_dir_uid, target_dir_name, target_di // success h += `
`; h += ``; - h += `

${i18n('dir_published_as_website', `${target_dir_name}`)}

`; + h += `

${i18n('dir_published_as_website', `${target_dir_name}`, false)}

`; h += `

`; h += ``; h+= `
`; diff --git a/src/UI/UIWindowSignup.js b/src/UI/UIWindowSignup.js index fce5df86..e3dbb203 100644 --- a/src/UI/UIWindowSignup.js +++ b/src/UI/UIWindowSignup.js @@ -64,7 +64,7 @@ function UIWindowSignup(options){ h += ``; // terms and privacy - h += `

${i18n('tos_fineprint', false)}

`; + h += `

${i18n('tos_fineprint', [], false)}

`; // Create Account h += `` h += ``; diff --git a/src/i18n/i18n.js b/src/i18n/i18n.js index 14b46873..3e0b5f24 100644 --- a/src/i18n/i18n.js +++ b/src/i18n/i18n.js @@ -21,10 +21,7 @@ import translations from './translations/translations.js'; window.ListSupportedLanguages = () => Object.keys(translations).map(lang => translations[lang]); window.i18n = function (key, replacements = [], encode_html = true) { - if(typeof replacements === 'boolean' && encode_html === undefined){ - encode_html = replacements; - replacements = []; - }else if(Array.isArray(replacements) === false){ + if(Array.isArray(replacements) === false){ replacements = [replacements]; }