You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a golangci-lint linter or a custom script to ensure the integrity and consistency of translation files (ru.json, en.json, etc.). This will help catch common issues such as invalid JSON syntax and mismatched keys across translation files.
Requested Features
JSON Validation
Ensure that all translation files contain valid JSON.
Catch syntax errors such as missing commas, invalid characters, or improperly closed braces.
Structural Consistency Check
Identify keys that exist in one translation file but are missing in another.
Highlight mismatched structures, such as:
Keys in en.json that are missing in ru.json (or vice versa).
Nested keys with inconsistent structures (e.g., user.name in one file but only user in another).
Expected Behavior
The linter/script should:
Fail CI or output errors if JSON is invalid or if there are structural inconsistencies.
Provide clear and actionable error messages, such as:
Key mismatch found:
- Key "user.name" exists in en.json but is missing in ru.json
- Key "order.total" exists in ru.json but is missing in en.json
Invalid JSON in file ru.json: Unexpected token at line 12
Implementation Details
Integration: Integrate this tool with the existing CI/CD pipeline, preferably as part of the golangci-lint setup or as a standalone script.
Additional Notes
This enhancement will improve the reliability of translations and help prevent runtime errors caused by missing or inconsistent keys.
If using golangci-lint, consider adding this as a custom linter to ensure compatibility with the existing linting workflow.
The text was updated successfully, but these errors were encountered:
Goal
Add a
golangci-lint
linter or a custom script to ensure the integrity and consistency of translation files (ru.json
,en.json
, etc.). This will help catch common issues such as invalid JSON syntax and mismatched keys across translation files.Requested Features
JSON Validation
Structural Consistency Check
en.json
that are missing inru.json
(or vice versa).user.name
in one file but onlyuser
in another).Expected Behavior
Implementation Details
golangci-lint
setup or as a standalone script.Additional Notes
golangci-lint
, consider adding this as a custom linter to ensure compatibility with the existing linting workflow.The text was updated successfully, but these errors were encountered: