diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 598b888c36..2764a85abb 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -915,6 +915,7 @@ windowRestore: "元に戻す" caption: "キャプション" loggedInAsBot: "Botアカウントでログイン中" tools: "ツール" +cannotLoad: "読み込めません" _sensitiveMediaDetection: description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てることができます。サーバーの負荷が少し増えます。" diff --git a/packages/frontend/src/components/MkUrlPreview.vue b/packages/frontend/src/components/MkUrlPreview.vue index 8ebfbe58e8..f8484e38a5 100644 --- a/packages/frontend/src/components/MkUrlPreview.vue +++ b/packages/frontend/src/components/MkUrlPreview.vue @@ -7,22 +7,26 @@
- - -
-
-
-
-

{{ title }}

-
-

{{ description.length > 85 ? description.slice(0, 85) + '…' : description }}

-
- -

{{ sitename }}

-
-
-
-
+ +
+
+
+
+

{{ url }}

+

+

{{ title }}

+
+

{{ i18n.ts.cannotLoad }}

+

+

{{ description.length > 85 ? description.slice(0, 85) + '…' : description }}

+
+ +

?

+

+

{{ sitename }}

+
+
+
{{ i18n.ts.expandTweet }} @@ -78,6 +82,7 @@ let tweetId = $ref(null); let tweetExpanded = $ref(props.detail); const embedId = `embed${Math.random().toString().replace(/\D/, '')}`; let tweetHeight = $ref(150); +let unknownUrl = $ref(false); const requestUrl = new URL(props.url); @@ -96,7 +101,10 @@ requestUrl.hash = ''; window.fetch(`/url?url=${encodeURIComponent(requestUrl.href)}&lang=${requestLang}`).then(res => { res.json().then(info => { - if (info.url == null) return; + if (info.url == null) { + unknownUrl = true; + return; + } title = info.title; description = info.description; thumbnail = info.thumbnail;