feat(i18n): Implement server-side internationalization support

- Added ServerI18nManager to handle translations and locale settings on the server.
- Integrated server-side translations into templates, reducing language flashing on initial load.
- Created API endpoints for setting and getting user language preferences.
- Enhanced client-side i18n handling to work seamlessly with server-rendered content.
- Updated various templates to utilize the new translation system.
- Added mixed i18n handler to coordinate server and client translations, improving user experience.
- Expanded translation files to include initialization messages for various components.
This commit is contained in:
Will Miao
2025-08-30 16:56:56 +08:00
parent 3c9e402bc0
commit 29160bd6e5
14 changed files with 775 additions and 42 deletions

View File

@@ -1,6 +1,6 @@
{% extends "base.html" %}
{% block title %}LoRA Manager{% endblock %}
{% block title %}{{ t('header.appTitle') }}{% endblock %}
{% block page_id %}loras{% endblock %}
{% block preload %}
@@ -9,8 +9,8 @@
{% endif %}
{% endblock %}
{% block init_title %}Initializing LoRA Manager{% endblock %}
{% block init_message %}Scanning and building LoRA cache. This may take a few minutes...{% endblock %}
{% block init_title %}{{ t('initialization.loras.title') }}{% endblock %}
{% block init_message %}{{ t('initialization.loras.message') }}{% endblock %}
{% block init_check_url %}/api/loras/list?page=1&page_size=1{% endblock %}
{% block content %}