Skip to content

Commit

Permalink
Merge pull request #163 from vineeth-vk11/i18n_encoding_issue
Browse files Browse the repository at this point in the history
fixing html encoding issue in i18n
  • Loading branch information
jelveh authored Mar 26, 2024
2 parents 1eababd + f1742fa commit 28acf71
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/UI/PuterDialog.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/UI/UIWindowPublishWebsite.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function UIWindowPublishWebsite(target_dir_uid, target_dir_name, target_di
// success
h += `<div class="window-publishWebsite-success">`;
h += `<img src="${html_encode(window.icons['c-check.svg'])}" style="width:80px; height:80px; display: block; margin:10px auto;">`;
h += `<p style="text-align:center;">${i18n('dir_published_as_website', `<strong>${target_dir_name}</strong>`)}<p>`;
h += `<p style="text-align:center;">${i18n('dir_published_as_website', `<strong>${target_dir_name}</strong>`, false)}<p>`;
h += `<p style="text-align:center;"><a class="publishWebsite-published-link" target="_blank"></a><img class="publishWebsite-published-link-icon" src="${html_encode(window.icons['launch.svg'])}"></p>`;
h += `<button class="button button-normal button-block button-primary publish-window-ok-btn" style="margin-top:20px;">OK</button>`;
h+= `</div>`;
Expand Down
2 changes: 1 addition & 1 deletion src/UI/UIWindowSignup.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function UIWindowSignup(options){
h += `<input type="text" name="p102xyzname" class="p102xyzname" value="">`;

// terms and privacy
h += `<p class="signup-terms">${i18n('tos_fineprint', false)}</p>`;
h += `<p class="signup-terms">${i18n('tos_fineprint', [], false)}</p>`;
// Create Account
h += `<button class="signup-btn button button-primary button-block button-normal">${i18n('create_free_account')}</button>`
h += `</form>`;
Expand Down
5 changes: 1 addition & 4 deletions src/i18n/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down

0 comments on commit 28acf71

Please sign in to comment.