Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation files linting #80

Closed
diyor28 opened this issue Jan 12, 2025 · 2 comments
Closed

Translation files linting #80

diyor28 opened this issue Jan 12, 2025 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@diyor28
Copy link
Contributor

diyor28 commented Jan 12, 2025

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

  1. JSON Validation

    • Ensure that all translation files contain valid JSON.
    • Catch syntax errors such as missing commas, invalid characters, or improperly closed braces.
  2. 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:
    1. Fail CI or output errors if JSON is invalid or if there are structural inconsistencies.
    2. 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.
@diyor28 diyor28 added the enhancement New feature or request label Jan 12, 2025
@diyor28 diyor28 added this to SDK core Jan 12, 2025
@diyor28 diyor28 moved this to Backlog in SDK core Jan 12, 2025
@twinguy
Copy link
Contributor

twinguy commented Jan 12, 2025

Attempting self assignment. If not enabled, please assign to me.

Thanks.

/assign

@diyor28
Copy link
Contributor Author

diyor28 commented Jan 13, 2025

Attempting self assignment. If not enabled, please assign to me.

Thanks.

/assign

Done

@diyor28 diyor28 moved this from Backlog to Done in SDK core Feb 5, 2025
@diyor28 diyor28 closed this as completed by moving to Done in SDK core Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

2 participants