diff --git a/locales/index.d.ts b/locales/index.d.ts index d8eb90f4e5..8211827d64 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -11004,6 +11004,40 @@ export interface Locale extends ILocale { * Show warning when opening external URLs */ "warnExternalUrl": string; + "_flash": { + /** + * Flash Content Hidden + */ + "contentHidden": string; + /** + * Powered by Ruffle. + */ + "poweredByRuffle": string; + /** + * Always be wary of arbitrary code execution! + */ + "arbitraryCodeExecutionWarning": string; + /** + * Flash Content Failed To Load: + */ + "failedToLoad": string; + /** + * Flash Content Is Loading + */ + "isLoading": string; + /** + * Loading Ruffle player + */ + "loadingRufflePlayer": string; + /** + * Loading Flash file + */ + "loadingFlashFile": string; + /** + * raw.esm.sh could not be accessed, meaning this instance's Content Security Policy is likely out of date. Please contact your instance administrators. + */ + "cspError": string; + }; "_mfm": { /** * This is not a widespread feature, it may not display properly on most other fedi software, including other Misskey forks diff --git a/packages/frontend/src/components/SkFlashPlayer.vue b/packages/frontend/src/components/SkFlashPlayer.vue index 4d192b20f6..9864120e3e 100644 --- a/packages/frontend/src/components/SkFlashPlayer.vue +++ b/packages/frontend/src/components/SkFlashPlayer.vue @@ -14,17 +14,17 @@ SPDX-License-Identifier: AGPL-3.0-only
- Flash Content Hidden - Powered by Ruffle. - Always be wary of arbitrary code execution! + {{ i18n.ts._flash.contentHidden }} + {{ i18n.ts._flash.poweredByRuffle }} + {{ i18n.ts._flash.arbitraryCodeExecutionWarning }} {{ i18n.ts.clickToShow }}
- Flash Content Failed To Load: + {{ i18n.ts._flash.failedToLoad }} {{ ruffleError }}
- Flash Content Is Loading + {{ i18n.ts._flash.isLoading }}

{{ loadingStatus }}

@@ -100,7 +100,7 @@ function handleError(error: unknown) { */ async function loadRuffle() { if (window.RufflePlayer !== undefined) return; - loadingStatus.value = 'Loading Ruffle player'; + loadingStatus.value = i18n.ts._flash.loadingRufflePlayer; await import('@ruffle-rs/ruffle'); // Assumption: this will throw if esm.sh has a hiccup or something. If not, the next undefined check will catch it. window.RufflePlayer = window.RufflePlayer as PublicAPILike | PublicAPI | undefined; // Assert unknown type due to side effects if (window.RufflePlayer === undefined) throw Error('esm.sh has shit itself, but not in an expected way (has esm.sh permanently shut down? how close is the heat death of the universe?)'); @@ -169,7 +169,7 @@ function createPlayer() { function loadContent() { if (player.value === undefined) throw Error('Player is uninitialized.'); ruffleContainer.value?.appendChild(player.value); - loadingStatus.value = 'Loading Flash file'; + loadingStatus.value = i18n.ts._flash.loadingFlashFile; player.value.load(url.value).then(() => { loadingStatus.value = undefined; }).catch(error => { @@ -179,7 +179,7 @@ function loadContent() { handleError(error); // Unexpected error }).catch(() => { // Must be CSP because esm.sh should be online if `loadRuffle()` didn't fail - handleError('raw.esm.sh could not be accessed, meaning this instance\'s Content Security Policy is likely out of date. Please contact your instance administrators.'); + handleError(i18n.ts._flash.cspError); }); }); } diff --git a/sharkey-locales/en-US.yml b/sharkey-locales/en-US.yml index 1f9b6ef4f5..75b6fc3537 100644 --- a/sharkey-locales/en-US.yml +++ b/sharkey-locales/en-US.yml @@ -156,6 +156,15 @@ allowClickingNotifications: "Allow clicking on pop-up notifications" pinnedOnly: "Pinned" blockingYou: "Blocking you" warnExternalUrl: "Show warning when opening external URLs" +_flash: + contentHidden: "Flash Content Hidden" + poweredByRuffle: "Powered by Ruffle." + arbitraryCodeExecutionWarning: "Always be wary of arbitrary code execution!" + failedToLoad: "Flash Content Failed To Load:" + isLoading: "Flash Content Is Loading" + loadingRufflePlayer: "Loading Ruffle player" + loadingFlashFile: "Loading Flash file" + cspError: "raw.esm.sh could not be accessed, meaning this instance's Content Security Policy is likely out of date. Please contact your instance administrators." _delivery: stop: "Suspend delivery" resume: "Resume delivery" diff --git a/sharkey-locales/ja-JP.yml b/sharkey-locales/ja-JP.yml index 0977a2e564..22bd5235ca 100644 --- a/sharkey-locales/ja-JP.yml +++ b/sharkey-locales/ja-JP.yml @@ -142,6 +142,15 @@ sensitiveMediaRevealConfirm: "センシティブなメディアです。表示 severAllFollowRelations: "以下の関係をすべて断ち切る" severAllFollowRelationsConfirm: "すべての人間関係を壊す?これは不可逆です!これは{instanceName}の{followingCount}フォローと{followersCount}フォロワーの関係を壊す!" severAllFollowRelationsQueued: "キューに入れられた{host}とのすべてのフォロー関係を切断する。" +_flash: + contentHidden: "Flashコンテンツ非表示" + poweredByRuffle: "Powered by Ruffle." # Doesn't need a translation, apparently. + arbitraryCodeExecutionWarning: "任意コード実行にご注意!" + failedToLoad: "Flashコンテンツ読込に失敗" + isLoading: "Flashコンテンツ読込中" + loadingRufflePlayer: "Ruffleプレイヤー読込中" + loadingFlashFile: "Flashファイル読込中" + cspError: "raw.esm.shにアクセスできませんでした。このサーバーのコンテンツセキュリティポリシー(CSP) が廃止されている可能性があり、サーバー管理者に連絡してください。" _delivery: stop: "配信停止" resume: "配信再開"