Compare commits

...

8 Commits

Author SHA1 Message Date
Daniel Scalzi a8996cc3c5
Remove more unneeded translations. 2023-10-05 15:23:58 -04:00
Daniel Scalzi 45a24314b1
Fix translation for news pages. 2023-10-05 15:05:19 -04:00
Daniel Scalzi 6b5d1cbb2a
Leave placeholders inline. 2023-10-05 14:57:27 -04:00
Daniel Scalzi cf6ffb3334
Icons don't need translation. 2023-10-05 14:49:06 -04:00
Daniel Scalzi d88a1f7224
Checkbox does not require translation. 2023-10-05 14:42:53 -04:00
Daniel Scalzi 0158fc8504
Remove another placeholder. 2023-10-05 14:35:08 -04:00
Daniel Scalzi 8941198fc0
Reduce package lock diff. 2023-10-05 14:29:04 -04:00
Daniel Scalzi 9aeb38db84
Update 2023-10-05 14:26:25 -04:00
12 changed files with 3995 additions and 4035 deletions

View File

@ -33,9 +33,6 @@ exports.queryEJS = function(id, placeHolders){
}
exports.setupLanguage = function(){
// Load a Placeholder Language File for texts that do not require translation
exports.loadLanguage('_placeholder')
// Load Language Files
exports.loadLanguage('en_US')
// Uncomment this when translations are ready

View File

@ -165,14 +165,14 @@ function updateSelectedServer(serv){
}
ConfigManager.setSelectedServer(serv != null ? serv.rawServer.id : null)
ConfigManager.save()
server_selection_button.innerHTML = Lang.queryJS('landing.selectedServer.icon') + (serv != null ? serv.rawServer.name : Lang.queryJS('landing.noSelection'))
server_selection_button.innerHTML = '• ' + (serv != null ? serv.rawServer.name : Lang.queryJS('landing.noSelection'))
if(getCurrentView() === VIEWS.settings){
animateSettingsTabRefresh()
}
setLaunchEnabled(serv != null)
}
// Real text is set in uibinder.js on distributionIndexDone.
server_selection_button.innerHTML = Lang.queryJS('landing.selectedServer.icon') + Lang.queryJS('landing.selectedServer.loading')
server_selection_button.innerHTML = '• ' + Lang.queryJS('landing.selectedServer.loading')
server_selection_button.onclick = async e => {
e.target.blur()
await toggleServerSelection(true)
@ -202,7 +202,7 @@ const refreshMojangStatuses = async function(){
const service = statuses[i]
const tooltipHTML = `<div class="mojangStatusContainer">
<span class="mojangStatusIcon" style="color: ${MojangRestAPI.statusToHex(service.status)};">${Lang.queryJS('landing.mojangStatus.icon')}</span>
<span class="mojangStatusIcon" style="color: ${MojangRestAPI.statusToHex(service.status)};">&#8226;</span>
<span class="mojangStatusName">${service.name}</span>
</div>`
if(service.essential){
@ -953,7 +953,7 @@ function displayArticle(articleObject, index){
text.style.display = text.style.display === 'block' ? 'none' : 'block'
}
})
newsNavigationStatus.innerHTML = index + ' of ' + newsArr.length
newsNavigationStatus.innerHTML = Lang.query('ejs.landing.newsNavigationStatus', {currentPage: index, totalPages: newsArr.length})
newsContent.setAttribute('article', index-1)
}

View File

@ -9,7 +9,6 @@ const { Type } = require('helios-distribution-types')
const AuthManager = require('./assets/js/authmanager')
const ConfigManager = require('./assets/js/configmanager')
const { DistroAPI } = require('./assets/js/distromanager')
const Lang = require('./assets/js/langloader')
let rscShouldLoad = false
let fatalStartupError = false

View File

@ -10,6 +10,7 @@ const {ipcRenderer, shell, webFrame} = require('electron')
const remote = require('@electron/remote')
const isDev = require('./assets/js/isdev')
const { LoggerUtil } = require('helios-core')
const Lang = require('./assets/js/langloader')
const loggerUICore = LoggerUtil.getLogger('UICore')
const loggerAutoUpdater = LoggerUtil.getLogger('AutoUpdater')

View File

@ -1,19 +0,0 @@
# Placeholder Language File for texts that do not require translation
[ejs.landing]
newsArticleTitle = "Lorem Ipsum"
newsArticleDate = "Mar 15, 44 BC, 9:14 AM"
newsArticleAuthor = "by Cicero"
newsArticleComments = "0 Comments"
[ejs.overlay]
overlayTitle = "Lorem Ipsum:<br>Finis Illud"
overlayDesc = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud.."
overlayAcknowledge = "Conare Iterum"
overlayDismiss = "Dismiss"
[ejs.settings]
versionValue = "0.0.1-alpha.18"
memoryTotalValue = "16G"
memoryAvailableValue = "7.3G"
javaExecVal = "null"

View File

@ -6,22 +6,19 @@ settingsTooltip = "Settings"
serverStatus = "SERVER"
serverStatusPlaceholder = "OFFLINE"
mojangStatus = "MOJANG STATUS"
mojangStatusIcon = "&#8226;"
mojangStatusTooltipTitle = "Services"
mojangStatusNETitle = "Non&nbsp;Essential"
newsButton = "NEWS"
launchButton = "PLAY"
launchButtonPlaceholder = "&#8226; No Server Selected"
launchProgressLabel = "0%"
launchDetails = "Please wait.."
newsNavigationStatus = "1 of 1"
newsNavigationStatus = "{currentPage} of {totalPages}"
newsErrorLoadSpan = "Checking for News.."
newsErrorFailedSpan = "Failed to Load News"
newsErrorRetryButton = "Try Again"
newsErrorNoneSpan = "No News"
[ejs.login]
loginCancelIcon = "X"
loginCancelText = "Cancel"
loginSubheader = "MINECRAFT LOGIN"
loginEmailError = "* Invalid Value"
@ -35,7 +32,7 @@ loginButtonText = "LOGIN"
loginNeedAccountLink = "https://minecraft.net/store/minecraft-java-edition/"
loginNeedAccountText = "Need an Account?"
loginPasswordDisclaimer1 = "Your password is sent directly to mojang and never stored."
loginPasswordDisclaimer2 = "<%= lang('app.title') %> is not affiliated with Mojang AB."
loginPasswordDisclaimer2 = "{appName} is not affiliated with Mojang AB."
[ejs.loginOptions]
loginOptionsTitle = "Login Options"
@ -70,7 +67,6 @@ addMojangAccount = "+ Add Mojang Account"
minecraftTabHeaderText = "Minecraft Settings"
minecraftTabHeaderDesc = "Options related to game launch."
gameResolutionTitle = "Game Resolution"
gameResolutionCross = "&#10006;"
launchFullscreenTitle = "Launch in fullscreen."
autoConnectTitle = "Automatically connect to the server on launch."
launchDetachedTitle = "Launch game process detached from launcher."
@ -85,7 +81,6 @@ addMods = "Add Mods"
dropinRefreshNote = "(F5 to Refresh)"
shaderpacks = "Shaderpacks"
shaderpackDesc = "Enable or disable shaders. Please note, shaders will only run smoothly on powerful setups. You may add custom packs here."
shaderpackButton = " + "
selectShaderpack = "Select Shaderpack"
tabJavaHeaderText = "Java Settings"
tabJavaHeaderDesc = "Manage the Java configuration (advanced)."
@ -96,16 +91,12 @@ memoryDesc = "The recommended minimum RAM is 3 gigabytes. Setting the minimum an
memoryTotalTitle = "Total"
memoryAvailableTitle = "Available"
javaExecutableTitle = "Java Executable"
javaExecDetails = "Selected: Java 8 Update 172 (x64)"
javaExecSelDialogTitle = "Select Java Executable"
javaExecSelButtonText = "Choose File"
javaExecDesc = "The Java executable is validated before game launch."
javaReqDesc = "Requires Java 8 x64."
javaPathDesc = "The path should end with <strong>{pathSuffix}</strong>."
jvmOptsTitle = "Additional JVM Options"
jvmOptsDesc = "Options to be provided to the JVM at runtime. <em>-Xms</em> and <em>-Xmx</em> should not be included."
jvmOptsLink = "https://docs.oracle.com/javase/8/docs/technotes/tools/<%= process.platform === 'win32' ? 'windows' : 'unix' %>/java.html"
jvmOptsLinkText = "Available Options for Java 8."
launcherTabHeaderText = "Launcher Settings"
launcherTabHeaderDesc = "Options related to the launcher itself."
allowPrereleaseTitle = "Allow Pre-Release Updates."
@ -116,9 +107,7 @@ chooseFolder = "Choose Folder"
dataDirectoryDesc = "All game files and local Java installations will be stored in the data directory.<br>Screenshots and world saves are stored in the instance folder for the corresponding server configuration."
aboutTabHeaderText = "About"
aboutTabHeaderDesc = "View information and release notes for the current version."
aboutTitle = "<%= lang('app.title') %>"
aboutCurrentVersionCheck = "Stable Release"
versionCheck = "&#10003;"
aboutTitle = "{appName}"
stableRelease = "Stable Release"
versionText = "Version "
sourceGithub = "Source (GitHub)"
@ -130,7 +119,6 @@ noReleaseNotes = "No Release Notes"
viewReleaseNotes = "View Release Notes on GitHub"
launcherUpdatesHeaderText = "Launcher Updates"
launcherUpdatesHeaderDesc = "Download, install, and review updates for the launcher."
latestVersion = "You Are Running the Latest Version"
checkForUpdates = "Check for Updates"
whatsNew = "What's New"
updateReleaseNotes = "Update Release Notes"
@ -166,13 +154,9 @@ okay = "Okay"
noAccountSelected = "No Account Selected"
[js.landing.selectedServer]
icon = "• "
noSelection = "No Server Selected"
loading = "Loading.."
[js.landing.mojangStatus]
icon = "&#8226;"
[js.landing.serverStatus]
server = "SERVER"
offline = "OFFLINE"

View File

@ -102,7 +102,7 @@
<div class="bot_divider"></div>
<div id="mojangStatusWrapper">
<span class="bot_label"><%- lang('landing.mojangStatus') %></span>
<span id="mojang_status_icon"><%- lang('landing.mojangStatusIcon') %></span>
<span id="mojang_status_icon">&#8226;</span>
<div id="mojangStatusTooltip">
<div id="mojangStatusTooltipTitle"><%- lang('landing.mojangStatusTooltipTitle') %></div>
<div id="mojangStatusEssentialContainer">
@ -147,7 +147,7 @@
</div>
<div id="launch_details">
<div id="launch_details_left">
<span id="launch_progress_label"><%- lang('landing.launchProgressLabel') %></span>
<span id="launch_progress_label">0%</span>
<div class="bot_divider"></div>
</div>
<div id="launch_details_right">
@ -163,16 +163,16 @@
<div id="newsStatusContainer">
<div id="newsStatusContent">
<div id="newsTitleContainer">
<a id="newsArticleTitle" href="#"><%- lang('landing.newsArticleTitle') %></a>
<a id="newsArticleTitle" href="#">Lorem Ipsum</a>
</div>
<div id="newsMetaContainer">
<div id="newsArticleDateWrapper">
<span id="newsArticleDate"><%- lang('landing.newsArticleDate') %></span>
<span id="newsArticleDate">Mar 15, 44 BC, 9:14 AM</span>
</div>
<div id="newsArticleAuthorWrapper">
<span id="newsArticleAuthor"><%- lang('landing.newsArticleAuthor') %></span>
<span id="newsArticleAuthor">by Cicero</span>
</div>
<a href="#" id="newsArticleComments"><%- lang('landing.newsArticleComments') %></a>
<a href="#" id="newsArticleComments">0 Comments</a>
</div>
</div>
<div id="newsNavigationContainer">
@ -184,7 +184,7 @@
<polyline class="arrowLine" points="0.71 13.26 12.56 1.41 24.16 13.02"/>
</svg>
</button>
<span id="newsNavigationStatus"><%- lang('landing.newsNavigationStatus') %></span>
<span id="newsNavigationStatus"><%- lang('landing.newsNavigationStatus', { currentPage: 1, totalPages: 1 }) %></span>
<button id="newsNavigateRight">
<svg id="newsNavigationRightSVG" viewBox="0 0 24.87 13.97">
<defs>

View File

@ -1,7 +1,7 @@
<div id="loginContainer" style="display: none;">
<div id="loginCancelContainer" style="display: none;">
<button id="loginCancelButton">
<div id="loginCancelIcon"><%- lang('login.loginCancelIcon') %></div>
<div id="loginCancelIcon">X</div>
<span id="loginCancelText"><%- lang('login.loginCancelText') %></span>
</button>
</div>
@ -57,7 +57,7 @@
<a href="<%- lang('login.loginNeedAccountLink') %>"><%- lang('login.loginNeedAccountText') %></a>
</span>
<p class="loginDisclaimerText"><%- lang('login.loginPasswordDisclaimer1') %></p>
<p class="loginDisclaimerText"><%- lang('login.loginPasswordDisclaimer2') %></p>
<p class="loginDisclaimerText"><%- lang('login.loginPasswordDisclaimer2', { appName: lang('app.title') }) %></p>
</div>
</form>
</div>

View File

@ -28,12 +28,12 @@
</div>
</div>
<div id="overlayContent">
<span id="overlayTitle"><%- lang('overlay.overlayTitle') %></span>
<span id="overlayDesc"><%- lang('overlay.overlayDesc') %></span>
<span id="overlayTitle">Lorem Ipsum:<br>Finis Illud</span>
<span id="overlayDesc">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud..</span>
<div id="overlayActionContainer">
<button id="overlayAcknowledge" class="overlayKeybindEnter"><%- lang('overlay.overlayAcknowledge') %></button>
<button id="overlayAcknowledge" class="overlayKeybindEnter">Conare Iterum</button>
<div id="overlayDismissWrapper">
<button id="overlayDismiss" style="display: none;" class="overlayKeybindEsc"><%- lang('overlay.overlayDismiss') %></button>
<button id="overlayDismiss" style="display: none;" class="overlayKeybindEsc">Dismiss</button>
</div>
</div>
</div>

View File

@ -78,7 +78,7 @@
<span class="settingsFieldTitle"><%- lang('settings.gameResolutionTitle') %></span>
<div id="settingsGameResolutionContent">
<input type="number" id="settingsGameWidth" min="0" cValue="GameWidth">
<div id="settingsGameResolutionCross"><%- lang('settings.gameResolutionCross') %></div>
<div id="settingsGameResolutionCross">&#10006;</div>
<input type="number" id="settingsGameHeight" min="0" cValue="GameHeight">
</div>
</div>
@ -156,7 +156,7 @@
<div class="settingsModsHeader"><%- lang('settings.shaderpacks') %></div>
<div id="settingsShaderpackDesc"><%- lang('settings.shaderpackDesc') %></div>
<div id="settingsShaderpackWrapper">
<button id="settingsShaderpackButton"><%- lang('settings.shaderpackButton') %></button>
<button id="settingsShaderpackButton"> + </button>
<div class="settingsSelectContainer">
<div class="settingsSelectSelected" id="settingsShadersSelected"><%- lang('settings.selectShaderpack') %></div>
<div class="settingsSelectOptions" id="settingsShadersOptions" hidden>
@ -212,11 +212,11 @@
<div id="settingsMemoryStatus">
<div class="settingsMemoryStatusContainer">
<span class="settingsMemoryStatusTitle"><%- lang('settings.memoryTotalTitle') %></span>
<span id="settingsMemoryTotal" class="settingsMemoryStatusValue"><%- lang('settings.memoryTotalValue') %></span>
<span id="settingsMemoryTotal" class="settingsMemoryStatusValue">16G</span>
</div>
<div class="settingsMemoryStatusContainer">
<span class="settingsMemoryStatusTitle"><%- lang('settings.memoryAvailableTitle') %></span>
<span id="settingsMemoryAvail" class="settingsMemoryStatusValue"><%- lang('settings.memoryAvailableValue') %></span>
<span id="settingsMemoryAvail" class="settingsMemoryStatusValue">7.3G</span>
</div>
</div>
</div>
@ -225,7 +225,7 @@
<div class="settingsFileSelContainer">
<div class="settingsFileSelTitle"><%- lang('settings.javaExecutableTitle') %></div>
<div class="settingsFileSelContent">
<div id="settingsJavaExecDetails"><%- lang('settings.javaExecDetails') %></div>
<div id="settingsJavaExecDetails"><!-- Invalid Selection --></div>
<div class="settingsFileSelActions">
<div class="settingsFileSelIcon">
<svg class="settingsFileSelSVG" x="0px" y="0px" viewBox="0 0 305.001 305.001">
@ -241,11 +241,11 @@
</g>
</svg>
</div>
<input class="settingsFileSelVal" id="settingsJavaExecVal" type="text" value="<%- lang('settings.javaExecVal') %>" cValue="JavaExecutable" serverDependent disabled>
<input class="settingsFileSelVal" id="settingsJavaExecVal" type="text" value="null" cValue="JavaExecutable" serverDependent disabled>
<button class="settingsFileSelButton" id="settingsJavaExecSel" dialogTitle="<%- lang('settings.javaExecSelDialogTitle') %>" dialogDirectory="false"><%- lang('settings.javaExecSelButtonText') %></button>
</div>
</div>
<div class="settingsFileSelDesc"><%- lang('settings.javaExecDesc') %> <strong id="settingsJavaReqDesc"><%- lang('settings.javaReqDesc') %></strong><br><%- lang('settings.javaPathDesc', {'pathSuffix': `bin${process.platform === 'win32' ? '\\javaw.exe' : '/java'}`}) %></div>
<div class="settingsFileSelDesc"><%- lang('settings.javaExecDesc') %> <strong id="settingsJavaReqDesc"><!-- Requires Java 8 x64. --></strong><br><%- lang('settings.javaPathDesc', {'pathSuffix': `bin${process.platform === 'win32' ? '\\javaw.exe' : '/java'}`}) %></div>
</div>
<div id="settingsJVMOptsContainer">
<div id="settingsJVMOptsTitle"><%- lang('settings.jvmOptsTitle') %></div>
@ -266,7 +266,7 @@
</div>
<input id="settingsJVMOptsVal" cValue="JVMOptions" serverDependent type="text">
</div>
<div id="settingsJVMOptsDesc"><%- lang('settings.jvmOptsDesc') %><br><a href="<%- lang('settings.jvmOptsLink') %>" id="settingsJvmOptsLink"><%- lang('settings.jvmOptsLinkText') %></a></div>
<div id="settingsJVMOptsDesc"><%- lang('settings.jvmOptsDesc') %><br><a href="#" id="settingsJvmOptsLink"><!-- Available Options --></a></div>
</div>
</div>
<div id="settingsTabLauncher" class="settingsTab" style="display: none;">
@ -315,15 +315,15 @@
<div id="settingsAboutCurrentContent">
<div id="settingsAboutCurrentHeadline">
<img id="settingsAboutLogo" src="./assets/images/SealCircle.png">
<span id="settingsAboutTitle"><%- lang('settings.aboutTitle') %></span>
<span id="settingsAboutTitle"><%- lang('settings.aboutTitle', { appName: lang('app.title') }) %></span>
</div>
<div id="settingsAboutCurrentVersion">
<div id="settingsAboutCurrentVersionCheck"><%- lang('settings.versionCheck') %></div>
<div id="settingsAboutCurrentVersionCheck">&#10003;</div>
<div id="settingsAboutCurrentVersionDetails">
<span id="settingsAboutCurrentVersionTitle"><%- lang('settings.stableRelease') %></span>
<div id="settingsAboutCurrentVersionLine">
<span id="settingsAboutCurrentVersionText"><%- lang('settings.versionText') %></span>
<span id="settingsAboutCurrentVersionValue"><%- lang('settings.versionValue') %></span>
<span id="settingsAboutCurrentVersionValue">0.0.1-alpha.18</span>
</div>
</div>
</div>
@ -359,15 +359,15 @@
<div id="settingsUpdateStatusContainer">
<div id="settingsUpdateStatusContent">
<div id="settingsUpdateStatusHeadline">
<span id="settingsUpdateTitle"><%- lang('settings.latestVersion') %></span>
<span id="settingsUpdateTitle"><!-- You Are Running the Latest Version --></span>
</div>
<div id="settingsUpdateVersion">
<div id="settingsUpdateVersionCheck"><%- lang('settings.versionCheck') %></div>
<div id="settingsUpdateVersionCheck">&#10003;</div>
<div id="settingsUpdateVersionDetails">
<span id="settingsUpdateVersionTitle"><%- lang('settings.stableRelease') %></span>
<div id="settingsUpdateVersionLine">
<span id="settingsUpdateVersionText"><%- lang('settings.versionText') %> </span>
<span id="settingsUpdateVersionValue"><%- lang('settings.versionValue') %></span>
<span id="settingsUpdateVersionValue">0.0.1-alpha.18</span>
</div>
</div>
</div>

View File

@ -4,7 +4,6 @@ remoteMain.initialize()
// Requirements
const { app, BrowserWindow, ipcMain, Menu, shell } = require('electron')
const autoUpdater = require('electron-updater').autoUpdater
const ejs = require('ejs')
const ejse = require('ejs-electron')
const fs = require('fs')
const isDev = require('./app/assets/js/isdev')
@ -243,8 +242,7 @@ function createWindow() {
const data = {
bkid: Math.floor((Math.random() * fs.readdirSync(path.join(__dirname, 'app', 'assets', 'images', 'backgrounds')).length)),
lang: (str) => ejs.render(LangLoader.queryEJS(str), data),
evalEjs: (str) => ejs.render(str, data)
lang: (str, placeHolders) => LangLoader.queryEJS(str, placeHolders)
}
Object.entries(data).forEach(([key, val]) => ejse.data(key, val))

7918
package-lock.json generated

File diff suppressed because it is too large Load Diff