From 4b98b446bee6eefb05141d6d400271ba131e709d Mon Sep 17 00:00:00 2001
From: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Sat, 8 Feb 2025 17:31:28 +0900
Subject: enhance(frontend): クライアントエラー画面の多言語対応 (#15411)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* enhance(frontend): クライアントエラー画面のマルチリンガル対応
* Update Changelog
* update message
---
packages/backend/src/server/web/boot.js | 38 +++++++++++++++++++++++----------
1 file changed, 27 insertions(+), 11 deletions(-)
(limited to 'packages/backend/src/server/web/boot.js')
diff --git a/packages/backend/src/server/web/boot.js b/packages/backend/src/server/web/boot.js
index a04640d993..b55d327f86 100644
--- a/packages/backend/src/server/web/boot.js
+++ b/packages/backend/src/server/web/boot.js
@@ -151,6 +151,22 @@
await new Promise(resolve => window.addEventListener('DOMContentLoaded', resolve));
}
+ const locale = JSON.parse(localStorage.getItem('locale') || '{}');
+
+ const messages = Object.assign({
+ title: 'Failed to initialize Misskey',
+ solution: 'The following actions may solve the problem.',
+ solution1: 'Update your os and browser',
+ solution2: 'Disable an adblocker',
+ solution3: 'Clear the browser cache',
+ solution4: '(Tor Browser) Set dom.webaudio.enabled to true',
+ otherOption: 'Other options',
+ otherOption1: 'Clear preferences and cache',
+ otherOption2: 'Start the simple client',
+ otherOption3: 'Start the repair tool',
+ }, locale?._bootErrors || {});
+ const reload = locale?.reload || 'Reload';
+
let errorsElement = document.getElementById('errors');
if (!errorsElement) {
@@ -160,32 +176,32 @@
The following actions may solve the problem. / 以下を行うと解決する可能性があります。
-Update your os and browser / ブラウザおよびOSを最新バージョンに更新する
-Disable an adblocker / アドブロッカーを無効にする
-Clear the browser cache / ブラウザのキャッシュをクリアする
-(Tor Browser) Set dom.webaudio.enabled to true / dom.webaudio.enabledをtrueに設定する
+${messages.solution}
+${messages.solution1}
+${messages.solution2}
+${messages.solution3}
+${messages.solution4}