feat: complete remaining page template localization
This commit is contained in:
1 parent
ec5e6a369d
commit
440e05a99e
17 files changed
+857
-840
No files matched your search
@@ -26,7 +26,7 @@ const hardcoded = completedViews.filter((name) => {
|
||||
})
|
||||
// These pages retain Chinese API values or editable business defaults in script.
|
||||
// Guard their templates separately, ignoring non-rendered comments.
|
||||
for (const name of ['TeachingMonitoringView.vue', 'AcademicPlanningView.vue', 'PersonnelView.vue', 'StatisticsView.vue', 'EvaluationView.vue', 'ApprovalCenterView.vue', 'StudentAttendanceView.vue', 'NotificationCenterView.vue', 'GradeAnalyticsView.vue', 'ExperimentGradesView.vue']) {
|
||||
for (const name of ['TeachingMonitoringView.vue', 'AcademicPlanningView.vue', 'PersonnelView.vue', 'StatisticsView.vue', 'EvaluationView.vue', 'ApprovalCenterView.vue', 'StudentAttendanceView.vue', 'NotificationCenterView.vue', 'GradeAnalyticsView.vue', 'ExperimentGradesView.vue', 'TimetableView.vue', 'TeacherAttendanceView.vue', 'GradesView.vue', 'ExamsView.vue', 'MakeupExamsView.vue', 'CurriculumView.vue', 'PhysicalFitnessView.vue', 'CourseSelectionView.vue', 'TeachingTasksView.vue', 'ComprehensiveAssessmentsView.vue', 'DormitoryHygieneView.vue', 'ExperimentsView.vue', 'SchedulesView.vue']) {
|
||||
const source = readFileSync(new URL(`../src/views/${name}`, import.meta.url), 'utf8')
|
||||
const start = source.indexOf('<template>')
|
||||
const end = source.lastIndexOf('</template>')
|
||||
@@ -38,7 +38,7 @@ const viewsDirectory = new URL('../src/views/', import.meta.url)
|
||||
const missingBatchReferences = []
|
||||
for (const name of readdirSync(viewsDirectory).filter((file) => file.endsWith('.vue'))) {
|
||||
const source = readFileSync(new URL(name, viewsDirectory), 'utf8')
|
||||
for (const match of source.matchAll(/t\(['"]((?:batchBusiness|workflowBatch)\.[^'"]+)['"]/g)) {
|
||||
for (const match of source.matchAll(/t\(['"]((?:batchBusiness|workflowBatch|timetableTemplate|teacherAttendanceTemplate|gradesTemplate|examsTemplate|curriculumTemplate|fitnessTemplate|selectionTemplate|teachingTaskTemplate|assessmentTemplate|dormTemplate|dormTemplateCounts|experimentsTemplate|experimentsDynamic|schedulesTemplate|schedulesDynamic)\.[^'"]+)['"]/g)) {
|
||||
if (!reference.has(match[1])) missingBatchReferences.push(`${name}: ${match[1]}`)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user