From acbc24512f59a4658ca52e72581d7efc48f3af47 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 2 Sep 2026 20:32:21 +0200 Subject: fix: cosmetic changes Signed-off-by: salmonik --- src/lang.rs | 97 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 47 insertions(+), 50 deletions(-) (limited to 'src/lang.rs') diff --git a/src/lang.rs b/src/lang.rs index aad0413..6b4e747 100644 --- a/src/lang.rs +++ b/src/lang.rs @@ -47,10 +47,10 @@ pub fn fmt_cron_audio_queued(cron: &str) -> String { format!("Praca audio zakolejkowana z cron'em `{cron}`") } pub fn fmt_cron_label_audio(name: &str) -> String { - format!("Audio: {name}") + format!("Audio: `{name}`") } pub fn fmt_cron_label_msg(msg: &str) -> String { - format!("Wiadomość: {msg}") + format!("Wiadomość: `{msg}`") } pub fn fmt_cron_job_status(id: i64, status: &str) -> String { format!("ID {id} — {status}") @@ -59,16 +59,16 @@ pub fn fmt_cron_field(cron: &str, chan: i64, desc: &str) -> String { format!("`{cron}` — <#{chan}>\n{desc}") } pub fn fmt_cron_deleted(id: i64) -> String { - format!("Praca cron z ID {id} została usunięta") + format!("Praca cron z ID `{id}` została usunięta") } pub fn fmt_cron_not_found(id: i64) -> String { - format!("Praca z ID {id} nie została znaleziona") + format!("Praca z ID `{id}` nie została znaleziona") } pub fn fmt_cron_paused(id: i64) -> String { - format!("Praca cron z ID {id} została zapauzowana") + format!("Praca cron z ID `{id}` została zapauzowana") } pub fn fmt_cron_resumed(id: i64) -> String { - format!("Praca cron z ID {id} została wznowiona") + format!("Praca cron z ID `{id}` została wznowiona") } // ── Math command ────────────────────────────────────────────────────── @@ -80,7 +80,7 @@ pub const L_MATH_DANGEROUS: &str = "Ekspresja zawiera groźne słowa"; pub const L_MATH_NO_RESULT: &str = "Brak rezultatu"; pub fn fmt_math_qalc_err(e: &dyn std::fmt::Display) -> String { - format!("qalc nie jest dostępny: {e}") + format!("qalc nie jest dostępny: `{e}`") } pub fn fmt_math_result(r: &str) -> String { format!("```\n{r}\n```") @@ -97,16 +97,16 @@ pub const L_MUSIC_STOPPED: &str = "wyszed"; pub const L_VOICE_USER_NOT_IN_VC: &str = "You are not in a voice channel"; pub fn fmt_music_search_failed(e: &dyn std::fmt::Display) -> String { - format!("Szukanie na copyparty zawiodło: {e}") + format!("Szukanie na copyparty zawiodło: `{e}`") } pub fn fmt_music_playing(name: &str) -> String { - format!("Grajcowanie: {name}") + format!("Grajcowanie: `{name}`") } pub fn fmt_voice_joined(cid: &dyn std::fmt::Display) -> String { format!("Dołączon <#{cid}>") } pub fn fmt_voice_join_failed(e: &dyn std::fmt::Display) -> String { - format!("Nie udało się połączyć z VC: {e}") + format!("Nie udało się połączyć z VC: `{e}`") } // ── TTS command ─────────────────────────────────────────────────────── @@ -115,10 +115,10 @@ pub const L_TTS_SAVED: &str = "TTS zapisany"; pub const L_TTS_PLAYING: &str = "Grom TTS na kanale głosowym"; pub fn fmt_tts_piper_launch(e: &str) -> String { - format!("Piper sie nie uruchomił w czas: {e}") + format!("Piper sie nie uruchomił w czas: `{e}`") } pub fn fmt_tts_piper_failed(e: &str) -> String { - format!("Piper TTS sie nie powiodło: {e}") + format!("Piper TTS sie nie powiodło: `{e}`") } // ── Trigger command ─────────────────────────────────────────────────── @@ -127,16 +127,16 @@ pub const L_TRIGGER_UPDATED: &str = "Trigger zaktualizowany"; pub const L_TRIGGER_KW_NONE: &str = "Brak"; pub fn fmt_trigger_created(name: &str) -> String { - format!("Grupa trigger '{name}' utworzona") + format!("Grupa trigger `{name}` utworzona") } pub fn fmt_trigger_failed(e: &dyn std::fmt::Display) -> String { - format!("Nie udało się: {e}") + format!("Nie udało się: `{e}`") } pub fn fmt_trigger_deleted(name: &str) -> String { - format!("Grupa trigger '{name}' usunięta") + format!("Grupa trigger `{name}` usunięta") } pub fn fmt_trigger_title(name: &str) -> String { - format!("Trigger: {name}") + format!("Trigger: `{name}`") } // ── Utility commands ────────────────────────────────────────────────── @@ -152,41 +152,41 @@ pub const L_UTIL_NO_ATTACHMENTS: &str = "Brak załączników w wiadomości"; pub const L_SEARCH_NO_RESULTS: &str = "No results found"; pub fn fmt_util_compressed(url: &str) -> String { - format!("Skompresowano\n{url}") + format!("Skompresowano\n`{url}`") } pub fn fmt_util_converted(url: &str) -> String { - format!("Skonwertowano\n{url}") + format!("Skonwertowano\n`{url}`") } pub fn fmt_util_convert_err(stderr: &str) -> String { - format!("Błąd konwersji: {stderr}") + format!("Błąd konwersji: `{stderr}`") } pub fn fmt_uploaded(url: &str) -> String { - format!("Wysłon: {url}") + format!("Wysłon: `{url}`") } pub fn fmt_download_uploaded(url: &str) -> String { - format!("pobioron i wysyłon: {url}") + format!("pobioron i wysyłon: `{url}`") } pub fn fmt_upload_summary(count: usize) -> String { - format!("Wysłano {count} plików:\n") + format!("Wysłano `{count}` plików:\n") } pub fn fmt_upload_partial_failed(count: usize) -> String { - format!("\n\nNie wysłano {count} plików") + format!("\n\nNie wysłano `{count}` plików") } pub fn fmt_message_compressed(made: usize, total: usize) -> String { - format!("Skompresowano {made} z {total} plików:") + format!("Skompresowano `{made}` z `{total}` plików:") } pub fn fmt_search_result(name: &str, url: &str) -> String { - format!("**{name}**\n{url}") + format!("**{name}**\n`{url}`") } pub fn fmt_download_failed(stderr: &str) -> String { format!( - "Pobieranie się nie powiodło: {}", + "Pobieranie się nie powiodło: `{}`", translate_ytdlp_stderr(stderr) ) } pub fn fmt_ytdlp_err(e: &dyn std::fmt::Display) -> String { - format!("yt-dlp nie mógło się uruchomić: {e}") + format!("yt-dlp nie mógło się uruchomić: `{e}`") } pub fn fmt_ytdlp_stderr(stderr: &str) -> String { translate_ytdlp_stderr(stderr) @@ -205,11 +205,8 @@ pub fn translate_ytdlp_stderr(stderr: &str) -> String { // YouTube's anti-bot sign-in wall. yt-dlp can't bypass this without // browser cookies configured on the host — surface that to the user // rather than the cryptic "Sign in to confirm you're not a bot" line. - if lower.contains("sign in to confirm you") - || lower.contains("confirm you're not a bot") - || lower.contains("confirm you are not a bot") - { - return "YouTube uznaje nas za bota i blokuje pobieranie. Spróbuj ponownie później albo podaj inny link.".into(); + if lower.contains("not a bot") || lower.contains("reloaded") { + return "jutup uznaje nas za bota i blokuje pobieranie. Spróbuj ponownie ___**NIGDY**___. Spróbuj pobrać z jutup jeszcze raz, to cie powiesze za jaja.".into(); } // Generic extractor fallback means the URL didn't match any known @@ -275,12 +272,12 @@ pub fn translate_ytdlp_stderr(stderr: &str) -> String { }) .filter(|s| !s.is_empty()) .unwrap_or(rest); - return format!("Pobieranie się nie powiodło: {msg}"); + return format!("Pobieranie się nie powiodło: `{msg}`"); } } for line in stderr.lines() { if let Some(rest) = line.strip_prefix("WARNING:") { - return format!("Pobieranie się nie powiodło: {}", rest.trim()); + return format!("Pobieranie się nie powiodło: `{}`", rest.trim()); } } @@ -292,7 +289,7 @@ pub fn translate_ytdlp_stderr(stderr: &str) -> String { pub const L_WEB_NO_RESULTS: &str = "Brak rezultatów"; pub fn fmt_web_title(query: &str) -> String { - format!("Wyniki wyszukiwania dla: {query}") + format!("Wyniki wyszukiwania dla: `{query}`") } // ── QR command ──────────────────────────────────────────────────────── @@ -309,16 +306,16 @@ pub fn fmt_qr_decoded(text: &str) -> String { pub const L_CP_UPLOAD_NO_URL: &str = "Wysłanie zawiodło, brak URL w odpowiedzi"; pub fn fmt_cp_search_http(status: &dyn std::fmt::Display, snippet: &str) -> String { - format!("copyparty zwróciło status HTTP {status}: {snippet}") + format!("copyparty zwróciło status HTTP `{status}`: `{snippet}`") } pub fn fmt_cp_invalid_json(e: &dyn std::fmt::Display, snippet: &str) -> String { - format!("copyparty zwróciło nielegalny JSON. ({e}): {snippet}") + format!("copyparty zwróciło nielegalny JSON. (`{e}`): `{snippet}`") } // ── OpenRouter ──────────────────────────────────────────────────────── pub fn fmt_llm_err(endpoint: &str, status: &dyn std::fmt::Display, text: &str) -> String { - format!("Błąd API LLM ({endpoint}). {status}: {text}") + format!("Błąd API LLM (`{endpoint}`). `{status}`: `{text}`") } // ── Voice / audio decoding ──────────────────────────────────────────── @@ -327,19 +324,19 @@ pub const L_VOICE_NO_TRACK: &str = "Brak kawałka"; pub const L_VOICE_NO_CODEC: &str = "Brak parametrów codec'a audio"; pub fn fmt_voice_remove_failed(e: &dyn std::fmt::Display) -> String { - format!("Nie udało się usunąć klienta głosowego: {e}") + format!("Nie udało się usunąć klienta głosowego: `{e}`") } pub fn fmt_voice_probe_failed(e: &dyn std::fmt::Display) -> String { - format!("Próbkowanie symphonia zawiodło: {e}") + format!("Próbkowanie symphonia zawiodło: `{e}`") } pub fn fmt_voice_decoder_failed(e: &dyn std::fmt::Display) -> String { - format!("Nie udało się utworzyć dekodera audio: {e}") + format!("Nie udało się utworzyć dekodera audio: `{e}`") } pub fn fmt_voice_ytdlp_launch(e: &dyn std::fmt::Display) -> String { - format!("yt-dlp nie mogło się uruchomić: {e}") + format!("yt-dlp nie mogło się uruchomić: `{e}`") } pub fn fmt_voice_ffmpeg_launch(e: &dyn std::fmt::Display) -> String { - format!("ffmpeg nie mogło się uruchomić: {e}") + format!("ffmpeg nie mogło się uruchomić: `{e}`") } // ── Events ──────────────────────────────────────────────────────────── @@ -351,28 +348,28 @@ pub const L_EV_MESSAGE_HANDLER_ERROR: &str = "Błąd ustanawiacza głosu"; // ── Event TTS phrases ───────────────────────────────────────────────── pub fn fmt_ev_joined(name: &str) -> String { - format!("{name} sie zespawnił") + format!("`{name}` sie zespawnił") } pub fn fmt_ev_left(name: &str) -> String { - format!("{name} jest chujem") + format!("`{name}` jest chujem") } pub fn fmt_ev_deafened(name: &str) -> String { - format!("{name} jest bity przez ojca") + format!("`{name}` jest bity przez ojca") } pub fn fmt_ev_undeafened(name: &str) -> String { - format!("{name} uciekł od ojca") + format!("`{name}` uciekł od ojca") } pub fn fmt_ev_muted(name: &str) -> String { - format!("{name} idzie robić jajecznice") + format!("`{name}` idzie robić jajecznice") } pub fn fmt_ev_unmuted(name: &str) -> String { - format!("{name} zrobił jajecznice") + format!("`{name}` zrobił jajecznice") } // ── AI assistant (events/message handler) ───────────────────────────── pub const ASSISTANT_SYSTEM_PROMPT: &str = - "Jesteś asystentem. Odpowiadasz po polsku, jesteś pomocny, nie używasz emoji."; + "Jesteś asystentem. Odpowiadasz po polsku, jesteś pomocny."; // ── Convenience helpers for repeated Error::Custom patterns ──────────── -- cgit v1.2.3