Files
NextEdu/tmp_append_en.ps1
SpecialX 0e63c24ed9
Some checks failed
CI / scheduled-backup (push) Has been skipped
CI / backup-verify (push) Has been skipped
CI / weekly-dr-drill (push) Failing after 0s
CI / build-deploy (push) Has been cancelled
CI / security-scan (push) Has been cancelled
feat(shared,tests): add error boundaries, lib utils, i18n messages, and integration tests
shared:

- Add class-filter, error-state, route-error, section-error-boundary, widget-boundary components

- Add ui/alert component

- Add constants directory

- Add breached-password, export-utils, permission-bitmap, rate-limit, resolve-action-error, route-permissions, route-resolver, type-guards lib

- Add i18n messages (en, zh-CN) for invitation-codes, parent, questions, rbac

tests:

- Add integration tests for elective

- Add tests/setup/empty-stub

scripts:

- Add update-md.cjs, tmp_append_en.ps1, tmp_merge_en.ps1 utilities
2026-07-03 10:26:38 +08:00

225 lines
7.2 KiB
PowerShell

$path = "e:\Desktop\CICD\src\shared\i18n\messages\en\lesson-preparation.json"
$content = Get-Content -Raw $path
# Find the final closing brace of the "confirm" object + outer object
$marker = ' "archiveTitle": "Confirm Archive"' + "`r`n" + ' }' + "`r`n" + '}'
$markerLF = ' "archiveTitle": "Confirm Archive"' + "`n" + ' }' + "`n" + '}'
$appendix = @'
},
"calendar": {
"title": "Lesson Plan Calendar",
"description": "View lesson preparation activities by date",
"weekView": "Week",
"monthView": "Month",
"today": "Today",
"prev": "Previous",
"next": "Next",
"noEvents": "No activities on this day",
"loading": "Loading...",
"loadFailed": "Failed to load calendar",
"eventType": {
"created": "Created",
"updated": "Updated",
"version_saved": "Version Saved",
"submitted": "Submitted",
"published": "Published",
"reviewed": "Reviewed"
},
"eventMeta": "v{versionNo}",
"weekDays": {
"sun": "Sun",
"mon": "Mon",
"tue": "Tue",
"wed": "Wed",
"thu": "Thu",
"fri": "Fri",
"sat": "Sat"
}
},
"review": {
"title": "Review Workflow",
"submit": "Submit for Review",
"withdraw": "Withdraw Submission",
"approve": "Approve",
"reject": "Reject",
"submitConfirm": "Submit for review? You cannot edit after submission until reviewed.",
"withdrawConfirm": "Withdraw submission? The plan will return to draft status.",
"approveConfirm": "Approve this lesson plan?",
"rejectConfirm": "Reject this lesson plan? The teacher can revise and resubmit.",
"commentLabel": "Review Comment",
"commentPlaceholder": "Enter review comment (optional)",
"submitted": "Submitted for Review",
"approved": "Approved",
"rejected": "Rejected",
"withdrawn": "Withdrawn",
"reviewerLabel": "Reviewer: {name}",
"reviewAt": "Reviewed at: {time}",
"records": "Review Records",
"noRecords": "No review records",
"pendingTitle": "Pending Review",
"pendingEmpty": "No pending reviews",
"invalidTransition": "Invalid status transition",
"notSubmitted": "Cannot submit for review in current status",
"notReviewable": "Cannot review in current status",
"submitSuccess": "Submitted for review",
"withdrawSuccess": "Submission withdrawn",
"approveSuccess": "Approved",
"rejectSuccess": "Rejected"
},
"comment": {
"title": "Collaboration Comments",
"add": "Post Comment",
"reply": "Reply",
"placeholder": "Enter comment...",
"empty": "No comments",
"resolve": "Mark as Resolved",
"reopen": "Reopen",
"resolved": "Resolved",
"unresolved": "Unresolved",
"delete": "Delete",
"deleteConfirm": "Delete this comment? Replies will also be deleted.",
"edit": "Edit",
"unresolvedCount": "{count} unresolved",
"blockLabel": "Block: {title}",
"createSuccess": "Comment posted",
"deleteSuccess": "Deleted",
"resolveSuccess": "Marked as resolved",
"createFailed": "Failed to post comment",
"deleteFailed": "Failed to delete comment"
},
"formative": {
"title": "Formative Assessment",
"add": "Add Interaction",
"empty": "No interactions",
"interactionType": {
"poll": "Poll",
"quiz": "Quiz",
"exit_ticket": "Exit Ticket"
},
"promptLabel": "Prompt",
"promptPlaceholder": "Enter prompt...",
"optionsLabel": "Options",
"addOption": "+ Add Option",
"correctAnswer": "Correct Answer",
"durationLabel": "Duration (sec)",
"responses": "Student Responses",
"noResponses": "No responses",
"stats": "Statistics",
"totalResponses": "{count} responses",
"correctRate": "Correct rate {rate}%",
"avgDuration": "Avg {sec} sec",
"createSuccess": "Added",
"updateSuccess": "Updated",
"deleteSuccess": "Deleted"
},
"attachment": {
"title": "Attachments",
"add": "Add Attachment",
"empty": "No attachments",
"type": {
"reference": "Reference",
"material": "Material",
"supplementary": "Supplementary"
},
"nameLabel": "Name",
"urlLabel": "URL",
"typeLabel": "Type",
"createSuccess": "Attachment added",
"deleteSuccess": "Attachment deleted",
"updateSuccess": "Attachment updated"
},
"substitute": {
"title": "Substitute Teacher",
"add": "Add Substitute",
"empty": "No substitute records",
"originalTeacher": "Original Teacher",
"substituteTeacher": "Substitute Teacher",
"startDate": "Start Date",
"endDate": "End Date",
"status": {
"active": "Active",
"expired": "Expired",
"cancelled": "Cancelled"
},
"createSuccess": "Substitute arranged",
"updateSuccess": "Substitute status updated",
"deleteSuccess": "Substitute deleted",
"cancelConfirm": "Cancel this substitute arrangement?"
},
"evaluation": {
"title": "AI Evaluation",
"run": "Run Evaluation",
"running": "Evaluating...",
"empty": "No evaluation records",
"overallScore": "Overall Score",
"dimensions": {
"clarity": "Clarity",
"alignment": "Standards Alignment",
"engagement": "Engagement",
"differentiation": "Differentiation",
"assessment": "Assessment"
},
"suggestions": "Suggestions",
"noSuggestions": "No suggestions",
"createSuccess": "Evaluation completed",
"suggestion": {
"addMoreNodeDetails": "Add more details in teaching nodes",
"linkMoreStandards": "Link more curriculum standards",
"addFormativeItems": "Add classroom interactions",
"addPracticeBlock": "Add practice block",
"addHomeworkBlock": "Specify homework requirements"
}
},
"analytics": {
"title": "Analytics",
"teacherInvestment": "Teacher Investment",
"templateUsage": "Template Usage",
"standardsCoverage": "Standards Coverage",
"globalStats": "Overview",
"totalTeachers": "Teachers",
"totalPlans": "Total Plans",
"totalPublished": "Published",
"totalSubmitted": "Pending Review",
"totalStandardsLinked": "Standards Linked",
"noData": "No data",
"loadFailed": "Failed to load analytics"
},
"standards": {
"title": "Standards Alignment",
"link": "Link Standard",
"unlink": "Unlink",
"linked": "{count} linked",
"empty": "No linked standards",
"searchPlaceholder": "Search standards...",
"level": {
"national": "National",
"curriculum": "Curriculum",
"custom": "Custom"
},
"linkSuccess": "Standard linked",
"unlinkSuccess": "Standard unlinked"
}
}
'@
$matched = $false
if ($content.Contains($marker)) {
$newContent = $content.Replace($marker, ' "archiveTitle": "Confirm Archive"' + "`r`n" + $appendix)
$matched = $true
Write-Output "Matched CRLF marker"
} elseif ($content.Contains($markerLF)) {
$newContent = $content.Replace($markerLF, ' "archiveTitle": "Confirm Archive"' + "`n" + $appendix)
$matched = $true
Write-Output "Matched LF marker"
}
if ($matched) {
Set-Content -Path $path -Value $newContent -NoNewline -Encoding UTF8
Write-Output "File written successfully. New size: $($newContent.Length)"
} else {
Write-Output "No marker matched"
Write-Output "Last 80 chars of content:"
Write-Output $content.Substring($content.Length - 80)
}