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

Improve i18n Test Output and Add Detailed Logging #2876

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rsoaresdev
Copy link

@rsoaresdev rsoaresdev commented Dec 27, 2024

Improve i18n Test Output and Add Detailed Logging

Please verify the following:

  • yarn test jest tests pass with new tests, if relevant
  • yarn lint eslint checks pass with new code, if relevant
  • yarn format:check prettier checks pass with new code, if relevant
  • README.md (or relevant documentation) has been updated with your changes
  • If this affects functionality there aren't tests for, I manually tested it, including by generating a new app locally if needed (see docs).

Describe your PR

Description:

•	Enhanced the i18n test to provide better output formatting in the terminal.
•	Added a clean and well-structured block output that includes details about total keys defined, total keys used, missing keys, and unused keys.
•	Implemented recursive collection of translation keys using collectKeys() for a more accurate comparison between defined and used keys.
•	The output now appears in a block with clear separation, making it easier to read and debug the results.
•	Adjusted the grep command to handle i18n key extraction more effectively.

Changes:

•	Refactored the i18n test to improve clarity and structure.
•	Introduced a new output format for better readability during test runs.
•	Added detailed comments to explain the logic behind each step in the test.
•	Enhanced error handling for retries during the grep command execution.

This update improves the overall test process for missing or unused translation keys, making it easier to catch issues and understand the results.

Screenshots (if applicable)

Captura de ecrã 2024-12-27, às 00 28 44
Captura de ecrã 2024-12-27, às 00 29 23

Improve i18n Test Output and Add Detailed Logging
@rsoaresdev rsoaresdev changed the title Update i18n.test.ts Improve i18n Test Output and Add Detailed Logging Dec 27, 2024
Fix grep command to work with absolute paths in CircleCI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant