diff --git a/point_system/formats/__init__.py b/point_system/formats/__init__.py new file mode 100644 index 0000000..25f9d8a --- /dev/null +++ b/point_system/formats/__init__.py @@ -0,0 +1 @@ +# Package initialization for formats diff --git a/point_system/formats/en/__init__.py b/point_system/formats/en/__init__.py new file mode 100644 index 0000000..65eb672 --- /dev/null +++ b/point_system/formats/en/__init__.py @@ -0,0 +1 @@ +# Package initialization for formats.en diff --git a/point_system/formats/en/formats.py b/point_system/formats/en/formats.py new file mode 100644 index 0000000..ac59595 --- /dev/null +++ b/point_system/formats/en/formats.py @@ -0,0 +1,19 @@ +from django.conf.locale.en.formats import * + +DATE_INPUT_FORMATS = [ + '%Y-%m-%d', + '%Y/%m/%d', + '%Y.%m.%d', + '%Y年%m月%d日', + '%Y年%n月%j日', + '%m/%d/%Y', + '%m/%d/%y', + '%b %d %Y', + '%b %d, %Y', + '%d %b %Y', + '%d %b, %Y', + '%B %d %Y', + '%B %d, %Y', + '%d %B %Y', + '%d %B, %Y', +] diff --git a/point_system/formats/zh_Hant/__init__.py b/point_system/formats/zh_Hant/__init__.py new file mode 100644 index 0000000..cc72320 --- /dev/null +++ b/point_system/formats/zh_Hant/__init__.py @@ -0,0 +1 @@ +# Package initialization for formats.zh_hant diff --git a/point_system/formats/zh_Hant/formats.py b/point_system/formats/zh_Hant/formats.py new file mode 100644 index 0000000..d374059 --- /dev/null +++ b/point_system/formats/zh_Hant/formats.py @@ -0,0 +1 @@ +from formats.zh_Hant.formats import * diff --git a/point_system/locale/en/LC_MESSAGES/django.po b/point_system/locale/en/LC_MESSAGES/django.po index d354d5c..09cfa0b 100644 --- a/point_system/locale/en/LC_MESSAGES/django.po +++ b/point_system/locale/en/LC_MESSAGES/django.po @@ -225,5 +225,80 @@ msgstr "%(count)s time" msgid "無在學學生資料" msgstr "No active student data" +msgid "在學學生: %(count)s 人" +msgstr "Active Students: %(count)s" + +msgid "考勤紀錄提示:" +msgstr "Attendance Note: " + +msgid "請勾選要紀錄考勤簽到的學生,點擊「確認考勤簽到」按鈕即可批次寫入點名紀錄。" +msgstr "Please select the students to record attendance for and click \"Submit Attendance\" to save." + +msgid "學生考勤點名單" +msgstr "Student Attendance Checklist" + +msgid "全選" +msgstr "Select All" + +msgid "取消全選" +msgstr "Deselect All" + +msgid "搜尋學生姓名..." +msgstr "Search student name..." + +msgid "已勾選:" +msgstr "Selected: " + +msgid "確認考勤簽到" +msgstr "Submit Attendance" + +msgid "本次已成功紀錄考勤" +msgstr "Attendance Recorded Successfully" + +msgid "共 %(count)s 筆紀錄" +msgstr "%(count)s Record(s)" + +msgid "身分 / 學位" +msgstr "Category / Degree" + +msgid "考勤簽到時間" +msgstr "Attendance Timestamp" + +msgid "已簽到" +msgstr "Recorded" + +msgid "最新紀錄: %(count)s 筆" +msgstr "Latest Records: %(count)s" + +msgid "系統狀態: 即時記錄" +msgstr "Status: Real-time" + +msgid "顯示系統中最新輸入之 20 筆學生考勤簽到時間明細,點擊學生姓名或查看詳情可瀏覽個人完整簽到與報告紀錄。" +msgstr "Displays the 20 most recent student attendance records. Click student name or view details to see full history." + +msgid "最近 20 筆考勤簽到紀錄" +msgstr "Recent 20 Attendance Records" + +msgid "目前沒有考勤紀錄。" +msgstr "No attendance records found." + +msgid "統計學生數: %(count)s 人" +msgstr "Students Count: %(count)s" + +msgid "報表統計提示:" +msgstr "Report Summary: " + +msgid "統計各學生於去年度 (%(ly)s) 與本年度 (%(cy)s) 之累積考勤簽到次數總和。" +msgstr "Annual cumulative attendance counts for last year (%(ly)s) and current year (%(cy)s)." + +msgid "年度出席統計報表 (%(ly)s vs %(cy)s)" +msgstr "Annual Attendance Report (%(ly)s vs %(cy)s)" + +msgid "出席次數" +msgstr "Attendance Count" + +msgid "尚無符合條件之考勤統計資料" +msgstr "No attendance statistics available." + diff --git a/point_system/point_system/settings.py b/point_system/point_system/settings.py index c205e55..a738fea 100644 --- a/point_system/point_system/settings.py +++ b/point_system/point_system/settings.py @@ -147,6 +147,21 @@ LOCALE_PATHS = [ BASE_DIR / 'locale', ] +FORMAT_MODULE_PATH = [ + 'formats', +] + +DATE_INPUT_FORMATS = [ + '%Y-%m-%d', + '%Y/%m/%d', + '%Y.%m.%d', + '%Y年%m月%d日', + '%Y年%n月%j日', + '%m/%d/%Y', + '%m/%d/%y', +] + + # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/5.2/howto/static-files/ diff --git a/point_system/static/weekly_schedule_en.html b/point_system/static/weekly_schedule_en.html index 3a61d0d..704cd07 100644 --- a/point_system/static/weekly_schedule_en.html +++ b/point_system/static/weekly_schedule_en.html @@ -77,7 +77,7 @@
© 2023-2026 1218 Lab. All rights reserved.
-Active Directory DC: dc1.samdom.mdi.bar (Domain: samdom.mdi.bar)
-
Active Directory Single Sign-On
| 學號 | -姓名 | -{{ last_year }} 出席次數 | -{{ current_year }} 出席次數 | -
|---|---|---|---|
| {{ entry.student.student_id }} | -{{ entry.student.name }} | -{{ entry.last_year_count }} | -{{ entry.current_year_count }} | -
| # | +{% trans "姓名" %} | +{% trans "身分 / 學位" %} | +{{ last_year }} {% trans "出席次數" %} | +{{ current_year }} {% trans "出席次數" %} | +
|---|---|---|---|---|
| {{ forloop.counter }} | ++ {% get_current_language as CURRENT_LANG %} + {% if CURRENT_LANG == 'en' and entry.student.foreign_alias %} + {{ entry.student.foreign_alias }} + {% else %} + {{ entry.student.name }} + {% endif %} + | ++ {% if entry.student.degree_type == '博士生' %} + {% trans "博士生" %} + {% elif entry.student.degree_type == '學士生' %} + {% trans "學士生" %} + {% else %} + {% trans "碩士生" %} + {% endif %} + + {% if entry.student.student_category == '在職生' %} + {% trans "在職生" %} + {% elif entry.student.student_category == '交換中' %} + {% trans "交換中" %} + {% else %} + {% trans "一般生" %} + {% endif %} + | ++ {{ entry.last_year_count }} + | ++ {{ entry.current_year_count }} + | +
username) 或完整 UPN (例如: username@samdom.mdi.bar)。username) 或完整 UPN (例如: username@domain)。| 學生姓名 | -學號 | -考勤時間 | +# | +{% trans "姓名" %} | +{% trans "身分 / 學位" %} | +{% trans "考勤簽到時間" %} |
|---|---|---|---|---|---|---|
| {{ record.student.name }} | -{{ record.student.student_id }} | -{{ record.datetime|date:"Y-m-d H:i:s" }} | +{{ forloop.counter }} | ++ {% get_current_language as CURRENT_LANG %} + {% if CURRENT_LANG == 'en' and record.student.foreign_alias %} + {{ record.student.foreign_alias }} + {% else %} + {{ record.student.name }} + {% endif %} + | ++ {% if record.student.degree_type == '博士生' %} + {% trans "博士生" %} + {% elif record.student.degree_type == '學士生' %} + {% trans "學士生" %} + {% else %} + {% trans "碩士生" %} + {% endif %} + + {% if record.student.student_category == '在職生' %} + {% trans "在職生" %} + {% elif record.student.student_category == '交換中' %} + {% trans "交換中" %} + {% else %} + {% trans "一般生" %} + {% endif %} + | ++ {{ record.datetime|timezone:"Asia/Taipei"|date:"Y-m-d H:i:s" }} + |
目前沒有考勤紀錄。
- {% endif %} + {% else %} +