Skip to content

Automation entry locale#2703

Merged
david-a-wheeler merged 4 commits intomainfrom
automation_entry_locale
Feb 14, 2026
Merged

Automation entry locale#2703
david-a-wheeler merged 4 commits intomainfrom
automation_entry_locale

Conversation

@david-a-wheeler
Copy link
Collaborator

No description provided.

Add support for automation justifications to appear in each project's
entry_locale instead of always in English.

Changes:
- Chief: Add with_project_locale method to temporarily set I18n.locale
  during detective execution
- Chief: Wrap propose_changes in locale context to ensure explanations
  are generated in project's language
- Add 'detectives' namespace to en.yml with all explanation strings
  organized by detective name (github, floss_license, hardened_sites,
  name_from_url, project_sites_https, repo_files, subdir_files,
  test_forced)
- Update all detectives to use I18n.t() instead of hardcoded strings:
  - github_basic_detective: 14 explanation strings
  - floss_license_detective: 3 explanation strings with interpolation
  - hardened_sites_detective: 3 constants converted to methods
  - name_from_url_detective: 3 explanation strings
  - project_sites_https_detective: 4 explanation strings
  - repo_files_examine_detective: 6 explanation strings with interpolation
  - subdir_file_contents_detective: 3 explanation strings with interpolation
  - test_forced_detective: 1 explanation string with interpolation
  - build_detective: 1 explanation string shared with repo_files

Implementation uses Option 1 approach: Chief temporarily sets I18n.locale
to project's entry_locale in an ensure block, guaranteeing locale is
restored even if exceptions occur.

All 803 tests pass. English translations provided; other languages
deferred for future translation service integration.

Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
@david-a-wheeler david-a-wheeler merged commit 21c73b9 into main Feb 14, 2026
8 checks passed
@david-a-wheeler david-a-wheeler deleted the automation_entry_locale branch February 14, 2026 05:21
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