ukrainian localization and new error popup

This commit is contained in:
wukko
2022-08-19 23:54:20 +06:00
parent 5230438068
commit 869dab9d1f
19 changed files with 210 additions and 77 deletions

View File

@@ -9,11 +9,13 @@ const names = {
"🪄": "magic_wand",
"🐲": "dragon_face",
"💸": "money_with_wings",
"⚙️": "gear"
"⚙️": "gear",
"☹️": "frowning_face"
}
let sizing = {
22: 0.4,
30: 0.7
30: 0.7,
48: 0.9
}
export default function(emoji, size, disablePadding) {
if (!size) size = 22;

View File

@@ -40,18 +40,21 @@ export function popup(obj) {
}
}
return `
${!obj.embed ? `<div id="popup-${obj.name}" class="popup center box${classes.length > 0 ? ' ' + classes.join(' ') : ''}" style="visibility: hidden;">` : ''}
${obj.standalone ? `<div id="popup-${obj.name}" class="popup center box${classes.length > 0 ? ' ' + classes.join(' ') : ''}" style="visibility: hidden;">` : ''}
${obj.buttonOnly ? obj.emoji : ``}
<div id="popup-header" class="popup-header">
${!obj.embed ? `<button id="popup-close" class="button mono" onclick="popup('${obj.name}', 0)" ${obj.header.closeAria ? `aria-label="${obj.header.closeAria}"` : ''}>x</button>` : ''}
${obj.standalone && !obj.buttonOnly ? `<button id="popup-close" class="button mono" onclick="popup('${obj.name}', 0)" ${obj.header.closeAria ? `aria-label="${obj.header.closeAria}"` : ''}>x</button>` : ''}
${obj.header.aboveTitle ? `<a id="popup-above-title" href="${obj.header.aboveTitle.url}">${obj.header.aboveTitle.text}</a>` : ''}
${obj.header.title ? `<div id="popup-title">${obj.header.title}</div>` : ''}
${obj.header.subtitle ? `<div id="popup-subtitle">${obj.header.subtitle}</div>` : ''}
</div>
<div id="popup-content"${obj.footer ? ' class="with-footer"' : ''}>${body}</div>
<div id="popup-content"${obj.footer ? ' class="with-footer"' : ''}>
${body}${obj.buttonOnly ? `<button id="close-error" class="switch" onclick="popup('${obj.name}', 0)">${obj.buttonText}</button>` : ''}
</div>
${obj.footer ? `<div id="popup-footer" class="popup-footer">
<a id="popup-bottom" class="popup-footer-content" href="${obj.footer.url}">${obj.footer.text}</a>
</div>` : ''}
${!obj.embed ? `</div>` : ''}`
${obj.standalone ? `</div>` : ''}`
}
export function multiPagePopup(obj) {

View File

@@ -67,7 +67,6 @@ export default function(obj) {
name: "about",
title: `${emoji("🐲")} ${loc(obj.lang, 'AboutTab')}`,
content: popup({
embed: true,
name: "about",
header: {
aboveTitle: {
@@ -90,7 +89,6 @@ export default function(obj) {
name: "changelog",
title: `${emoji("🎉")} ${loc(obj.lang, 'ChangelogTab')}`,
content: popup({
embed: true,
name: "changelog",
header: {
closeAria: loc(obj.lang, 'AccessibilityClosePopup'),
@@ -103,6 +101,8 @@ export default function(obj) {
text: loc('en', 'ChangelogContentTitle'),
classes: ["changelog-subtitle"],
nopadding: true
}, {
text: loc('en', 'FollowTwitter')
}, {
text: loc('en', 'ChangelogContent')
}, {
@@ -123,7 +123,6 @@ export default function(obj) {
name: "donate",
title: `${emoji("💰")} ${loc(obj.lang, 'DonationsTab')}`,
content: popup({
embed: true,
name: "donate",
header: {
closeAria: loc(obj.lang, 'AccessibilityClosePopup'),
@@ -239,6 +238,7 @@ export default function(obj) {
})}
${popup({
name: "download",
standalone: true,
header: {
closeAria: loc(obj.lang, 'AccessibilityClosePopup'),
subtitle: loc(obj.lang, 'TitlePopupDownload')
@@ -253,11 +253,16 @@ export default function(obj) {
})}
${popup({
name: "error",
standalone: true,
buttonOnly: true,
emoji: emoji("☹️", 48, 1),
classes: ["small"],
buttonText: loc(obj.lang, 'ErrorPopupCloseButton'),
header: {
closeAria: loc(obj.lang, 'AccessibilityClosePopup'),
title: loc(obj.lang, 'TitlePopupError')
},
body: `<div id="desc-error"></div>`
body: `<div id="desc-error" class="desc-padding subtext"></div>`
})}
<div id="popup-backdrop" style="visibility: hidden;" onclick="hideAllPopups()"></div>
<div id="cobalt-main-box" class="center box" style="visibility: hidden;">