translations for dialogs

This commit is contained in:
SpikeHD 2022-05-05 20:25:39 -07:00
parent 00d8d57e66
commit 7c405a31fd
3 changed files with 13 additions and 4 deletions

View File

@ -81,5 +81,11 @@
"updateNotifText": "A new update is available! Newest version: ",
"chineseCharacterAlert": "The file path set contains Chinese characters, this may cause problems!"
"chineseCharacterAlert": "The file path set contains Chinese characters, this may cause problems!",
"dialogOk": "OK",
"dialogNo": "NO",
"serverEnableDialogTitle": "You found the Grasscutter server launcher!",
"serverEnableDialogText": "If you do not have an existing Grasscutter installation to set, would you like to download a build?"
}

View File

@ -123,13 +123,16 @@ function openDialog(title, message, negBtn = false, affirmBtn = closeDialog) {
const noBtn = document.getElementById('dialogButtonNeg')
const yesBtn = document.getElementById('dialogButtonAffirm')
if (!noBtn) {
if (!negBtn) {
noBtn.style.display = 'none'
} else {
noBtn.style.removeProperty('display')
noBtn.onclick = () => closeDialog()
}
yesBtn.innerText = localeObj.dialogYes || 'OK'
noBtn.innerText = localeObj.dialogNo || 'NO'
yesBtn.onclick = () => {
affirmBtn()
closeDialog()

View File

@ -27,8 +27,8 @@ async function toggleServerLaunchSection() {
closeSettings()
openDialog(
'You found the Grasscutter server launcher!' || localeObj.serverEnableDialogTitle,
'If you do not have an existing Grasscutter installation to set, would you like to download a build?' || localeObj.serverEnableDialogText,
localeObj.serverEnableDialogTitle || 'You found the Grasscutter server launcher!',
localeObj.serverEnableDialogText || 'If you do not have an existing Grasscutter installation to set, would you like to download a build?',
true,
openDownloads
)