Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions lib/i18n/en-US.i18n.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,27 @@ nav:
courseTable: Courses
scores: Scores
profile: Me
score:
loadFailed: Failed to load scores
refreshSuccess: Scores updated
refreshFailed: Failed to refresh scores
noRecords: No score records found
noScoresThisSemester: No scores for this semester
courseNumber: "No: ${number} Code: ${code}"
none: N/A
summary:
cumulativeGpa: Cumulative GPA
conduct: Conduct
semesterAverage: Semester Avg
creditsPassed: Credits Passed
totalCredits: Total Credits
status:
notEntered: Not entered
withdraw: Withdrawn
undelivered: Not submitted
pass: Pass
fail: Fail
creditTransfer: Credit transfer
courseTable:
notFound: Course table not found
dayOfWeek(map):
Expand Down
2 changes: 1 addition & 1 deletion lib/i18n/strings.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// To regenerate, run: `dart run slang`
///
/// Locales: 2
/// Strings: 202 (101 per locale)
/// Strings: 238 (119 per locale)

// coverage:ignore-file
// ignore_for_file: type=lint, unused_import
Expand Down
66 changes: 66 additions & 0 deletions lib/i18n/strings_en_US.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class TranslationsEnUs extends Translations with BaseTranslations<AppLocale, Tra
@override late final _TranslationsIntroEnUs intro = _TranslationsIntroEnUs._(_root);
@override late final _TranslationsLoginEnUs login = _TranslationsLoginEnUs._(_root);
@override late final _TranslationsNavEnUs nav = _TranslationsNavEnUs._(_root);
@override late final _TranslationsScoreEnUs score = _TranslationsScoreEnUs._(_root);
@override late final _TranslationsCourseTableEnUs courseTable = _TranslationsCourseTableEnUs._(_root);
@override late final _TranslationsProfileEnUs profile = _TranslationsProfileEnUs._(_root);
@override late final _TranslationsEnrollmentStatusEnUs enrollmentStatus = _TranslationsEnrollmentStatusEnUs._(_root);
Expand Down Expand Up @@ -132,6 +133,24 @@ class _TranslationsNavEnUs extends TranslationsNavZhTw {
@override String get profile => 'Me';
}

// Path: score
class _TranslationsScoreEnUs extends TranslationsScoreZhTw {
_TranslationsScoreEnUs._(TranslationsEnUs root) : this._root = root, super.internal(root);

final TranslationsEnUs _root; // ignore: unused_field

// Translations
@override String get loadFailed => 'Failed to load scores';
@override String get refreshSuccess => 'Scores updated';
@override String get refreshFailed => 'Failed to refresh scores';
@override String get noRecords => 'No score records found';
@override String get noScoresThisSemester => 'No scores for this semester';
@override String courseNumber({required Object number, required Object code}) => 'No: ${number} Code: ${code}';
@override String get none => 'N/A';
@override late final _TranslationsScoreSummaryEnUs summary = _TranslationsScoreSummaryEnUs._(_root);
@override late final _TranslationsScoreStatusEnUs status = _TranslationsScoreStatusEnUs._(_root);
}

// Path: courseTable
class _TranslationsCourseTableEnUs extends TranslationsCourseTableZhTw {
_TranslationsCourseTableEnUs._(TranslationsEnUs root) : this._root = root, super.internal(root);
Expand Down Expand Up @@ -223,6 +242,35 @@ class _TranslationsLoginErrorsEnUs extends TranslationsLoginErrorsZhTw {
@override String get mobileVerificationRequired => 'Mobile phone verification is required. Please complete it on the NTUT portal.';
}

// Path: score.summary
class _TranslationsScoreSummaryEnUs extends TranslationsScoreSummaryZhTw {
_TranslationsScoreSummaryEnUs._(TranslationsEnUs root) : this._root = root, super.internal(root);

final TranslationsEnUs _root; // ignore: unused_field

// Translations
@override String get cumulativeGpa => 'Cumulative GPA';
@override String get conduct => 'Conduct';
@override String get semesterAverage => 'Semester Avg';
@override String get creditsPassed => 'Credits Passed';
@override String get totalCredits => 'Total Credits';
}

// Path: score.status
class _TranslationsScoreStatusEnUs extends TranslationsScoreStatusZhTw {
_TranslationsScoreStatusEnUs._(TranslationsEnUs root) : this._root = root, super.internal(root);

final TranslationsEnUs _root; // ignore: unused_field

// Translations
@override String get notEntered => 'Not entered';
@override String get withdraw => 'Withdrawn';
@override String get undelivered => 'Not submitted';
@override String get pass => 'Pass';
@override String get fail => 'Fail';
@override String get creditTransfer => 'Credit transfer';
}

// Path: profile.sections
class _TranslationsProfileSectionsEnUs extends TranslationsProfileSectionsZhTw {
_TranslationsProfileSectionsEnUs._(TranslationsEnUs root) : this._root = root, super.internal(root);
Expand Down Expand Up @@ -392,6 +440,24 @@ extension on TranslationsEnUs {
'nav.courseTable' => 'Courses',
'nav.scores' => 'Scores',
'nav.profile' => 'Me',
'score.loadFailed' => 'Failed to load scores',
'score.refreshSuccess' => 'Scores updated',
'score.refreshFailed' => 'Failed to refresh scores',
'score.noRecords' => 'No score records found',
'score.noScoresThisSemester' => 'No scores for this semester',
'score.courseNumber' => ({required Object number, required Object code}) => 'No: ${number} Code: ${code}',
'score.none' => 'N/A',
'score.summary.cumulativeGpa' => 'Cumulative GPA',
'score.summary.conduct' => 'Conduct',
'score.summary.semesterAverage' => 'Semester Avg',
'score.summary.creditsPassed' => 'Credits Passed',
'score.summary.totalCredits' => 'Total Credits',
'score.status.notEntered' => 'Not entered',
'score.status.withdraw' => 'Withdrawn',
'score.status.undelivered' => 'Not submitted',
'score.status.pass' => 'Pass',
'score.status.fail' => 'Fail',
'score.status.creditTransfer' => 'Credit transfer',
'courseTable.notFound' => 'Course table not found',
'courseTable.dayOfWeek.sunday' => 'Sun',
'courseTable.dayOfWeek.monday' => 'Mon',
Expand Down
103 changes: 103 additions & 0 deletions lib/i18n/strings_zh_TW.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Translations with BaseTranslations<AppLocale, Translations> {
late final TranslationsIntroZhTw intro = TranslationsIntroZhTw.internal(_root);
late final TranslationsLoginZhTw login = TranslationsLoginZhTw.internal(_root);
late final TranslationsNavZhTw nav = TranslationsNavZhTw.internal(_root);
late final TranslationsScoreZhTw score = TranslationsScoreZhTw.internal(_root);
late final TranslationsCourseTableZhTw courseTable = TranslationsCourseTableZhTw.internal(_root);
late final TranslationsProfileZhTw profile = TranslationsProfileZhTw.internal(_root);
late final TranslationsEnrollmentStatusZhTw enrollmentStatus = TranslationsEnrollmentStatusZhTw.internal(_root);
Expand Down Expand Up @@ -187,6 +188,39 @@ class TranslationsNavZhTw {
String get profile => '我';
}

// Path: score
class TranslationsScoreZhTw {
TranslationsScoreZhTw.internal(this._root);

final Translations _root; // ignore: unused_field

// Translations

/// zh-TW: '成績載入失敗'
String get loadFailed => '成績載入失敗';

/// zh-TW: '成績資料已更新'
String get refreshSuccess => '成績資料已更新';

/// zh-TW: '成績更新失敗'
String get refreshFailed => '成績更新失敗';

/// zh-TW: '目前沒有任何成績紀錄'
String get noRecords => '目前沒有任何成績紀錄';

/// zh-TW: '本學期尚無成績'
String get noScoresThisSemester => '本學期尚無成績';

/// zh-TW: '課號: ${number} 編碼: ${code}'
String courseNumber({required Object number, required Object code}) => '課號: ${number} 編碼: ${code}';

/// zh-TW: '無'
String get none => '無';

late final TranslationsScoreSummaryZhTw summary = TranslationsScoreSummaryZhTw.internal(_root);
late final TranslationsScoreStatusZhTw status = TranslationsScoreStatusZhTw.internal(_root);
}

// Path: courseTable
class TranslationsCourseTableZhTw {
TranslationsCourseTableZhTw.internal(this._root);
Expand Down Expand Up @@ -322,6 +356,57 @@ class TranslationsLoginErrorsZhTw {
String get mobileVerificationRequired => '需要進行手機驗證,請至校園入口網站完成驗證';
}

// Path: score.summary
class TranslationsScoreSummaryZhTw {
TranslationsScoreSummaryZhTw.internal(this._root);

final Translations _root; // ignore: unused_field

// Translations

/// zh-TW: '歷年GPA'
String get cumulativeGpa => '歷年GPA';

/// zh-TW: '操行成績'
String get conduct => '操行成績';

/// zh-TW: '學期平均'
String get semesterAverage => '學期平均';

/// zh-TW: '實得學分'
String get creditsPassed => '實得學分';

/// zh-TW: '修課總學分'
String get totalCredits => '修課總學分';
}

// Path: score.status
class TranslationsScoreStatusZhTw {
TranslationsScoreStatusZhTw.internal(this._root);

final Translations _root; // ignore: unused_field

// Translations

/// zh-TW: '未輸入'
String get notEntered => '未輸入';

/// zh-TW: '撤選'
String get withdraw => '撤選';

/// zh-TW: '未送成績'
String get undelivered => '未送成績';

/// zh-TW: '通過'
String get pass => '通過';

/// zh-TW: '不通過'
String get fail => '不通過';

/// zh-TW: '抵免'
String get creditTransfer => '抵免';
}

// Path: profile.sections
class TranslationsProfileSectionsZhTw {
TranslationsProfileSectionsZhTw.internal(this._root);
Expand Down Expand Up @@ -571,6 +656,24 @@ extension on Translations {
'nav.courseTable' => '課表',
'nav.scores' => '成績',
'nav.profile' => '我',
'score.loadFailed' => '成績載入失敗',
'score.refreshSuccess' => '成績資料已更新',
'score.refreshFailed' => '成績更新失敗',
'score.noRecords' => '目前沒有任何成績紀錄',
'score.noScoresThisSemester' => '本學期尚無成績',
'score.courseNumber' => ({required Object number, required Object code}) => '課號: ${number} 編碼: ${code}',
'score.none' => '無',
'score.summary.cumulativeGpa' => '歷年GPA',
'score.summary.conduct' => '操行成績',
'score.summary.semesterAverage' => '學期平均',
'score.summary.creditsPassed' => '實得學分',
'score.summary.totalCredits' => '修課總學分',
'score.status.notEntered' => '未輸入',
'score.status.withdraw' => '撤選',
'score.status.undelivered' => '未送成績',
'score.status.pass' => '通過',
'score.status.fail' => '不通過',
'score.status.creditTransfer' => '抵免',
'courseTable.notFound' => '找不到課表',
'courseTable.dayOfWeek.sunday' => '日',
'courseTable.dayOfWeek.monday' => '一',
Expand Down
21 changes: 21 additions & 0 deletions lib/i18n/zh-TW.i18n.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,27 @@ nav:
courseTable: 課表
scores: 成績
profile: 我
score:
loadFailed: 成績載入失敗
refreshSuccess: 成績資料已更新
refreshFailed: 成績更新失敗
noRecords: 目前沒有任何成績紀錄
noScoresThisSemester: 本學期尚無成績
courseNumber: "課號: ${number} 編碼: ${code}"
none: 無
summary:
cumulativeGpa: 歷年GPA
conduct: 操行成績
semesterAverage: 學期平均
creditsPassed: 實得學分
totalCredits: 修課總學分
status:
notEntered: 未輸入
withdraw: 撤選
undelivered: 未送成績
pass: 通過
fail: 不通過
creditTransfer: 抵免
courseTable:
notFound: 找不到課表
dayOfWeek(map):
Expand Down
13 changes: 13 additions & 0 deletions lib/screens/main/score/score_providers.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:tattoo/repositories/auth_repository.dart';
import 'package:tattoo/repositories/student_repository.dart';

/// Provides semester records (scores, GPA, rankings) for the score screen.
final semesterRecordsProvider =
FutureProvider.autoDispose<List<SemesterRecordData>>((ref) async {
try {
return await ref.watch(studentRepositoryProvider).getSemesterRecords();
} on NotLoggedInException {
return [];
}
});
Loading
Loading