From 87785494d62198b83e7118955c75d7fafe998675 Mon Sep 17 00:00:00 2001
From: Zichao Lin
Date: Mon, 6 Jul 2026 22:41:09 +0800
Subject: [PATCH] feat(i18n): add English localization with per-user language
preference
---
app/i18n.py | 9 +++
app/templates/admin_invites.html | 2 +-
app/templates/dashboard.html | 112 +++++++++++++++++++++--------
app/templates/postcard_form.html | 6 ++
app/templates/profiles.html | 27 ++++---
app/templates/settings.html | 91 ++++++++++++++++-------
app/templates/showcase.html | 90 +++++++++++++++--------
app/templates/showcase_manage.html | 4 +-
8 files changed, 243 insertions(+), 98 deletions(-)
diff --git a/app/i18n.py b/app/i18n.py
index 014827d..478fd4d 100644
--- a/app/i18n.py
+++ b/app/i18n.py
@@ -33,6 +33,14 @@ _translations: dict[str, dict[str, str]] = {
"dash.countries": {"zh": "国家/地区", "en": "Countries"},
"dash.chart_sent": {"zh": "📤 寄出", "en": "📤 Sent"},
"dash.chart_received": {"zh": "📬 收到", "en": "📬 Received"},
+ "dash.recent": {"zh": "最近动态", "en": "Recent activity"},
+ "dash.empty": {"zh": "暂无明信片", "en": "No postcards yet"},
+ "dash.welcome_title": {"zh": "欢迎使用星笺!", "en": "Welcome to Mailova!"},
+ "dash.welcome_hint": {"zh": "创建一个", "en": "Create a"},
+ "dash.welcome_hint2": {"zh": " 开始管理你的明信片", "en": " to start managing your postcards"},
+ "dash.today": {"zh": "今天", "en": "Today"},
+ "dash.yesterday": {"zh": "昨天", "en": "Yesterday"},
+ "dash.days_ago": {"zh": "天前", "en": " days ago"},
# ── Profiles ──
"profiles.title": {"zh": "Profile", "en": "Profiles"},
@@ -159,6 +167,7 @@ _translations: dict[str, dict[str, str]] = {
"invites.max_uses": {"zh": "最大使用次数", "en": "Max uses"},
"invites.expires_time": {"zh": "过期时间", "en": "Expiration"},
"invites.registered_users": {"zh": "注册用户", "en": "Registered users"},
+ "invites.empty": {"zh": "暂无邀请码", "en": "No invite codes yet"},
# ── Showcase (public) ──
"showcase.title": {"zh": " 的明信片", "en": "'s postcards"},
diff --git a/app/templates/admin_invites.html b/app/templates/admin_invites.html
index d0c0751..51dc860 100644
--- a/app/templates/admin_invites.html
+++ b/app/templates/admin_invites.html
@@ -93,7 +93,7 @@
{% else %}
🔑
-
{{ 'invites.title'|t(user.language) }}
+
{{ 'invites.empty'|t(user.language) }}
{% endif %}
diff --git a/app/templates/dashboard.html b/app/templates/dashboard.html
index 487c47d..d855759 100644
--- a/app/templates/dashboard.html
+++ b/app/templates/dashboard.html
@@ -76,45 +76,97 @@
{% endif %}
{% endif %}
-{% if profiles %}
{% endfor %}
{% else %}
-{{ 'profiles.new_ph'|t(user.language) }}
+
+
📮
+
还没有 Profile
+
{{ 'profiles.new_ph'|t(user.language) }}
+
{% endif %}
-
{% endblock %}
diff --git a/app/templates/settings.html b/app/templates/settings.html
index 29d3ca8..ee07747 100644
--- a/app/templates/settings.html
+++ b/app/templates/settings.html
@@ -76,37 +76,83 @@
-{% if profiles %}
{{ 'settings.profiles_showcase'|t(user.language) }}
+ {% if profiles %}
{% for p in profiles %}
-
{% endif %}
-
-
-
-
-
+
+
+
+
![]()
-
+
{% endblock %}
diff --git a/app/templates/showcase_manage.html b/app/templates/showcase_manage.html
index 1601e36..861a92d 100644
--- a/app/templates/showcase_manage.html
+++ b/app/templates/showcase_manage.html
@@ -54,7 +54,7 @@
{% if p.showcase_enabled and pc_list %}
-
{{ 'profile_showcase.single_control'|t(user.language) }}:
+
单张明信片展示控制(关闭展示后可单独隐藏):
{% for pc in pc_list %}
{% endfor %}