From 2af442ca2f07b71fae0c914a91551699b9c8a29c Mon Sep 17 00:00:00 2001 From: syeopite Date: Tue, 27 Jul 2021 00:58:44 -0700 Subject: [PATCH] Add support for community polls to Invidious --- assets/css/community.css | 47 +++++++++++++++++++++++++++++++ locales/ar.json | 6 +++- locales/bn_BD.json | 6 +++- locales/cs.json | 6 +++- locales/da.json | 6 +++- locales/de.json | 6 +++- locales/el.json | 6 +++- locales/en-US.json | 6 +++- locales/eo.json | 8 ++++-- locales/es.json | 8 ++++-- locales/eu.json | 6 +++- locales/fa.json | 6 +++- locales/fi.json | 6 +++- locales/fr.json | 6 +++- locales/he.json | 6 +++- locales/hr.json | 6 +++- locales/hu-HU.json | 6 +++- locales/id.json | 6 +++- locales/is.json | 6 +++- locales/it.json | 6 +++- locales/ja.json | 6 +++- locales/ko.json | 6 +++- locales/lt.json | 6 +++- locales/nb-NO.json | 6 +++- locales/nl.json | 6 +++- locales/pl.json | 6 +++- locales/pt-BR.json | 6 +++- locales/pt-PT.json | 6 +++- locales/pt.json | 4 +++ locales/ro.json | 6 +++- locales/ru.json | 6 +++- locales/si.json | 6 +++- locales/sk.json | 6 +++- locales/sr.json | 6 +++- locales/sr_Cyrl.json | 6 +++- locales/sv-SE.json | 6 +++- locales/tr.json | 6 +++- locales/uk.json | 6 +++- locales/vi.json | 6 +++- locales/zh-CN.json | 6 +++- locales/zh-TW.json | 6 +++- src/invidious/views/community.ecr | 11 +++++++- 42 files changed, 258 insertions(+), 42 deletions(-) create mode 100644 assets/css/community.css diff --git a/assets/css/community.css b/assets/css/community.css new file mode 100644 index 00000000..6621b9cd --- /dev/null +++ b/assets/css/community.css @@ -0,0 +1,47 @@ +.community-poll { + padding: 0px 10px; + border-radius: 5px; + display: flex; + flex-direction: column; +} + +.community-poll-item { + padding: 5px; + border-radius: 5px; +} + +.dark-theme .community-poll { + background-color: #363636; +} + +.dark-theme .community-poll-item { + background-color: #3d3d3d; +} + +@media (prefers-color-scheme: dark) { + .no-theme .community-poll { + background-color: #363636; + } + + .no-theme .community-poll-item { + background-color: #3d3d3d; + } +} + +.light-theme .community-poll { + background-color: #f2f2f2; +} + +.light-theme .community-poll-item { + background-color: #e6e6e6; +} + +@media (prefers-color-scheme: light) { + .no-theme .community-poll { + background-color: #f2f2f2; + } + + .no-theme .community-poll-item { + background-color: #e6e6e6; + } +} \ No newline at end of file diff --git a/locales/ar.json b/locales/ar.json index 9488e309..c061d2fc 100644 --- a/locales/ar.json +++ b/locales/ar.json @@ -423,5 +423,9 @@ "Current version: ": "الإصدار الحالي: ", "next_steps_error_message": "بعد ذلك يجب أن تحاول: ", "next_steps_error_message_refresh": "تحديث", - "next_steps_error_message_go_to_youtube": "انتقل إلى يوتيوب" + "next_steps_error_message_go_to_youtube": "انتقل إلى يوتيوب", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/bn_BD.json b/locales/bn_BD.json index c9e1150b..b658d417 100644 --- a/locales/bn_BD.json +++ b/locales/bn_BD.json @@ -423,5 +423,9 @@ "Current version: ": "", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/cs.json b/locales/cs.json index 094ad09c..cebec610 100644 --- a/locales/cs.json +++ b/locales/cs.json @@ -423,5 +423,9 @@ "Current version: ": "", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/da.json b/locales/da.json index 5919283d..ed2fe259 100644 --- a/locales/da.json +++ b/locales/da.json @@ -423,5 +423,9 @@ "Current version: ": "", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/de.json b/locales/de.json index e438f503..143a8a2a 100644 --- a/locales/de.json +++ b/locales/de.json @@ -423,5 +423,9 @@ "Current version: ": "Aktuelle Version: ", "next_steps_error_message": "Danach folgendes versuchen: ", "next_steps_error_message_refresh": "Neuladen", - "next_steps_error_message_go_to_youtube": "Zu YouTube gehen" + "next_steps_error_message_go_to_youtube": "Zu YouTube gehen", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/el.json b/locales/el.json index 6ad0c47f..7fa5e44b 100644 --- a/locales/el.json +++ b/locales/el.json @@ -423,5 +423,9 @@ "Current version: ": "Τρέχουσα έκδοση: ", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/en-US.json b/locales/en-US.json index a1e39777..88012e36 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -423,5 +423,9 @@ "Current version: ": "Current version: ", "next_steps_error_message": "After which you should try to: ", "next_steps_error_message_refresh": "Refresh", - "next_steps_error_message_go_to_youtube": "Go to YouTube" + "next_steps_error_message_go_to_youtube": "Go to YouTube", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "`x` vote", + "": "`x` votes" + } } diff --git a/locales/eo.json b/locales/eo.json index 7c2c7482..20769cd4 100644 --- a/locales/eo.json +++ b/locales/eo.json @@ -421,7 +421,11 @@ "hdr": "granddinamikgama", "filter": "filtri", "Current version: ": "Nuna versio: ", - "next_steps_error_message": "Poste, vi provu: ", + "next_steps_error_message": "", "next_steps_error_message_refresh": "Reŝargi", - "next_steps_error_message_go_to_youtube": "Iri al JuTubo" + "next_steps_error_message_go_to_youtube": "Iri al JuTubo", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/es.json b/locales/es.json index d7e3dd61..32509902 100644 --- a/locales/es.json +++ b/locales/es.json @@ -421,7 +421,11 @@ "hdr": "hdr", "filter": "filtro", "Current version: ": "Versión actual: ", - "next_steps_error_message": "Después de lo cual deberías intentar: ", + "next_steps_error_message": "", "next_steps_error_message_refresh": "Recargar", - "next_steps_error_message_go_to_youtube": "Ir a YouTube" + "next_steps_error_message_go_to_youtube": "Ir a YouTube", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/eu.json b/locales/eu.json index e1f8d1c0..9aead4a8 100644 --- a/locales/eu.json +++ b/locales/eu.json @@ -423,5 +423,9 @@ "Current version: ": "", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/fa.json b/locales/fa.json index 68a016c4..c289d001 100644 --- a/locales/fa.json +++ b/locales/fa.json @@ -423,5 +423,9 @@ "Current version: ": "نسخه فعلی: ", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/fi.json b/locales/fi.json index 6a830177..dba2f6fa 100644 --- a/locales/fi.json +++ b/locales/fi.json @@ -423,5 +423,9 @@ "Current version: ": "Tämänhetkinen versio: ", "next_steps_error_message": "Sinun tulisi kokeilla seuraavia: ", "next_steps_error_message_refresh": "Päivitä", - "next_steps_error_message_go_to_youtube": "Siirry YouTubeen" + "next_steps_error_message_go_to_youtube": "Siirry YouTubeen", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/fr.json b/locales/fr.json index a7fe004d..7f6f510c 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -423,5 +423,9 @@ "Current version: ": "Version actuelle : ", "next_steps_error_message": "Vous pouvez essayer de : ", "next_steps_error_message_refresh": "Rafraîchir la page", - "next_steps_error_message_go_to_youtube": "Aller sur YouTube" + "next_steps_error_message_go_to_youtube": "Aller sur YouTube", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/he.json b/locales/he.json index 6778e4dd..a4c7e738 100644 --- a/locales/he.json +++ b/locales/he.json @@ -423,5 +423,9 @@ "Current version: ": "הגרסה הנוכחית: ", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/hr.json b/locales/hr.json index 6927005f..186559b2 100644 --- a/locales/hr.json +++ b/locales/hr.json @@ -423,5 +423,9 @@ "Current version: ": "Trenutačna verzija: ", "next_steps_error_message": "Nakon toga pokušaj sljedeće: ", "next_steps_error_message_refresh": "Aktualiziraj stranicu", - "next_steps_error_message_go_to_youtube": "Idi na YouTube" + "next_steps_error_message_go_to_youtube": "Idi na YouTube", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/hu-HU.json b/locales/hu-HU.json index d5570a18..7f42e2b8 100644 --- a/locales/hu-HU.json +++ b/locales/hu-HU.json @@ -423,5 +423,9 @@ "Current version: ": "Jelenlegi verzió: ", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/id.json b/locales/id.json index 8ef67194..e3da61d9 100644 --- a/locales/id.json +++ b/locales/id.json @@ -423,5 +423,9 @@ "Current version: ": "Versi saat ini: ", "next_steps_error_message": "Setelah itu Anda harus mencoba: ", "next_steps_error_message_refresh": "Segarkan", - "next_steps_error_message_go_to_youtube": "Buka YouTube" + "next_steps_error_message_go_to_youtube": "Buka YouTube", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/is.json b/locales/is.json index 478f363a..ceb14bb1 100644 --- a/locales/is.json +++ b/locales/is.json @@ -423,5 +423,9 @@ "Current version: ": "Núverandi útgáfa: ", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/it.json b/locales/it.json index df3642db..885e1898 100644 --- a/locales/it.json +++ b/locales/it.json @@ -423,5 +423,9 @@ "Current version: ": "Versione attuale: ", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/ja.json b/locales/ja.json index c4f78f96..275e1129 100644 --- a/locales/ja.json +++ b/locales/ja.json @@ -423,5 +423,9 @@ "Current version: ": "現在のバージョン: ", "next_steps_error_message": "下記のものを試して下さい: ", "next_steps_error_message_refresh": "再読込", - "next_steps_error_message_go_to_youtube": "YouTubeへ" + "next_steps_error_message_go_to_youtube": "YouTubeへ", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/ko.json b/locales/ko.json index 16d4797e..858f996f 100644 --- a/locales/ko.json +++ b/locales/ko.json @@ -423,5 +423,9 @@ "today": "오늘", "hour": "지난 1시간", "sort": "정렬기준", - "features": "기능별" + "features": "기능별", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/lt.json b/locales/lt.json index e8e84dcf..847db3e4 100644 --- a/locales/lt.json +++ b/locales/lt.json @@ -423,5 +423,9 @@ "Current version: ": "Dabartinė versija: ", "next_steps_error_message": "Po to turėtumėte pabandyti: ", "next_steps_error_message_refresh": "Atnaujinti", - "next_steps_error_message_go_to_youtube": "Eiti į YouTube" + "next_steps_error_message_go_to_youtube": "Eiti į YouTube", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/nb-NO.json b/locales/nb-NO.json index 9e39a6c7..964bfed4 100644 --- a/locales/nb-NO.json +++ b/locales/nb-NO.json @@ -423,5 +423,9 @@ "Current version: ": "Gjeldende versjon: ", "next_steps_error_message": "Etterpå bør du prøve dette: ", "next_steps_error_message_refresh": "Gjenoppfrisk", - "next_steps_error_message_go_to_youtube": "Gå til YouTube" + "next_steps_error_message_go_to_youtube": "Gå til YouTube", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/nl.json b/locales/nl.json index 9fe604ad..01b50f68 100644 --- a/locales/nl.json +++ b/locales/nl.json @@ -423,5 +423,9 @@ "Current version: ": "Huidige versie: ", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/pl.json b/locales/pl.json index a33bbd45..cea4151d 100644 --- a/locales/pl.json +++ b/locales/pl.json @@ -423,5 +423,9 @@ "Current version: ": "Aktualna wersja: ", "next_steps_error_message": "Po czym powinien*ś spróbować: ", "next_steps_error_message_refresh": "Odśwież", - "next_steps_error_message_go_to_youtube": "Przejdź do YouTube" + "next_steps_error_message_go_to_youtube": "Przejdź do YouTube", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/pt-BR.json b/locales/pt-BR.json index 870bf070..ce179b30 100644 --- a/locales/pt-BR.json +++ b/locales/pt-BR.json @@ -423,5 +423,9 @@ "Current version: ": "Versão atual: ", "next_steps_error_message": "Depois disso, você deve tentar: ", "next_steps_error_message_refresh": "Atualizar", - "next_steps_error_message_go_to_youtube": "Ir para o YouTube" + "next_steps_error_message_go_to_youtube": "Ir para o YouTube", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/pt-PT.json b/locales/pt-PT.json index 08220d43..6d6cc212 100644 --- a/locales/pt-PT.json +++ b/locales/pt-PT.json @@ -423,5 +423,9 @@ "Current version: ": "Versão atual: ", "next_steps_error_message": "Pode tentar as seguintes opções: ", "next_steps_error_message_refresh": "Atualizar", - "next_steps_error_message_go_to_youtube": "Ir ao YouTube" + "next_steps_error_message_go_to_youtube": "Ir ao YouTube", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/pt.json b/locales/pt.json index d7b1f728..6ad38ee1 100644 --- a/locales/pt.json +++ b/locales/pt.json @@ -423,5 +423,9 @@ "`x` subscribers": { "": "`x` subscritores", "([^.,0-9]|^)1([^.,0-9]|$)": "`x` subscritores" + }, + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" } } diff --git a/locales/ro.json b/locales/ro.json index a8877853..fb74e49c 100644 --- a/locales/ro.json +++ b/locales/ro.json @@ -423,5 +423,9 @@ "Current version: ": "Versiunea actuală: ", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/ru.json b/locales/ru.json index 57814dd4..4f52d253 100644 --- a/locales/ru.json +++ b/locales/ru.json @@ -423,5 +423,9 @@ "Current version: ": "Текущая версия: ", "next_steps_error_message": "После чего следует попробовать: ", "next_steps_error_message_refresh": "Обновить", - "next_steps_error_message_go_to_youtube": "Перейти на YouTube" + "next_steps_error_message_go_to_youtube": "Перейти на YouTube", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/si.json b/locales/si.json index f38c56b7..128b0d39 100644 --- a/locales/si.json +++ b/locales/si.json @@ -423,5 +423,9 @@ "Current version: ": "", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/sk.json b/locales/sk.json index cdeca6c0..e88985eb 100644 --- a/locales/sk.json +++ b/locales/sk.json @@ -423,5 +423,9 @@ "Current version: ": "", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/sr.json b/locales/sr.json index 314f0367..265fdcbc 100644 --- a/locales/sr.json +++ b/locales/sr.json @@ -423,5 +423,9 @@ "Current version: ": "", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/sr_Cyrl.json b/locales/sr_Cyrl.json index 056b79cb..1558e470 100644 --- a/locales/sr_Cyrl.json +++ b/locales/sr_Cyrl.json @@ -423,5 +423,9 @@ "Current version: ": "Тренутна верзија: ", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/sv-SE.json b/locales/sv-SE.json index ae8e6fc4..58e50b8f 100644 --- a/locales/sv-SE.json +++ b/locales/sv-SE.json @@ -423,5 +423,9 @@ "Current version: ": "Nuvarande version: ", "next_steps_error_message": "", "next_steps_error_message_refresh": "Uppdatera", - "next_steps_error_message_go_to_youtube": "Gå till Youtube" + "next_steps_error_message_go_to_youtube": "Gå till Youtube", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/tr.json b/locales/tr.json index 493f1295..ead24f32 100644 --- a/locales/tr.json +++ b/locales/tr.json @@ -423,5 +423,9 @@ "Current version: ": "Şu anki sürüm: ", "next_steps_error_message": "Bundan sonra şunları denemelisiniz: ", "next_steps_error_message_refresh": "Yenile", - "next_steps_error_message_go_to_youtube": "YouTube'a git" + "next_steps_error_message_go_to_youtube": "YouTube'a git", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/uk.json b/locales/uk.json index 5100206c..d516413e 100644 --- a/locales/uk.json +++ b/locales/uk.json @@ -423,5 +423,9 @@ "Current version: ": "Поточна версія: ", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/vi.json b/locales/vi.json index 5a2812f7..c060ee7c 100644 --- a/locales/vi.json +++ b/locales/vi.json @@ -423,5 +423,9 @@ "Current version: ": "Phiên bản hiện tại: ", "next_steps_error_message": "", "next_steps_error_message_refresh": "", - "next_steps_error_message_go_to_youtube": "" + "next_steps_error_message_go_to_youtube": "", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/zh-CN.json b/locales/zh-CN.json index 5f89f964..02dc40e4 100644 --- a/locales/zh-CN.json +++ b/locales/zh-CN.json @@ -423,5 +423,9 @@ "Current version: ": "当前版本: ", "next_steps_error_message": "在此之后你应尝试: ", "next_steps_error_message_refresh": "刷新", - "next_steps_error_message_go_to_youtube": "转到 YouTube" + "next_steps_error_message_go_to_youtube": "转到 YouTube", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/locales/zh-TW.json b/locales/zh-TW.json index 96e04594..32330237 100644 --- a/locales/zh-TW.json +++ b/locales/zh-TW.json @@ -423,5 +423,9 @@ "Current version: ": "目前版本: ", "next_steps_error_message": "之後您應該嘗試: ", "next_steps_error_message_refresh": "重新整理", - "next_steps_error_message_go_to_youtube": "到 YouTube" + "next_steps_error_message_go_to_youtube": "到 YouTube", + "community-poll-votes": { + "([^.,0-9]|^)1([^.,0-9]|$)": "", + "": "" + } } diff --git a/src/invidious/views/community.ecr b/src/invidious/views/community.ecr index 058db2ad..1a1b5018 100644 --- a/src/invidious/views/community.ecr +++ b/src/invidious/views/community.ecr @@ -3,6 +3,7 @@ <% content_for "header" do %> <%= author %> - Invidious + <% end %> <% if channel.banner %> @@ -86,11 +87,19 @@ <% elsif attachment.is_a? YouTubeStructs::PlaylistRenderer %> <% elsif attachment.is_a? YouTubeStructs::CommunityPoll %> + <%-= translate(locale, "community-poll-votes", number_to_short_text(attachment.total_votes)) %> +
+ <%- attachment.choices.each do |choice| %> +

<%-= choice%>

+ <%- end %> +
<% elsif attachment.nil? %> <% else %> - + <% end %> + <% -%> +