diff --git a/point_system/students/context_processors.py b/point_system/students/context_processors.py index e44f670..686554c 100644 --- a/point_system/students/context_processors.py +++ b/point_system/students/context_processors.py @@ -1,9 +1,14 @@ +from django.utils import translation + def language_processor(request): """ Context processor to make current_lang available across all template renders. + Also activates Django's gettext translation so {% trans %} tags render correctly. Defaults to 'zh' (Traditional Chinese). """ lang = request.session.get('lang', 'zh') + target_lang = 'en' if lang == 'en' else 'zh-hant' + translation.activate(target_lang) return { 'current_lang': lang } diff --git a/point_system/students/templates/students/weekly_schedule.html b/point_system/students/templates/students/weekly_schedule.html index a0b6f64..bec2fba 100644 --- a/point_system/students/templates/students/weekly_schedule.html +++ b/point_system/students/templates/students/weekly_schedule.html @@ -16,12 +16,13 @@ {{ m1_year }}年{{ m1_month }}月 & {{ m2_year }}年{{ m2_month }}月 {% if user.is_authenticated %} -
+ {% endif %} @@ -59,6 +60,11 @@ +| 學號 | -姓名 | -學位類別 | -身分類別 | -
|---|---|---|---|
- {% if user.is_authenticated %}{% endif %}
- {{ student.student_id }}
- |
- {{ student.name }} | -- {% if student.degree_type == '博士生' %} - 博士生 - {% else %} - 碩士生 - {% endif %} - | -- {% if student.student_category == '在職生' %} - 在職生 - {% elif student.student_category == '交換中' %} - 交換中 - {% else %} - 一般生 - {% endif %} - | -
當日無排定報告者 (可拖曳學生至此)
- {% endif %} +| 學號 | +姓名 | +學位類別 | +身分類別 | +
|---|---|---|---|
+ {% if user.is_authenticated %}{% endif %}
+ {{ student.student_id }}
+ |
+ {{ student.name }} | ++ {% if student.degree_type == '博士生' %} + 博士生 + {% else %} + 碩士生 + {% endif %} + | ++ {% if student.student_category == '在職生' %} + 在職生 + {% elif student.student_category == '交換中' %} + 交換中 + {% else %} + 一般生 + {% endif %} + | +
當日無排定報告者 (可拖曳學生至此)
+ {% endif %}| 學號 | -姓名 | -學位類別 | -身分類別 | -
|---|---|---|---|
- {% if user.is_authenticated %}{% endif %}
- {{ student.student_id }}
- |
- {{ student.name }} | -- {% if student.degree_type == '博士生' %} - 博士生 - {% else %} - 碩士生 - {% endif %} - | -- {% if student.student_category == '在職生' %} - 在職生 - {% elif student.student_category == '交換中' %} - 交換中 - {% else %} - 一般生 - {% endif %} - | -
當日無排定報告者 (可拖曳學生至此)
- {% endif %} +| 學號 | +姓名 | +學位類別 | +身分類別 | +
|---|---|---|---|
+ {% if user.is_authenticated %}{% endif %}
+ {{ student.student_id }}
+ |
+ {{ student.name }} | ++ {% if student.degree_type == '博士生' %} + 博士生 + {% else %} + 碩士生 + {% endif %} + | ++ {% if student.student_category == '在職生' %} + 在職生 + {% elif student.student_category == '交換中' %} + 交換中 + {% else %} + 一般生 + {% endif %} + | +
當日無排定報告者 (可拖曳學生至此)
+ {% endif %}{{ row.student.student_id }}{{ row.student.student_id }}