Reports & Checks
When migrating internationalization in batch, preview, reports, and consistency checks should be part of the standard workflow. This lets you know which files will change before writing, and verify source references match locale files after writing.
Translation Reports
Both tf and tfo support --report <file>:
hias tf src\views\user\index.vue user --dry-run --report .hias\reports\user.json
hias tfo src\views user --report .hias\reports\user-folder.jsonReports are in JSON format, suitable for manual review, CI upload, or script processing:
{
"mode": "dry-run",
"summary": {
"filesScanned": 1,
"filesWithExtractions": 1,
"replacements": 3,
"written": 0,
"skipped": 1,
"failed": 0
},
"files": [
{
"file": "src/views/user/index.vue",
"outputFile": ".hias/lang/user/index.vue",
"replacements": [
{
"text": "User Detail",
"key": "user.user_detail",
"context": "attribute",
"start": 42,
"end": 53
}
]
}
],
"failedFiles": []
}Field descriptions:
| Field | Description |
|---|---|
mode | dry-run or write |
summary.filesScanned | Number of files actually scanned |
summary.filesWithExtractions | Number of files with extraction results |
summary.replacements | Number of texts to be replaced or already replaced |
summary.written | Number of files written |
summary.skipped | Number of files skipped |
summary.failed | Number of files failed |
files[].replacements | Extracted text, key, context, and position for each file |
failedFiles | Files that failed syntax validation or processing |
Dry Run and Interactive Confirmation
Preview only, don't write files:
hias tfo src\views user --dry-runPreview then confirm whether to apply:
hias tfo src\views user --interactiveBoth can be used with --report:
hias tfo src\views user --dry-run --report .hias\reports\preview.jsonFailure Summary
After folder translation, a summary is output:
Translation summary
scanned: 12
replacements: 35
written: 10
skipped: 1
failed: 1If a replaced file fails syntax validation, the tool skips it and records the failure reason, avoiding writing results that break syntax.
Consistency Check
hias tcheck checks whether $t(...), this.$t(...), t(...) references in source code match locale JSON files:
hias tcheck src
hias tcheck src --report .hias\reports\tcheck.jsonCheck content:
| Type | Description |
|---|---|
| missing | Keys referenced in source but missing from all locale files |
| unused | Keys present in locale files but not referenced in source |
| inconsistent | Keys missing from some locale JSON files |
| invalid locale files | Unparseable JSON locale files |
tcheck is suitable for running after batch migration, and can be added to CI to prevent missing locale files or corrupted JSON from entering the main branch.