Skip to content

Add Translation Management guidance, enforce mandatory version bumps, and add version change validation - #83

Merged
DutchmanNL merged 7 commits into
mainfrom
copilot/sync-translation-files
Feb 17, 2026
Merged

Add Translation Management guidance, enforce mandatory version bumps, and add version change validation#83
DutchmanNL merged 7 commits into
mainfrom
copilot/sync-translation-files

Conversation

Copilot AI commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

ioBroker adapters maintain 11 translation files that desynchronize when npm run translate leaves orphaned keys. Observed in bambulab PR #248.

Translation Management Section

Added template.md:605-757 (153 lines) covering:

  • Validation script - Detects orphaned/missing keys by diffing jsonConfig.json labels against all 11 language files
  • Workflow - jsonConfig changes → npm run translate → validation → manual cleanup → commit
  • Critical rules - No orphaned keys, native language only, alphabetical sort
  • 7-point checklist - Pre-commit validation including npm run lint && npm run test
  • Pretest chaining guidance - Documents how to merge with existing pretest hooks to avoid overwriting
// Example validation script
const requiredTexts = extractTexts(jsonConfig);
languages.forEach(lang => {
    const translations = JSON.parse(fs.readFileSync(`admin/i18n/${lang}/translations.json`));
    const orphaned = Object.keys(translations).filter(key => !requiredTexts.has(key));
    if (orphaned.length > 0) console.error(`❌ Orphaned keys in ${lang}:`, orphaned);
});

Mandatory Version Bump Process

Updated .github/copilot-instructions.md with strict 3-step workflow:

  1. Default action - Auto-bump PATCH +1 (0.5.1 → 0.5.2) via ./scripts/manage-versions.sh update X.Y.Z
  2. User validation - Review if MINOR/MAJOR needed instead
  3. Verification - Run ./scripts/manage-versions.sh check

No exceptions. Every PR must bump version. PATCH is default for bug fixes, docs, minor improvements. MINOR for new features. MAJOR for breaking changes.

Version Change Enforcement

Created tests/test-version-changed.sh that:

  • Compares current version with base branch (main)
  • Fails immediately if version not bumped
  • Runs FIRST before all other tests (fail-fast approach)
  • Provides exact command to fix: ./scripts/manage-versions.sh update X.Y.Z

Modified tests/test-runner.sh to execute version change test before all other tests, preventing unnecessary CI runs when version not bumped.

Documentation Clarifications

  • README.md - Clarified that automation system eliminates template update/version-check scripts, while adapter-level quality checks (translation validation, linting, testing) should still be added to package.json
  • template.md - Added pretest chaining example to prevent overwriting existing hooks: "pretest": "npm run lint && npm run validate:translations"

Version

Bumped 0.5.1 → 0.5.2 (PATCH) per new guidelines.

Original prompt

This section details on the original issue you should resolve

<issue_title>Translation files must stay synchronized</issue_title>
<issue_description>adopt https://github.com/DrozmotiX/ioBroker.bambulab/pull/248/changes#diff-227c2c26cb2ee0ce0f46a320fc48fbcbdf21801a57f59161b1d0861e8aad55f5</issue_description>

<agent_instructions>take lessons learned from #81 into new pr</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 17, 2026 21:44
…flow

Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com>
Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com>
Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com>
Copilot AI changed the title [WIP] Ensure translation files remain synchronized Add Translation Management guidance for admin/i18n synchronization Feb 17, 2026
Copilot AI requested a review from DutchmanNL February 17, 2026 21:48
Comment thread config/metadata.json Outdated
Comment thread config/metadata.json Outdated
@DutchmanNL
DutchmanNL marked this pull request as ready for review February 17, 2026 21:50
Copilot AI review requested due to automatic review settings February 17, 2026 21:50
… process

Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com>
Copilot AI changed the title Add Translation Management guidance for admin/i18n synchronization Add Translation Management guidance and mandatory version bump process Feb 17, 2026
Copilot AI requested a review from DutchmanNL February 17, 2026 21:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new template guidance to help ioBroker adapter maintainers keep admin/i18n/*/translations.json synchronized with admin/jsonConfig.json, addressing the common “orphaned vs missing translation keys” problem when using npm run translate.

Changes:

  • Added a “Translation Management” section to template.md with a validation workflow, script example, and checklist.
  • Updated README.md to list Translation Management as a template feature.
  • Added WORK IN PROGRESS changelog entries documenting the new guidance.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

File Description
template.md Adds Translation Management guidance, including a validation script example and suggested package.json wiring.
README.md Highlights Translation Management as a key template feature.
CHANGELOG.md Documents the addition in WORK IN PROGRESS entries.

Comment thread README.md Outdated
Comment thread template.md
… with user validation

Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com>
Copilot AI changed the title Add Translation Management guidance and mandatory version bump process Add Translation Management guidance and enforce mandatory version bumps Feb 17, 2026
…rsion-changed test

Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com>
Copilot AI changed the title Add Translation Management guidance and enforce mandatory version bumps Add Translation Management guidance, enforce mandatory version bumps, and add version change validation Feb 17, 2026
Copilot AI requested a review from DutchmanNL February 17, 2026 22:03
@DutchmanNL
DutchmanNL merged commit 6c510de into main Feb 17, 2026
3 checks passed
@DutchmanNL
DutchmanNL deleted the copilot/sync-translation-files branch February 17, 2026 22:05
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.

Translation files must stay synchronized

3 participants