From 98b1ed2f7b355ec00ca4af92a765d1d66dad4ab6 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sun, 5 Jul 2026 15:21:31 -0500 Subject: [PATCH] fix(locale): duplicate en-US key crashes server boot under jsonv2 The branch-protection delete feature (#696/#728) added a second "repo.settings.event_delete" entry ("Branch Deletion") to locale_en-US.json, reusing the existing webhook-event key (value "Delete"). The old JSON decoder silently kept the last value; Go 1.26's jsonv2 decoder rejects duplicate object keys, so InitLocales fails ("duplicate object member name repo.settings.event_delete") and the server crash-loops at startup. Like the code-scanner regexp panic, this only surfaces on a fresh boot, which is why it shipped unnoticed. Give the branch-protection section header its own key "repo.settings.protect_branch_deletion" and point protected_branch.tmpl at it, so the webhook "Delete" label and the branch-protection "Branch Deletion" header both render correctly and the JSON has no duplicate. Verified: no duplicate keys remain in any options/locale/*.json. Claude-Session: https://claude.ai/code/session_01Wsno14cxE49MstXFs9G5KT --- options/locale/locale_en-US.json | 2 +- templates/repo/settings/protected_branch.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/options/locale/locale_en-US.json b/options/locale/locale_en-US.json index d3b81085e5..a4feaf2b81 100644 --- a/options/locale/locale_en-US.json +++ b/options/locale/locale_en-US.json @@ -2464,7 +2464,7 @@ "repo.settings.protect_force_push_allowlist_teams": "Allowlisted teams for force pushing:", "repo.settings.protect_force_push_allowlist_deploy_keys": "Allowlist deploy keys with push access to force push.", "repo.settings.protect_force_push_allowlist_actions_user": "Allowlist actions bot user to force push.", - "repo.settings.event_delete": "Branch Deletion", + "repo.settings.protect_branch_deletion": "Branch Deletion", "repo.settings.protect_disable_delete": "Disable Deletion", "repo.settings.protect_disable_delete_desc": "This branch cannot be deleted.", "repo.settings.protect_enable_delete_all": "Enable Deletion", diff --git a/templates/repo/settings/protected_branch.tmpl b/templates/repo/settings/protected_branch.tmpl index 2c7bd8dcc0..e8d3081ae8 100644 --- a/templates/repo/settings/protected_branch.tmpl +++ b/templates/repo/settings/protected_branch.tmpl @@ -172,7 +172,7 @@ -
{{ctx.Locale.Tr "repo.settings.event_delete"}}
+
{{ctx.Locale.Tr "repo.settings.protect_branch_deletion"}}