Skip to content
Merged
4 changes: 2 additions & 2 deletions electron/main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ function createSplashWindow() {
show: false,
skipTaskbar: false,
backgroundColor: '#101116',
title: 'SOCDOF wird gestartet',
title: 'Starting SOCDOF',
icon: process.platform === 'win32'
? path.join(__dirname, '../public/socdof_icon.ico')
: path.join(__dirname, '../public/socdof_icon.png'),
webPreferences: { contextIsolation: true, nodeIntegration: false, sandbox: true }
webPreferences: { preload: path.join(__dirname, 'preload.cjs'), contextIsolation: true, nodeIntegration: false, sandbox: true }
});
splashWindow.once('ready-to-show', () => {
if (splashWindow && !splashWindow.isDestroyed()) splashWindow.show();
Expand Down
35 changes: 33 additions & 2 deletions electron/splash.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,40 @@
<main>
<img class="logo" src="../public/socdof_icon.png" alt="">
<h1>SOCDOF</h1>
<p>Der Arbeitsbereich wird vorbereitet …</p>
<div class="track" role="progressbar" aria-label="SOCDOF wird gestartet"><div class="bar"></div></div>
<p id="startup-message">Preparing your workspace...</p>
<div class="track" role="progressbar" aria-label="Starting SOCDOF"><div class="bar"></div></div>
<div class="footer">Strudelcode · Yuri / Strudel</div>
</main>
<script>
(async () => {
const messages = {
en: 'Preparing your workspace...',
de: 'Arbeitsbereich wird vorbereitet...',
fr: 'Préparation de votre espace de travail...',
es: 'Preparando tu espacio de trabajo...'
};
let language = 'en';
// First launch defaults to English. Prefer the app's persisted Electron preference on later launches.
try {
const prefs = window.electronAPI && typeof window.electronAPI.getPreferences === 'function'
? await window.electronAPI.getPreferences()
: null;
const saved = prefs && (prefs.language || prefs.locale);
if (saved && Object.prototype.hasOwnProperty.call(messages, saved)) {
language = saved;
} else {
const localSaved = localStorage.getItem('socdof_language');
if (localSaved && Object.prototype.hasOwnProperty.call(messages, localSaved)) language = localSaved;
}
} catch (_) {
try {
const saved = localStorage.getItem('socdof_language');
if (saved && Object.prototype.hasOwnProperty.call(messages, saved)) language = saved;
} catch (_) {}
}
document.documentElement.lang = language;
document.getElementById('startup-message').textContent = messages[language];
})();
</script>
</body>
</html>
Loading
Loading