fix(report): keep the English edition when one phrase was untranslated

The English personal report was discarded whenever a Chinese fragment survived the trailing glossary. English sections now render the English fields that were already calculated.

Co-Authored-By: Grok (agent loop)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jesse-ux
2026-10-22 02:56:00 +08:00
co-authored by Grok (agent loop) Cursor
parent 9812f31737
commit ba1ffeb35f
18 changed files with 815 additions and 53 deletions
+4
View File
@@ -2612,10 +2612,13 @@ def calc_panchanga(sun_lon: float, moon_lon: float, weekday: int,
if score_pct >= 0.75:
overall = '吉(Subha)'
overall_en = 'Auspicious (Subha)'
elif score_pct >= 0.5:
overall = '中(Mixed)'
overall_en = 'Mixed'
else:
overall = '凶(Asubha)'
overall_en = 'Inauspicious (Asubha)'
# 特殊凶时段检查
warnings = []
@@ -2637,6 +2640,7 @@ def calc_panchanga(sun_lon: float, moon_lon: float, weekday: int,
'hora': hora,
'overall_score': round(score_pct, 2),
'overall_quality': overall,
'overall_quality_en': overall_en,
'warnings': warnings,
'auspicious_count': sum(1 for _, q in elements if q == 'subha'),
'total_elements': len(elements),