From c2c1ce46d162037ee8069521e7f9f0523133fbac Mon Sep 17 00:00:00 2001 From: bridge Date: Tue, 3 Feb 2026 21:44:17 +0800 Subject: [PATCH] chore: remove unused Docker and localization files - Deleted Dockerfiles for backend and frontend, along with the associated Nginx configuration and localization debugging script, to streamline the project structure and eliminate unnecessary files. --- debug_i18n.py | 33 ------------------- .../Dockerfile.backend | 0 .../Dockerfile.frontend | 2 +- nginx.conf => deploy/nginx.conf | 0 docker-compose.yml | 4 +-- 5 files changed, 3 insertions(+), 36 deletions(-) delete mode 100644 debug_i18n.py rename Dockerfile.backend => deploy/Dockerfile.backend (100%) rename Dockerfile.frontend => deploy/Dockerfile.frontend (90%) rename nginx.conf => deploy/nginx.conf (100%) diff --git a/debug_i18n.py b/debug_i18n.py deleted file mode 100644 index 5f49b8c..0000000 --- a/debug_i18n.py +++ /dev/null @@ -1,33 +0,0 @@ -import sys -import os -from pathlib import Path - -# Add src to sys.path -sys.path.append(os.getcwd()) - -from src.classes.language import language_manager -from src.i18n import t, reload_translations, _get_translation, _get_current_lang - -print(f"Initial Language: {_get_current_lang()}") - -# Try translating without setting language (should be zh-CN by default per LanguageManager) -print(f"Default 'History' translation: {t('History')}") - -# Explicitly set to zh-CN -print("Setting language to zh-CN...") -language_manager.set_language("zh-CN") -print(f"Current Language: {_get_current_lang()}") -print(f"Translated 'History': {t('History')}") -print(f"Translated 'Killed by {{killer}}': {t('Killed by {killer}', killer='张三')}") - -# Check internal translation object -trans = _get_translation() -print(f"Translation Object: {trans}") -if trans: - print(f"Info: {trans.info()}") - -# Check file paths -locale_dir = Path("src/i18n/locales") -mo_path = locale_dir / "zh_CN" / "LC_MESSAGES" / "messages.mo" -print(f"MO file exists: {mo_path.exists()}") -print(f"MO file absolute path: {mo_path.absolute()}") diff --git a/Dockerfile.backend b/deploy/Dockerfile.backend similarity index 100% rename from Dockerfile.backend rename to deploy/Dockerfile.backend diff --git a/Dockerfile.frontend b/deploy/Dockerfile.frontend similarity index 90% rename from Dockerfile.frontend rename to deploy/Dockerfile.frontend index 6053da6..fa8e031 100644 --- a/Dockerfile.frontend +++ b/deploy/Dockerfile.frontend @@ -22,7 +22,7 @@ FROM nginx:alpine COPY --from=builder /app/dist /usr/share/nginx/html # 复制 Nginx 配置 -COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf # 暴露端口 EXPOSE 80 diff --git a/nginx.conf b/deploy/nginx.conf similarity index 100% rename from nginx.conf rename to deploy/nginx.conf diff --git a/docker-compose.yml b/docker-compose.yml index a4086f2..4003512 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: backend: build: context: . - dockerfile: Dockerfile.backend + dockerfile: deploy/Dockerfile.backend container_name: cultivation-backend ports: - "8002:8002" @@ -25,7 +25,7 @@ services: frontend: build: context: . - dockerfile: Dockerfile.frontend + dockerfile: deploy/Dockerfile.frontend container_name: cultivation-frontend ports: - "8123:80"