diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2025-02-24 14:23:20 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-24 05:23:20 +0000 |
| commit | 1b44954dcbca4c1d71f04ee384db8812811126c6 (patch) | |
| tree | 2e23b643ddcdadfa225328ea9a3a66b61a5e7506 /packages/backend/src/server/web/error.js | |
| parent | fix(deps): update [frontend] update dependencies (#15542) (diff) | |
| download | misskey-1b44954dcbca4c1d71f04ee384db8812811126c6.tar.gz misskey-1b44954dcbca4c1d71f04ee384db8812811126c6.tar.bz2 misskey-1b44954dcbca4c1d71f04ee384db8812811126c6.zip | |
enhance(frontend): サーバーエラー画面の多言語対応 (#15549)
* enhance(frontend): サーバーエラー画面の多言語対応
* indent
Diffstat (limited to 'packages/backend/src/server/web/error.js')
| -rw-r--r-- | packages/backend/src/server/web/error.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/packages/backend/src/server/web/error.js b/packages/backend/src/server/web/error.js new file mode 100644 index 0000000000..4838dd6ef3 --- /dev/null +++ b/packages/backend/src/server/web/error.js @@ -0,0 +1,40 @@ +/* + * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-License-Identifier: AGPL-3.0-only + */ + +'use strict'; + +(() => { + document.addEventListener('DOMContentLoaded', () => { + const locale = JSON.parse(localStorage.getItem('locale') || '{}'); + + const messages = Object.assign({ + title: 'Failed to initialize Misskey', + serverError: 'If reloading after a period of time does not resolve the problem, contact the server administrator with the following ERROR ID.', + 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'; + + const reloadEls = document.querySelectorAll('[data-i18n-reload]'); + for (const el of reloadEls) { + el.textContent = reload; + } + + const i18nEls = document.querySelectorAll('[data-i18n]'); + for (const el of i18nEls) { + const key = el.dataset.i18n; + if (key && messages[key]) { + el.textContent = messages[key]; + } + } + }); +})(); |