From e5911088cdaabca4461157e4ae8967a1fe2c7def Mon Sep 17 00:00:00 2001 From: naskya Date: Mon, 16 Oct 2023 17:04:51 +0000 Subject: [PATCH] fix: properly use singular/plural in MkNoteDetailed tabs --- locales/en-US.yml | 8 +++- locales/ja-JP.yml | 4 ++ locales/zh-CN.yml | 4 ++ locales/zh-TW.yml | 4 ++ .../client/src/components/MkNoteDetailed.vue | 46 ++++++++++++++----- 5 files changed, 52 insertions(+), 14 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index ae04dd25e..d4bba5879 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -58,6 +58,7 @@ sendMessage: "Send a message" copyUsername: "Copy username" searchUser: "Search for a user" reply: "Reply" +replies: "Replies" jumpToPrevious: "Jump to previous" loadMore: "Load more" showMore: "Show more" @@ -112,18 +113,21 @@ unfollow: "Unfollow" followRequestPending: "Follow request pending" enterEmoji: "Enter an emoji" renote: "Boost" +renotes: "Boosts" unrenote: "Take back boost" renoted: "Boosted." cantRenote: "This post can't be boosted." cantReRenote: "A boost can't be boosted." quote: "Quote" +quotes: "Quotes" pinnedNote: "Pinned post" pinned: "Pin to profile" you: "You" clickToShow: "Click to show" sensitive: "NSFW" add: "Add" -reaction: "Reactions" +reaction: "Reaction" +reactions: "Reactions" removeReaction: "Remove your reaction" enableEmojiReactions: "Enable emoji reactions" showEmojisInReactionNotifications: "Show emojis in reaction notifications" @@ -739,6 +743,7 @@ system: "System" switchUi: "Layout" desktop: "Desktop" clip: "Clip" +clips: "Clips" createNew: "Create new" optional: "Optional" createNewClip: "Create new clip" @@ -781,7 +786,6 @@ pageLikesCount: "Number of liked Pages" pageLikedCount: "Number of received Page likes" contact: "Contact" useSystemFont: "Use the system's default font" -clips: "Clips" clipsDesc: "Clips are like share-able categorized bookmarks. You can create clips from the menu of individual posts." experimentalFeatures: "Experimental features" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 6f22c9d41..dbf3f1685 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -52,6 +52,7 @@ sendMessage: "メッセージを送信" copyUsername: "ユーザー名をコピー" searchUser: "ユーザーを検索" reply: "返信" +replies: "返信" loadMore: "もっと読み込む" showMore: "もっと見る" showLess: "閉じる" @@ -97,11 +98,13 @@ unfollow: "フォロー解除" followRequestPending: "フォロー許可待ち" enterEmoji: "絵文字を入力" renote: "ブースト" +renotes: "ブースト" unrenote: "ブースト解除" renoted: "ブーストしました。" cantRenote: "この投稿はブーストできません。" cantReRenote: "ブーストをブーストすることはできません。" quote: "引用" +quotes: "引用" pinnedNote: "ピン留めされた投稿" pinned: "ピン留め" you: "あなた" @@ -109,6 +112,7 @@ clickToShow: "クリックして表示" sensitive: "閲覧注意" add: "追加" reaction: "リアクション" +reactions: "リアクション" enableEmojiReactions: "絵文字リアクションを有効にする" showEmojisInReactionNotifications: "自分の投稿に対するリアクションの通知で絵文字を表示する" reactionSetting: "ピッカーに表示するリアクション" diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml index 42834e28b..d2db99124 100644 --- a/locales/zh-CN.yml +++ b/locales/zh-CN.yml @@ -49,6 +49,7 @@ sendMessage: "发送" copyUsername: "复制用户名" searchUser: "搜索用户" reply: "回复" +replies: "回复" loadMore: "加载更多" showMore: "查看更多" showLess: "关闭" @@ -94,11 +95,13 @@ unfollow: "取消关注" followRequestPending: "关注请求待批准" enterEmoji: "输入表情符号" renote: "转发" +renotes: "转发" unrenote: "取消转发" renoted: "已转发。" cantRenote: "此帖子无法被转发。" cantReRenote: "转发无法被再次转发。" quote: "引用" +quotes: "引用" pinnedNote: "已置顶的帖子" pinned: "置顶" you: "您" @@ -106,6 +109,7 @@ clickToShow: "点击以显示" sensitive: "敏感内容" add: "添加" reaction: "回应" +reactions: "回应" enableEmojiReaction: "启用表情符号回应" showEmojisInReactionNotifications: "在回应通知中显示表情符号" reactionSetting: "在回应选择器中显示的回应" diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml index 0eaf79f7b..e44103a55 100644 --- a/locales/zh-TW.yml +++ b/locales/zh-TW.yml @@ -49,6 +49,7 @@ sendMessage: "發送訊息" copyUsername: "複製使用者名稱" searchUser: "搜尋使用者" reply: "回覆" +replies: "回覆" loadMore: "載入更多" showMore: "載入更多" showLess: "關閉" @@ -94,11 +95,13 @@ unfollow: "取消追隨" followRequestPending: "追隨許可批准中" enterEmoji: "輸入表情符號" renote: "轉發" +renotes: "轉發" unrenote: "取消轉發" renoted: "已轉發。" cantRenote: "無法轉發此貼文。" cantReRenote: "無法轉發之前已經轉發過的內容。" quote: "引用" +quotes: "引用" pinnedNote: "已置頂的貼文" pinned: "置頂" you: "您" @@ -106,6 +109,7 @@ clickToShow: "按一下以顯示" sensitive: "敏感內容" add: "新增" reaction: "反應" +reactions: "反應" enableEmojiReaction: "啟用表情符號反應" showEmojisInReactionNotifications: "在反應通知中顯示表情符號" reactionSetting: "在選擇器中顯示反應" diff --git a/packages/client/src/components/MkNoteDetailed.vue b/packages/client/src/components/MkNoteDetailed.vue index ac5da6485..6967bd284 100644 --- a/packages/client/src/components/MkNoteDetailed.vue +++ b/packages/client/src/components/MkNoteDetailed.vue @@ -36,30 +36,47 @@ @@ -191,6 +208,11 @@ const softMuteReasonI18nSrc = (what?: string) => { return i18n.ts.userSaysSomething; }; +const wordWithCount = (count: number, singular: string, plural: string) => { + if (count === 0) return plural; + return `${count} ${count === 1 ? singular : plural}`; +}; + // plugin if (noteViewInterruptors.length > 0) { onMounted(async () => {