diff --git a/locales/ar.json b/locales/ar.json index 119c36e40..65d1587e3 100644 --- a/locales/ar.json +++ b/locales/ar.json @@ -117,6 +117,8 @@ "Administrator preferences": "إعدادات المدير", "Default homepage: ": "الصفحة الرئيسية الافتراضية ", "Feed menu: ": "قائمة التدفقات: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "تفعيل 'الأفضل' ؟ ", "CAPTCHA enabled: ": "تفعيل الكابتشا: ", "Login enabled: ": "تفعيل الولوج: ", diff --git a/locales/de.json b/locales/de.json index 1a8870ece..a799c68da 100644 --- a/locales/de.json +++ b/locales/de.json @@ -117,6 +117,8 @@ "Administrator preferences": "Administrator-Einstellungen", "Default homepage: ": "Standard-Startseite: ", "Feed menu: ": "Feed-Menü: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Top aktiviert? ", "CAPTCHA enabled: ": "CAPTCHA aktiviert? ", "Login enabled: ": "Anmeldung aktiviert: ", diff --git a/locales/el.json b/locales/el.json index e6aec01ad..489dafe69 100644 --- a/locales/el.json +++ b/locales/el.json @@ -117,6 +117,8 @@ "Administrator preferences": "Προτιμήσεις διαχειριστή", "Default homepage: ": "Προεπιλεγμένη αρχική: ", "Feed menu: ": "Μενού ροής συνδρομών: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Ενεργοποίηση κορυφαίων; ", "CAPTCHA enabled: ": "Ενεργοποίηση CAPTCHA; ", "Login enabled: ": "Ενεργοποίηση σύνδεσης; ", diff --git a/locales/en-US.json b/locales/en-US.json index 0cddb4c0e..cf1b9141e 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -117,6 +117,8 @@ "Administrator preferences": "Administrator preferences", "Default homepage: ": "Default homepage: ", "Feed menu: ": "Feed menu: ", + "Show nickname on top: ": "Show nickname on top: ", + "Welcome, `x`": "Welcome, `x`", "Top enabled: ": "Top enabled: ", "CAPTCHA enabled: ": "CAPTCHA enabled: ", "Login enabled: ": "Login enabled: ", diff --git a/locales/eo.json b/locales/eo.json index 8be07305c..e76fae710 100644 --- a/locales/eo.json +++ b/locales/eo.json @@ -117,6 +117,8 @@ "Administrator preferences": "Agordoj de administranto", "Default homepage: ": "Defaŭlta hejmpaĝo: ", "Feed menu: ": "Flua menuo: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Ĉu pli bonaj ŝaltitaj? ", "CAPTCHA enabled: ": "Ĉu CAPTCHA ŝaltita? ", "Login enabled: ": "Ĉu ensaluto aktivita? ", diff --git a/locales/es.json b/locales/es.json index fa377151e..7507779ea 100644 --- a/locales/es.json +++ b/locales/es.json @@ -117,6 +117,8 @@ "Administrator preferences": "Preferencias de administrador", "Default homepage: ": "Página de inicio por defecto: ", "Feed menu: ": "Menú de fuentes: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "¿Habilitar los destacados? ", "CAPTCHA enabled: ": "¿Habilitar los CAPTCHA? ", "Login enabled: ": "¿Habilitar el inicio de sesión? ", diff --git a/locales/fa.json b/locales/fa.json index 145479ade..bd7691cb0 100644 --- a/locales/fa.json +++ b/locales/fa.json @@ -117,6 +117,8 @@ "Administrator preferences": "ترجیحات مدیریت", "Default homepage: ": "صفحه خانه پیشفرض ", "Feed menu: ": "منو خوراک: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "بالا فعال شده: ", "CAPTCHA enabled: ": "CAPTCHA فعال شده: ", "Login enabled: ": "ورود فعال شده: ", diff --git a/locales/fi.json b/locales/fi.json index e9cee1297..eb4337daa 100644 --- a/locales/fi.json +++ b/locales/fi.json @@ -117,6 +117,8 @@ "Administrator preferences": "Järjestelmänvalvojan asetukset", "Default homepage: ": "Oletuskotisivu: ", "Feed menu: ": "Syötevalikko: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Yläosa käytössä: ", "CAPTCHA enabled: ": "CAPTCHA käytössä: ", "Login enabled: ": "Kirjautuminen käytössä: ", diff --git a/locales/fr.json b/locales/fr.json index 9bb2fe165..2f8a00398 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -117,6 +117,8 @@ "Administrator preferences": "Préferences d'Administration", "Default homepage: ": "Page d'accueil par défaut : ", "Feed menu: ": "Préferences des abonnements : ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Top activé : ", "CAPTCHA enabled: ": "CAPTCHA activé : ", "Login enabled: ": "Autoriser l'ouverture de sessions utilisateur : ", diff --git a/locales/he.json b/locales/he.json index 5345b93d1..177e07a83 100644 --- a/locales/he.json +++ b/locales/he.json @@ -117,6 +117,8 @@ "Administrator preferences": "הגדרות ניהול מערכת", "Default homepage: ": "Default homepage: ", "Feed menu: ": "תפריט ההזנה: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "", "CAPTCHA enabled: ": "", "Login enabled: ": "", diff --git a/locales/hr.json b/locales/hr.json index 2f78469b3..6d16812f4 100644 --- a/locales/hr.json +++ b/locales/hr.json @@ -117,6 +117,8 @@ "Administrator preferences": "Postavke administratora", "Default homepage: ": "Standardna početna stranica: ", "Feed menu: ": "Izbornik za feedove: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Najbolji aktivirani: ", "CAPTCHA enabled: ": "Aktivirani CAPTCHA: ", "Login enabled: ": "Prijava aktivirana: ", diff --git a/locales/id.json b/locales/id.json index 679a34032..970c19f15 100644 --- a/locales/id.json +++ b/locales/id.json @@ -117,6 +117,8 @@ "Administrator preferences": "Preferensi administrator", "Default homepage: ": "Laman beranda default: ", "Feed menu: ": "Menu umpan: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Teratas diaktifkan: ", "CAPTCHA enabled: ": "CAPTCHA diaktifkan: ", "Login enabled: ": "Masuk diaktifkan: ", diff --git a/locales/is.json b/locales/is.json index 058933335..2fbbfb3bd 100644 --- a/locales/is.json +++ b/locales/is.json @@ -117,6 +117,8 @@ "Administrator preferences": "Kjörstillingar stjórnanda", "Default homepage: ": "Sjálfgefin heimasíða: ", "Feed menu: ": "Straum valmynd: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Toppur virkur? ", "CAPTCHA enabled: ": "CAPTCHA virk? ", "Login enabled: ": "Innskráning virk? ", diff --git a/locales/it.json b/locales/it.json index ec45d2ebf..d2e7c0ffa 100644 --- a/locales/it.json +++ b/locales/it.json @@ -117,6 +117,8 @@ "Administrator preferences": "Preferenze amministratore", "Default homepage: ": "Pagina principale predefinita: ", "Feed menu: ": "Menu iscrizioni: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Top abilitato: ", "CAPTCHA enabled: ": "CAPTCHA attivati: ", "Login enabled: ": "Accesso attivato: ", diff --git a/locales/ja.json b/locales/ja.json index af5dac7a5..63bff9da0 100644 --- a/locales/ja.json +++ b/locales/ja.json @@ -117,6 +117,8 @@ "Administrator preferences": "管理者設定", "Default homepage: ": "デフォルトのホーム: ", "Feed menu: ": "フィードメニュー: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "トップページを有効化: ", "CAPTCHA enabled: ": "CAPTCHA を有効化: ", "Login enabled: ": "ログインを有効化: ", diff --git a/locales/nb-NO.json b/locales/nb-NO.json index 6d66527d6..0ec779dac 100644 --- a/locales/nb-NO.json +++ b/locales/nb-NO.json @@ -117,6 +117,8 @@ "Administrator preferences": "Administratorinnstillinger", "Default homepage: ": "Forvalgt hjemmeside: ", "Feed menu: ": "Kilde-meny: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Topp påskrudd? ", "CAPTCHA enabled: ": "CAPTCHA påskrudd? ", "Login enabled: ": "Innlogging påskrudd? ", diff --git a/locales/nl.json b/locales/nl.json index 5f2fa2650..d896f03c1 100644 --- a/locales/nl.json +++ b/locales/nl.json @@ -117,6 +117,8 @@ "Administrator preferences": "Beheerdersinstellingen", "Default homepage: ": "Standaard startpagina: ", "Feed menu: ": "Feedmenu: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Bovenkant inschakelen? ", "CAPTCHA enabled: ": "CAPTCHA gebruiken? ", "Login enabled: ": "Inloggen toestaan? ", diff --git a/locales/pl.json b/locales/pl.json index 227a9cbb9..83711e2e0 100644 --- a/locales/pl.json +++ b/locales/pl.json @@ -117,6 +117,8 @@ "Administrator preferences": "Preferencje administratora", "Default homepage: ": "Domyślna strona główna: ", "Feed menu: ": "Menu aktualności: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "\"Top\" aktywne: ", "CAPTCHA enabled: ": "CAPTCHA aktywna? ", "Login enabled: ": "Logowanie włączone? ", diff --git a/locales/pt-BR.json b/locales/pt-BR.json index 7810671e1..940e1d555 100644 --- a/locales/pt-BR.json +++ b/locales/pt-BR.json @@ -117,6 +117,8 @@ "Administrator preferences": "Preferências de administrador", "Default homepage: ": "Página de início padrão: ", "Feed menu: ": "Menu do feed: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Habilitar destaques: ", "CAPTCHA enabled: ": "Habilitar CAPTCHA: ", "Login enabled: ": "Habilitar login: ", diff --git a/locales/pt-PT.json b/locales/pt-PT.json index 0aa19d3fd..a90e72fb7 100644 --- a/locales/pt-PT.json +++ b/locales/pt-PT.json @@ -117,6 +117,8 @@ "Administrator preferences": "Preferências de administrador", "Default homepage: ": "Página inicial predefinida: ", "Feed menu: ": "Menu de subscrições: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Top ativado: ", "CAPTCHA enabled: ": "CAPTCHA ativado: ", "Login enabled: ": "Iniciar sessão ativado: ", diff --git a/locales/ro.json b/locales/ro.json index 71e50ca5d..e93b686ef 100644 --- a/locales/ro.json +++ b/locales/ro.json @@ -117,6 +117,8 @@ "Administrator preferences": "Preferințele Administratorului", "Default homepage: ": "Pagina principală implicită: ", "Feed menu: ": "Preferințe legate de pagina de abonamente: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Top activat: ", "CAPTCHA enabled: ": "CAPTCHA activat : ", "Login enabled: ": "Autentificare activată : ", diff --git a/locales/ru.json b/locales/ru.json index 15d97862e..67d924bd0 100644 --- a/locales/ru.json +++ b/locales/ru.json @@ -117,6 +117,8 @@ "Administrator preferences": "Администраторские настройки", "Default homepage: ": "Главная страница по умолчанию: ", "Feed menu: ": "Меню ленты видео: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Включить топ видео? ", "CAPTCHA enabled: ": "Включить капчу? ", "Login enabled: ": "Включить авторизацию? ", diff --git a/locales/sv-SE.json b/locales/sv-SE.json index 911df096e..25ac23e52 100644 --- a/locales/sv-SE.json +++ b/locales/sv-SE.json @@ -117,6 +117,8 @@ "Administrator preferences": "Administratörsinställningar", "Default homepage: ": "Förvald hemsida: ", "Feed menu: ": "Flödesmeny: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Topp påslaget? ", "CAPTCHA enabled: ": "CAPTCHA påslaget? ", "Login enabled: ": "Inloggning påslaget? ", diff --git a/locales/tr.json b/locales/tr.json index 436cb5129..021e9fd6b 100644 --- a/locales/tr.json +++ b/locales/tr.json @@ -117,6 +117,8 @@ "Administrator preferences": "Yönetici tercihleri", "Default homepage: ": "Öntanımlı ana sayfa: ", "Feed menu: ": "Akış menüsü: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Top etkin: ", "CAPTCHA enabled: ": "CAPTCHA etkin: ", "Login enabled: ": "Oturum açma etkin: ", diff --git a/locales/uk.json b/locales/uk.json index 91ac8626f..da1e80ebe 100644 --- a/locales/uk.json +++ b/locales/uk.json @@ -117,6 +117,8 @@ "Administrator preferences": "Адміністраторські налаштування", "Default homepage: ": "Усталена домашня сторінка: ", "Feed menu: ": "Меню потоку з відео: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "Увімкнути топ відео? ", "CAPTCHA enabled: ": "Увімкнути капчу? ", "Login enabled: ": "Увімкнути авторизацію? ", diff --git a/locales/zh-CN.json b/locales/zh-CN.json index e71506277..5952b4e06 100644 --- a/locales/zh-CN.json +++ b/locales/zh-CN.json @@ -117,6 +117,8 @@ "Administrator preferences": "管理员选项", "Default homepage: ": "默认主页: ", "Feed menu: ": "Feed 菜单: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "是否启用“热门视频”页: ", "CAPTCHA enabled: ": "是否启用验证码: ", "Login enabled: ": "是否启用登录: ", diff --git a/locales/zh-TW.json b/locales/zh-TW.json index d9a486ef1..c8644de35 100644 --- a/locales/zh-TW.json +++ b/locales/zh-TW.json @@ -117,6 +117,8 @@ "Administrator preferences": "管理員偏好設定", "Default homepage: ": "預設首頁: ", "Feed menu: ": "Feed 選單: ", + "Show nickname on top: ": "", + "Welcome, `x`": "", "Top enabled: ": "頂部啟用: ", "CAPTCHA enabled: ": "CAPTCHA 啟用: ", "Login enabled: ": "啟用登入: ", diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr index 0c70cb021..7353f2d95 100644 --- a/src/invidious/helpers/helpers.cr +++ b/src/invidious/helpers/helpers.cr @@ -54,6 +54,7 @@ struct ConfigPreferences property extend_desc : Bool = false property volume : Int32 = 100 property vr_mode : Bool = true + property show_nick : Bool = true def to_tuple {% begin %} diff --git a/src/invidious/routes/preferences.cr b/src/invidious/routes/preferences.cr index d6002ffd0..21d79218f 100644 --- a/src/invidious/routes/preferences.cr +++ b/src/invidious/routes/preferences.cr @@ -68,6 +68,10 @@ class Invidious::Routes::PreferencesRoute < Invidious::Routes::BaseRoute vr_mode ||= "off" vr_mode = vr_mode == "on" + show_nick = env.params.body["show_nick"]?.try &.as(String) + show_nick ||= "off" + show_nick = show_nick == "on" + comments = [] of String 2.times do |i| comments << (env.params.body["comments[#{i}]"]?.try &.as(String) || CONFIG.default_user_preferences.comments[i]) @@ -155,6 +159,7 @@ class Invidious::Routes::PreferencesRoute < Invidious::Routes::BaseRoute volume: volume, extend_desc: extend_desc, vr_mode: vr_mode, + show_nick: show_nick, }.to_json).to_json if user = env.get? "user" diff --git a/src/invidious/users.cr b/src/invidious/users.cr index 98ef8792e..aff76b536 100644 --- a/src/invidious/users.cr +++ b/src/invidious/users.cr @@ -55,6 +55,7 @@ struct Preferences property listen : Bool = CONFIG.default_user_preferences.listen property local : Bool = CONFIG.default_user_preferences.local property vr_mode : Bool = CONFIG.default_user_preferences.vr_mode + property show_nick : Bool = CONFIG.default_user_preferences.show_nick @[JSON::Field(converter: Preferences::ProcessString)] property locale : String = CONFIG.default_user_preferences.locale diff --git a/src/invidious/views/preferences.ecr b/src/invidious/views/preferences.ecr index c5b64ad67..d98c3bb50 100644 --- a/src/invidious/views/preferences.ecr +++ b/src/invidious/views/preferences.ecr @@ -175,6 +175,12 @@ <% end %> + <% if env.get? "user" %> +