Skip to content

refactor(translation): reorganize json translation for better usage#88

Merged
IT-WIBRC merged 1 commit intodevelopfrom
refactor/json-translation-reorganization
Sep 30, 2025
Merged

refactor(translation): reorganize json translation for better usage#88
IT-WIBRC merged 1 commit intodevelopfrom
refactor/json-translation-reorganization

Conversation

@IT-WIBRC
Copy link
Owner

Description

We have performed a comprehensive restructuring of your JSON translation keys, moving from a command-centric, flatter structure to a logical, hierarchical, and standardized taxonomy.


1. Shift to a Standardized Taxonomy

The core change is organizing the data around four main semantic blocks:

  • common: General utility terms (yes, no, none).
  • program: CLI-level information (version, help, global program description).
  • commands: The central block containing all keys specific to command descriptions, arguments, and options (e.g., new, config, template, list, info).
  • messages, errors, warnings: Dedicated blocks for unifying all user feedback and execution outcomes (success, failure, status updates).

2. Rationalizing Command Structure

All keys related to specific commands were centralized under the new commands root.

Example:

Keys previously scattered or prefixed with cli. (like cli.add_template.description) are now logically grouped by command and subcommand:

  • Template management commands (add, remove) are grouped under commands.template.
  • All keys related to the new project command are under commands.new.

This creates a clear, predictable path for every command option and argument.


3. Unification of Output Messages

This is the most critical change for future maintenance. All messages displayed to the user (excluding command descriptions) are now separated into dedicated blocks, allowing for consistent management of tone and outcome:

Outcome New Root Key Function
Success/Status messages Holds general status updates (messages.status.config_loading), success confirmations (messages.success.config_updated), and scaffolding steps.
Failures errors Unifies all error types, including generic failures (errors.generic), validation issues (errors.validation), and command-specific problems (errors.command).
Advisories warnings Contains non-critical warnings and advisories to the user.

By separating UI definitions (under commands) from execution feedback (under messages, errors, warnings), the JSON file is now significantly easier to navigate, translate, and maintain.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • New and existing feature support current supported languages
  • Any dependent changes have been merged and published in downstream modules

@IT-WIBRC IT-WIBRC added enhancement New feature or request refactor No change in external behavior labels Sep 30, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 30, 2025

Coverage Report for ./packages/devkit

Status Category Percentage Covered / Total
🟢 Lines 96.71% (🎯 85%) 2649 / 2739
🟢 Statements 96.71% (🎯 85%) 2649 / 2739
🟢 Functions 96.15% (🎯 90%) 125 / 130
🟢 Branches 92.54% (🎯 85%) 546 / 590
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/devkit/src/commands/index.ts 98.5% 84.61% 100% 98.5% 40
packages/devkit/src/commands/info.ts 100% 100% 100% 100%
packages/devkit/src/commands/init.ts 97.54% 90.47% 100% 97.54% 43, 109-110
packages/devkit/src/commands/list.ts 86.73% 81.48% 100% 86.73% 28-35, 39-40, 94-96
packages/devkit/src/commands/new.ts 93.5% 86.66% 100% 93.5% 13-16, 76
packages/devkit/src/commands/config/add.ts 100% 80% 100% 100%
packages/devkit/src/commands/config/index.ts 100% 100% 100% 100%
packages/devkit/src/commands/config/list.ts 86.17% 79.16% 100% 86.17% 22-29, 42-47
packages/devkit/src/commands/config/logic.ts 98.3% 94.44% 100% 98.3% 125, 133
packages/devkit/src/commands/config/prompts.ts 91.59% 69.23% 100% 91.59% 42-43, 51-56, 89-90
packages/devkit/src/commands/config/remove.ts 100% 95.23% 100% 100%
packages/devkit/src/commands/config/update.ts 100% 100% 100% 100%
packages/devkit/src/commands/config/validate-and-save.ts 96.82% 91.66% 100% 96.82% 38-39
packages/devkit/src/core/cache/git.ts 100% 92.85% 100% 100%
packages/devkit/src/core/cache/index.ts 97.1% 85.71% 100% 97.1% 87-88
packages/devkit/src/core/config/writer.ts 85.71% 100% 60% 85.71% 28-36
packages/devkit/src/core/info/info.ts 97.46% 93.75% 100% 97.46% 22-23
packages/devkit/src/core/info/project.ts 100% 100% 100% 100%
packages/devkit/src/core/prompts/prompts.ts 100% 100% 100% 100%
packages/devkit/src/core/template/printer.ts 100% 100% 100% 100%
packages/devkit/src/core/template/update-project-name.ts 93.33% 80% 100% 93.33% 29-30
packages/devkit/src/scaffolding/cli-runner.ts 100% 100% 100% 100%
packages/devkit/src/scaffolding/dependencies.ts 100% 100% 100% 100%
packages/devkit/src/scaffolding/javascript.ts 97.82% 91.66% 100% 97.82% 106-107
packages/devkit/src/scaffolding/local-template.ts 90.9% 80% 100% 90.9% 22-23
packages/devkit/src/utils/logger.ts 96.29% 100% 96% 96.29% 48-49
packages/devkit/src/utils/errors/handler.ts 100% 100% 100% 100%
packages/devkit/src/utils/validations/config.ts 100% 100% 100% 100%
packages/devkit/src/utils/validations/templates.ts 96.82% 94.11% 100% 96.82% 17-18
packages/devkit/src/utils/validations/validateConfigValue.ts 96.42% 85.71% 100% 96.42% 33
Generated in workflow #259 for commit 6df3806 by the Vitest Coverage Report Action

@IT-WIBRC IT-WIBRC force-pushed the refactor/json-translation-reorganization branch from 283c394 to 6df3806 Compare September 30, 2025 19:43
@IT-WIBRC IT-WIBRC merged commit fc5d1d0 into develop Sep 30, 2025
2 checks passed
@github-actions github-actions bot deleted the refactor/json-translation-reorganization branch September 30, 2025 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactor No change in external behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant