From f89de0699a54e668c8269dc789f607fed28a67ca Mon Sep 17 00:00:00 2001 From: WhatDidYouExpect <89535984+WhatDidYouExpect@users.noreply.github.com> Date: Wed, 2 Jul 2025 15:58:51 +0200 Subject: [PATCH] finish up the translations --- assets/locales/en.json | 3 +++ assets/locales/it.json | 3 +++ bot.py | 6 +++--- modules/image.py | 2 +- modules/sentenceprocessing.py | 4 ++-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/assets/locales/en.json b/assets/locales/en.json index 6d5093b..b8a7887 100644 --- a/assets/locales/en.json +++ b/assets/locales/en.json @@ -1,4 +1,7 @@ { + "active_users:": "Active users:", + "spacy_initialized": "spaCy and spacytextblob are ready.", + "spacy_model_not_found": "The spaCy model was not found! Downloading it....`", "env_file_not_found": "The .env file was not found! Please create one with the required variables.", "error_fetching_active_users": "Error fetching active users: {error}", "error_sending_alive_ping": "Error sending alive ping: {error}", diff --git a/assets/locales/it.json b/assets/locales/it.json index 60c1ed5..4e24440 100644 --- a/assets/locales/it.json +++ b/assets/locales/it.json @@ -1,4 +1,7 @@ { + "active_users:": "Utenti attivi:", + "spacy_initialized": "spaCy e spacytextblob sono pronti.", + "spacy_model_not_found": "Il modello spaCy non è stato trovato! Lo sto scaricando...", "env_file_not_found": "Il file .env non è stato trovato! Crea un file con le variabili richieste.", "error fetching_active_users": "Errore nel recupero degli utenti attivi:", "error_sending_alive_ping": "Errore nell'invio di aliveping:", diff --git a/bot.py b/bot.py index ee60c49..c04abaf 100644 --- a/bot.py +++ b/bot.py @@ -109,11 +109,11 @@ async def on_ready(): print(f"{GREEN}{get_translation(LOCALE, 'synced_commands')} {len(synced)} {get_translation(LOCALE, 'synced_commands2')} {RESET}") slash_commands_enabled = True ping_server() # ping_server from modules/central.py - # --- Mostra utenti attivi --- + # I FORGOT TO REMOVE THE ITALIAN VERSION FUCKKKKKKKKK active_users = await fetch_active_users() - print(f"{GREEN}Utenti attivi: {active_users}{RESET}") + print(f"{GREEN}{get_translation(LOCALE, 'active_users:')} {active_users}{RESET}") print(f"{GREEN}{get_translation(LOCALE, 'started').format(name=NAME)}{RESET}") - # --- Avvia il task periodico --- + bot.loop.create_task(send_alive_ping_periodically()) except discord.errors.Forbidden as perm_error: print(f"{RED}Permission error while syncing commands: {perm_error}{RESET}") diff --git a/modules/image.py b/modules/image.py index 87a5dbd..af7dcb8 100644 --- a/modules/image.py +++ b/modules/image.py @@ -3,7 +3,7 @@ import re from PIL import Image, ImageDraw, ImageFont from modules.markovmemory import load_markov_model from modules.sentenceprocessing import improve_sentence_coherence, rephrase_for_coherence - +# add comments l8r generated_sentences = set() async def gen_image(input_image_path, sentence_size=5, max_attempts=10): diff --git a/modules/sentenceprocessing.py b/modules/sentenceprocessing.py index ac3a9e6..df64161 100644 --- a/modules/sentenceprocessing.py +++ b/modules/sentenceprocessing.py @@ -13,12 +13,12 @@ def check_resources(): try: nlp = spacy.load("en_core_web_sm") except OSError: - print("spaCy model not found. Downloading en_core_web_sm...") + print(get_translation(LOCALE, 'spacy_model_not_found')) spacy.cli.download("en_core_web_sm") nlp = spacy.load("en_core_web_sm") if "spacytextblob" not in nlp.pipe_names: nlp.add_pipe("spacytextblob") - print("spaCy model and spacytextblob are ready.") + print(get_translation(LOCALE, 'spacy_initialized')) check_resources()