Invidious is an alternative front-end to YouTube
i18n: Use plurals for tokens/replies/unseen notifications
Samantaz Fox37c953e6339f
diff --git a/locales/en-US.json b/locales/en-US.jsonindex 9d3a70d2..ac8b0c11 100644--- a/locales/en-US.json+++ b/locales/en-US.json@@ -144,18 +144,14 @@"Subscription manager": "Subscription manager","Token manager": "Token manager","Token": "Token",- "`x` tokens": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` token",- "": "`x` tokens"- },+ "tokens_count": "{{count}} token",+ "tokens_count_plural": "{{count}} tokens","Import/export": "Import/export","unsubscribe": "unsubscribe","revoke": "revoke","Subscriptions": "Subscriptions",- "`x` unseen notifications": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` unseen notification",- "": "`x` unseen notifications"- },+ "subscriptions_unseen_notifs_count": "{{count}} unseen notification",+ "subscriptions_unseen_notifs_count_plural": "{{count}} unseen notifications","search": "search","Log out": "Log out","Released under the AGPLv3 on Github.": "Released under the AGPLv3 on Github.",@@ -222,16 +218,12 @@"This channel does not exist.": "This channel does not exist.","Could not get channel info.": "Could not get channel info.","Could not fetch comments": "Could not fetch comments",- "View `x` replies": {- "([^.,0-9]|^)1([^.,0-9]|$)": "View `x` reply",- "": "View `x` replies"- },+ "comments_view_x_replies": "View {{count}} reply",+ "comments_view_x_replies_plural": "View {{count}} replies","`x` ago": "`x` ago","Load more": "Load more",- "`x` points": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` point",- "": "`x` points"- },+ "comments_points_count": "{{count}} point",+ "comments_points_count_plural": "{{count}} points","Could not create mix.": "Could not create mix.","Empty playlist": "Empty playlist","Not a playlist.": "Not a playlist.",diff --git a/locales/fa.json b/locales/fa.jsonindex 22ca416c..48b5a17d 100644--- a/locales/fa.json+++ b/locales/fa.json@@ -120,18 +120,12 @@"Subscription manager": "مدیریت اشتراک","Token manager": "مدیر توکن","Token": "توکن",- "`x` tokens": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` توکن ها",- "": "`x` توکن ها"- },+ "tokens_count_0": "{{count}} توکن ها","Import/export": "وارد کردن/خارج کردن","unsubscribe": "لغو اشتراک","revoke": "ابطال","Subscriptions": "اشتراک ها",- "`x` unseen notifications": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` اعلان نادیده",- "": "`x` اعلان نادیده"- },+ "subscriptions_unseen_notifs_count_0": "{{count}} اعلان نادیده","search": "جستجو","Log out": "خروج","Released under the AGPLv3 on Github.": "منتشر شده تحت پروانه AGPLv3 روی گیتهاب.",@@ -198,16 +192,10 @@"This channel does not exist.": "این کانال وجود ندارد.","Could not get channel info.": "نمیتوان اطلاعات کانال را دریافت کرد.","Could not fetch comments": "نمیتوان نظرات را دریافت کرد",- "View `x` replies": {- "([^.,0-9]|^)1([^.,0-9]|$)": "نمایش `x` پاسخ ها",- "": "نمایش `x` پاسخ ها"- },+ "comments_view_x_replies_0": "نمایش {{count}} پاسخ ها","`x` ago": "`x` پیش","Load more": "بارگذاری بیشتر",- "`x` points": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` نقطه ها",- "": "`x` نقطه ها"- },+ "comments_points_count_0": "{{count}} نقطه ها","Could not create mix.": "نمیتوان میکس ساخت.","Empty playlist": "سیاههٔ پخش خالی","Not a playlist.": "یک سیاههٔ پخش نیست.",diff --git a/locales/fr.json b/locales/fr.jsonindex d14a20ac..72d7daf6 100644--- a/locales/fr.json+++ b/locales/fr.json@@ -125,18 +125,14 @@"Subscription manager": "Gestionnaire d'abonnement","Token manager": "Gestionnaire de token","Token": "Token",- "`x` tokens": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` token",- "": "`x` tokens"- },+ "tokens_count": "{{count}} token",+ "tokens_count_plural": "{{count}} tokens","Import/export": "Importer/Exporter","unsubscribe": "se désabonner","revoke": "révoquer","Subscriptions": "Abonnements",- "`x` unseen notifications": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` notification non vue",- "": "`x` notifications non vues"- },+ "subscriptions_unseen_notifs_count": "{{count}} notification non vue",+ "subscriptions_unseen_notifs_count_plural": "{{count}} notifications non vues","search": "rechercher","Log out": "Se déconnecter","Released under the AGPLv3 on Github.": "Publié sous licence AGPLv3 sur Github.",@@ -203,16 +199,12 @@"This channel does not exist.": "Cette chaine n'existe pas.","Could not get channel info.": "Impossible de charger les informations de cette chaîne.","Could not fetch comments": "Impossible de charger les commentaires",- "View `x` replies": {- "([^.,0-9]|^)1([^.,0-9]|$)": "Voir `x` réponse",- "": "Voir `x` réponses"- },+ "comments_view_x_replies": "Voir {{count}} réponse",+ "comments_view_x_replies_plural": "Voir {{count}} réponses","`x` ago": "il y a `x`","Load more": "Voir plus",- "`x` points": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` point",- "": "`x` points"- },+ "comments_points_count": "{{count}} point",+ "comments_points_count_plural": "{{count}} points","Could not create mix.": "Impossible de charger cette liste de lecture.","Empty playlist": "La liste de lecture est vide","Not a playlist.": "La liste de lecture est invalide.",diff --git a/locales/id.json b/locales/id.jsonindex 949cc69a..b7dbf598 100644--- a/locales/id.json+++ b/locales/id.json@@ -120,18 +120,12 @@"Subscription manager": "Pengatur langganan","Token manager": "Pengatur token","Token": "Token",- "`x` tokens": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` token",- "": "`x` token"- },+ "tokens_count_0": "{{count}} token","Import/export": "Impor/ekspor","unsubscribe": "batal langganan","revoke": "cabut","Subscriptions": "Langganan",- "`x` unseen notifications": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` pemberitahuan belum dilihat",- "": "`x` pemberitahuan belum dilihat"- },+ "subscriptions_unseen_notifs_count_0": "{{count}} pemberitahuan belum dilihat","search": "cari","Log out": "Keluar","Released under the AGPLv3 on Github.": "Dirilis di bawah AGPLv3 di Github.",@@ -198,16 +192,10 @@"This channel does not exist.": "Kanal ini tidak ada.","Could not get channel info.": "Tidak bisa mendapatkan info kanal.","Could not fetch comments": "Tidak dapat memuat komentar",- "View `x` replies": {- "([^.,0-9]|^)1([^.,0-9]|$)": "Lihat`x` balasan",- "": "Lihat `x` balasan"- },+ "comments_view_x_replies_0": "Lihat {{count}} balasan","`x` ago": "`x` lalu","Load more": "Muat lebih banyak",- "`x` points": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` poin",- "": "`x` poin"- },+ "comments_points_count_0": "{{count}} poin","Could not create mix.": "Tidak dapat membuat mix.","Empty playlist": "Daftar putar kosong","Not a playlist.": "Bukan daftar putar.",diff --git a/locales/it.json b/locales/it.jsonindex 2722e7bb..cef2bf13 100644--- a/locales/it.json+++ b/locales/it.json@@ -118,18 +118,14 @@"Token": "Gettone","generic_subscriptions_count": "{{count}} iscrizione","generic_subscriptions_count_plural": "{{count}} iscrizioni",- "`x` tokens": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` gettone",- "": "`x` gettoni"- },+ "tokens_count": "{{count}} gettone",+ "tokens_count_plural": "{{count}} gettoni","Import/export": "Importa/esporta","unsubscribe": "disiscriviti","revoke": "revoca","Subscriptions": "Iscrizioni",- "`x` unseen notifications": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` notifica non visualizzata",- "": "`x` notifiche non visualizzate"- },+ "subscriptions_unseen_notifs_count": "{{count}} notifica non visualizzata",+ "subscriptions_unseen_notifs_count_plural": "{{count}} notifiche non visualizzate","search": "Cerca","Log out": "Esci","Source available here.": "Codice sorgente.",diff --git a/locales/ja.json b/locales/ja.jsonindex 52406f0d..5cb1244d 100644--- a/locales/ja.json+++ b/locales/ja.json@@ -120,18 +120,12 @@"Subscription manager": "登録チャンネルマネージャー","Token manager": "トークンマネージャー","Token": "トークン",- "`x` tokens": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` 個のトークン",- "": "`x` 個のトークン"- },+ "tokens_count_0": "{{count}} 個のトークン","Import/export": "インポート/エクスポート","unsubscribe": "登録解除","revoke": "取り消す","Subscriptions": "登録チャンネル",- "`x` unseen notifications": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` 個の未読通知",- "": "`x` 個の未読通知"- },+ "subscriptions_unseen_notifs_count_0": "{{count}} 個の未読通知","search": "検索","Log out": "ログアウト","Released under the AGPLv3 on Github.": "GitHub 上で AGPLv3 の元で公開されています。",@@ -198,16 +192,10 @@"This channel does not exist.": "このチャンネルは存在しません。","Could not get channel info.": "チャンネル情報を取得できませんでした。","Could not fetch comments": "コメントを取得できませんでした",- "View `x` replies": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` 件の返信を見る",- "": "`x` 件の返信を見る"- },+ "comments_view_x_replies_0": "{{count}} 件の返信を見る","`x` ago": "`x`前","Load more": "もっと読み込む",- "`x` points": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` ポイント",- "": "`x` ポイント"- },+ "comments_points_count_0": "{{count}} ポイント","Could not create mix.": "ミックスを作成できませんでした。","Empty playlist": "空の再生リスト","Not a playlist.": "再生リストではありません。",diff --git a/locales/ko.json b/locales/ko.jsonindex 16cf59b9..a579fe56 100644--- a/locales/ko.json+++ b/locales/ko.json@@ -139,18 +139,12 @@"Source available here.": "소스는 여기에서 사용할 수 있습니다.","Log out": "로그아웃","search": "검색",- "`x` unseen notifications": {- "": "`x` 읽지 않은 알림",- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` 읽지 않은 알림"- },+ "subscriptions_unseen_notifs_count_0": "{{count}} 읽지 않은 알림","Subscriptions": "구독","revoke": "철회","unsubscribe": "구독 취소","Import/export": "가져오기/내보내기",- "`x` tokens": {- "": "`x` 토큰",- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` 토큰"- },+ "tokens_count_0": "{{count}} 토큰","Token": "토큰","Token manager": "토큰 관리자","Subscription manager": "구독 관리자",@@ -251,10 +245,7 @@"Could not pull trending pages.": "인기 급상승 페이지를 가져올 수 없습니다.","Could not create mix.": "믹스를 생성할 수 없습니다.","`x` ago": "`x` 전",- "View `x` replies": {- "": "답글 `x`개 보기",- "([^.,0-9]|^)1([^.,0-9]|$)": "답글 `x`개 보기"- },+ "comments_view_x_replies_0": "답글 {{count}}개 보기","View Reddit comments": "Reddit의 댓글 보기","Engagement: ": "약속: ","Wilson score: ": "Wilson Score: ",@@ -347,10 +338,7 @@"Tajik": "타지크어","Swedish": "스웨덴어","Spanish (Latin America)": "스페인어 (라틴 아메리카)",- "`x` points": {- "": "`x` 포인트",- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` 포인트"- },+ "comments_points_count_0": "{{count}} 포인트","Invidious Private Feed for `x`": "`x` 에 대한 Invidious 비공개 피드","Premieres `x`": "최초 공개 `x`","Premieres in `x`": "`x` 에 최초 공개",diff --git a/locales/pt-BR.json b/locales/pt-BR.jsonindex 01407669..abf27194 100644--- a/locales/pt-BR.json+++ b/locales/pt-BR.json@@ -131,10 +131,8 @@"([^.,0-9]|^)1([^.,0-9]|$)": "`x` inscrições","": "`x` inscrições"},- "`x` tokens": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` tokens",- "": "Símbolos `x`"- },+ "tokens_count": "{{count}} token",+ "tokens_count_plural": "{{count}} tokens","Import/export": "Importar/Exportar","unsubscribe": "cancelar inscrição","revoke": "revogar",diff --git a/locales/pt-PT.json b/locales/pt-PT.jsonindex 83b59ab5..3c562467 100644--- a/locales/pt-PT.json+++ b/locales/pt-PT.json@@ -131,10 +131,8 @@"([^.,0-9]|^)1([^.,0-9]|$)": "`x` subscrições","": "`x` subscrições"},- "`x` tokens": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` tokens",- "": "`x` tokens"- },+ "tokens_count": "{{count}} token",+ "tokens_count_plural": "{{count}} tokens","Import/export": "Importar / exportar","unsubscribe": "anular subscrição","revoke": "revogar",diff --git a/locales/pt.json b/locales/pt.jsonindex 065170fb..9382da48 100644--- a/locales/pt.json+++ b/locales/pt.json@@ -191,10 +191,8 @@},"Subscriptions": "Subscrições","revoke": "revogar",- "`x` tokens": {- "": "`x` tokens",- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` tokens"- },+ "tokens_count": "{{count}} token",+ "tokens_count_plural": "{{count}} tokens","`x` subscriptions": {"": "`x` subscrições","([^.,0-9]|^)1([^.,0-9]|$)": "`x` subscrições"diff --git a/locales/zh-CN.json b/locales/zh-CN.jsonindex f3a6bd98..10b767d9 100644--- a/locales/zh-CN.json+++ b/locales/zh-CN.json@@ -120,18 +120,12 @@"Subscription manager": "订阅管理器","Token manager": "令牌管理器","Token": "令牌",- "`x` tokens": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` 个令牌",- "": "`x` 个令牌"- },+ "tokens_count_0": "{{count}} 个令牌","Import/export": "导入/导出","unsubscribe": "取消订阅","revoke": "吊销","Subscriptions": "订阅",- "`x` unseen notifications": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` 条未读通知",- "": "`x` 条未读通知"- },+ "subscriptions_unseen_notifs_count_0": "{{count}} 条未读通知","search": "搜索","Log out": "登出","Released under the AGPLv3 on Github.": "依据 AGPLv3 许可证发布于 Github。",@@ -198,16 +192,10 @@"This channel does not exist.": "频道不存在。","Could not get channel info.": "无法获取频道信息。","Could not fetch comments": "无法获取评论",- "View `x` replies": {- "([^.,0-9]|^)1([^.,0-9]|$)": "查看 `x` 条回复",- "": "查看 `x` 条回复"- },+ "comments_view_x_replies_0": "查看 {{count}} 条回复","`x` ago": "`x` 前","Load more": "加载更多",- "`x` points": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` 分",- "": "`x` 分"- },+ "comments_points_count_0": "{{count}} 分","Could not create mix.": "无法创建合集。","Empty playlist": "空播放列表","Not a playlist.": "非播放列表。",diff --git a/locales/zh-TW.json b/locales/zh-TW.jsonindex 1954e34a..c2800114 100644--- a/locales/zh-TW.json+++ b/locales/zh-TW.json@@ -120,18 +120,12 @@"Subscription manager": "訂閱管理員","Token manager": "Token 管理員","Token": "Token",- "`x` tokens": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` token",- "": "`x` 個存取金鑰"- },+ "tokens_count_0": "{{count}} 個存取金鑰","Import/export": "匯入/匯出","unsubscribe": "取消訂閱","revoke": "撤銷","Subscriptions": "訂閱",- "`x` unseen notifications": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` 個未讀的通知",- "": "`x` 個未讀的通知"- },+ "subscriptions_unseen_notifs_count_0": "{{count}} 個未讀的通知","search": "搜尋","Log out": "登出","Released under the AGPLv3 on Github.": "在 GitHub 上以 AGPLv3 釋出。",@@ -198,16 +192,10 @@"This channel does not exist.": "此頻道不存在。","Could not get channel info.": "無法取得頻道資訊。","Could not fetch comments": "無法擷取留言",- "View `x` replies": {- "([^.,0-9]|^)1([^.,0-9]|$)": "檢視 `x` 則回覆",- "": "檢視 `x` 則回覆"- },+ "comments_view_x_replies_0": "檢視 {{count}} 則回覆","`x` ago": "`x` 以前","Load more": "載入更多",- "`x` points": {- "([^.,0-9]|^)1([^.,0-9]|$)": "`x` 點",- "": "`x` 點"- },+ "comments_points_count_0": "{{count}} 點","Could not create mix.": "無法建立混合。","Empty playlist": "空的播放清單","Not a playlist.": "不是播放清單。",diff --git a/src/invidious/comments.cr b/src/invidious/comments.crindex 5b7d63e0..50059fa2 100644--- a/src/invidious/comments.cr+++ b/src/invidious/comments.cr@@ -303,13 +303,19 @@ def template_youtube_comments(comments, locale, thin_mode, is_replies = false)root = comments["comments"].as_aroot.each do |child|if child["replies"]?+ replies_count_text = translate_count(locale,+ "comments_view_x_replies",+ child["replies"]["replyCount"].as_s.to_i? || 0,+ NumberFormatting::Separator+ )+replies_html = <<-END_HTML<div id="replies" class="pure-g"><div class="pure-u-1-24"></div><div class="pure-u-23-24"><p><a href="javascript:void(0)" data-continuation="#{child["replies"]["continuation"]}"- data-onclick="get_youtube_replies" data-load-replies>#{translate(locale, "View `x` replies", number_with_separator(child["replies"]["replyCount"]))}</a>+ data-onclick="get_youtube_replies" data-load-replies>#{replies_count_text}</a></p></div></div>@@ -471,7 +477,7 @@ def template_reddit_comments(root, locale)<p><a href="javascript:void(0)" data-onclick="toggle_parent">[ - ]</a><b><a href="https://www.reddit.com/user/#{child.author}">#{child.author}</a></b>- #{translate(locale, "`x` points", number_with_separator(child.score))}+ #{translate_count(locale, "comments_points_count", child.score, NumberFormatting::Separator)}<span title="#{child.created_utc.to_s(translate(locale, "%a %B %-d %T %Y UTC"))}">#{translate(locale, "`x` ago", recode_date(child.created_utc, locale))}</span><a href="https://www.reddit.com#{child.permalink}" title="#{translate(locale, "permalink")}">#{translate(locale, "permalink")}</a></p>diff --git a/src/invidious/views/feeds/subscriptions.ecr b/src/invidious/views/feeds/subscriptions.ecrindex 97184e2b..8d56ad14 100644--- a/src/invidious/views/feeds/subscriptions.ecr+++ b/src/invidious/views/feeds/subscriptions.ecr@@ -24,7 +24,7 @@</div><center>- <%= translate(locale, "`x` unseen notifications", "#{notifications.size}") %>+ <%= translate_count(locale, "subscriptions_unseen_notifs_count", notifications.size) %></center><% if !notifications.empty? %>diff --git a/src/invidious/views/token_manager.ecr b/src/invidious/views/token_manager.ecrindex e48aec2f..12e0e8c9 100644--- a/src/invidious/views/token_manager.ecr+++ b/src/invidious/views/token_manager.ecr@@ -5,7 +5,7 @@<div class="pure-g h-box"><div class="pure-u-1-3"><h3>- <%= translate(locale, "`x` tokens", %(<span id="count">#{tokens.size}</span>)) %>+ <%= translate_count(locale, "tokens_count", tokens.size, NumberFormatting::HtmlSpan) %></h3></div><div class="pure-u-1-3"></div>