diff --git a/src/page/index.ejs b/src/page/index.ejs index 045e9219833..11dcf694126 100644 --- a/src/page/index.ejs +++ b/src/page/index.ejs @@ -24,7 +24,71 @@ -
+
+ + +
+
+
+
+
+ + diff --git a/src/page/loader.js b/src/page/loader.js new file mode 100644 index 00000000000..d53031205b3 --- /dev/null +++ b/src/page/loader.js @@ -0,0 +1,44 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +const HALF_MINUTE_IN_MS = 30000; + +const translations = { + de: `

Laden von Wire dauert länger als erwartet.

Bitte überprüfen Sie Ihre Internetverbindung.

`, + en: `

Loading Wire takes longer than expected.

Please check your internet connection.

`, +}; + +const userLang = navigator.language; + +setTimeout(() => { + const loadingMessage = document.getElementById('loading-message'); + + if (!loadingMessage) { + return; + } + + // TODO: If there will be more translations, we have to change this functionality.. + if (userLang.startsWith('de')) { + loadingMessage.innerHTML = translations['de']; + } else { + loadingMessage.innerHTML = translations['en']; + } + + loadingMessage.classList.add('visible'); +}, HALF_MINUTE_IN_MS); diff --git a/webpack.config.common.js b/webpack.config.common.js index 3a01d5ba651..e299a76cef1 100644 --- a/webpack.config.common.js +++ b/webpack.config.common.js @@ -162,6 +162,7 @@ module.exports = { {from: 'resource', to: dist}, {from: `assets`, to: `${dist}/assets`}, {from: 'src/page/basicBrowserFeatureCheck.js', to: `${dist}/min/`}, + {from: 'src/page/loader.js', to: `${dist}/min/`}, ], }), new webpack.IgnorePlugin({resourceRegExp: /.*\.wasm/}),