summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/web/boot.js
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2025-02-08 17:31:28 +0900
committerGitHub <noreply@github.com>2025-02-08 08:31:28 +0000
commit4b98b446bee6eefb05141d6d400271ba131e709d (patch)
tree4ce46d87f5ad1a7364fdfe75e431f79a27fcef30 /packages/backend/src/server/web/boot.js
parentfix(dev): devcontainerのcorepackのバージョンを指定するように (... (diff)
downloadmisskey-4b98b446bee6eefb05141d6d400271ba131e709d.tar.gz
misskey-4b98b446bee6eefb05141d6d400271ba131e709d.tar.bz2
misskey-4b98b446bee6eefb05141d6d400271ba131e709d.zip
enhance(frontend): クライアントエラー画面の多言語対応 (#15411)
* enhance(frontend): クライアントエラー画面のマルチリンガル対応 * Update Changelog * update message
Diffstat (limited to 'packages/backend/src/server/web/boot.js')
-rw-r--r--packages/backend/src/server/web/boot.js38
1 files changed, 27 insertions, 11 deletions
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 @@
<path d="M12 9v2m0 4v.01"></path>
<path d="M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75"></path>
</svg>
- <h1>Failed to load<br>読み込みに失敗しました</h1>
+ <h1>${messages.title}</h1>
<button class="button-big" onclick="location.reload(true);">
- <span class="button-label-big">Reload / リロード</span>
+ <span class="button-label-big">${reload}</span>
</button>
- <p><b>The following actions may solve the problem. / 以下を行うと解決する可能性があります。</b></p>
- <p>Update your os and browser / ブラウザおよびOSを最新バージョンに更新する</p>
- <p>Disable an adblocker / アドブロッカーを無効にする</p>
- <p>Clear the browser cache / ブラウザのキャッシュをクリアする</p>
- <p>&#40;Tor Browser&#41; Set dom.webaudio.enabled to true / dom.webaudio.enabledをtrueに設定する</p>
+ <p><b>${messages.solution}</b></p>
+ <p>${messages.solution1}</p>
+ <p>${messages.solution2}</p>
+ <p>${messages.solution3}</p>
+ <p>${messages.solution4}</p>
<details style="color: #86b300;">
- <summary>Other options / その他のオプション</summary>
+ <summary>${messages.otherOption}</summary>
<a href="/flush">
<button class="button-small">
- <span class="button-label-small">Clear preferences and cache</span>
+ <span class="button-label-small">${messages.otherOption1}</span>
</button>
</a>
<br>
<a href="/cli">
<button class="button-small">
- <span class="button-label-small">Start the simple client</span>
+ <span class="button-label-small">${messages.otherOption2}</span>
</button>
</a>
<br>
<a href="/bios">
<button class="button-small">
- <span class="button-label-small">Start the repair tool</span>
+ <span class="button-label-small">${messages.otherOption3}</span>
</button>
</a>
</details>