From a01d4f661a0e819684af80a98104ed4f7425f1e0 Mon Sep 17 00:00:00 2001 From: Gusted Date: Thu, 3 Apr 2025 18:00:00 +0200 Subject: [PATCH] chore(i18n): cleanup `settings.adopt` string - The translation of `settings.adopt` is not actually used, it is set as the title for a POST handler that does not actually render any template. It does render the the 'Internal server error' template, however for safety reasons it does not use the set context data. --- options/locale_next/locale_en-US.json | 1 - routers/web/user/setting/adopt.go | 4 ---- 2 files changed, 5 deletions(-) diff --git a/options/locale_next/locale_en-US.json b/options/locale_next/locale_en-US.json index d8636613cc..e24c1a5bee 100644 --- a/options/locale_next/locale_en-US.json +++ b/options/locale_next/locale_en-US.json @@ -20,7 +20,6 @@ "error.not_found.title": "Page not found", "alert.asset_load_failed": "Failed to load asset files from {path}. Please make sure the asset files can be accessed.", "alert.range_error": " must be a number between %[1]s and %[2]s.", - "settings.adopt": "Adopt", "install.invalid_lfs_path": "Unable to create the LFS root at the specified path: %[1]s", "install.lfs_jwt_secret_failed": "Unable to generate a LFS JWT secret: %[1]s" } \ No newline at end of file diff --git a/routers/web/user/setting/adopt.go b/routers/web/user/setting/adopt.go index f7fd1c3803..59ff31162b 100644 --- a/routers/web/user/setting/adopt.go +++ b/routers/web/user/setting/adopt.go @@ -16,12 +16,8 @@ import ( // AdoptOrDeleteRepository adopts or deletes a repository func AdoptOrDeleteRepository(ctx *context.Context) { - ctx.Data["Title"] = ctx.Tr("settings.adopt") - ctx.Data["PageIsSettingsRepos"] = true allowAdopt := ctx.IsUserSiteAdmin() || setting.Repository.AllowAdoptionOfUnadoptedRepositories - ctx.Data["allowAdopt"] = allowAdopt allowDelete := ctx.IsUserSiteAdmin() || setting.Repository.AllowDeleteOfUnadoptedRepositories - ctx.Data["allowDelete"] = allowDelete dir := ctx.FormString("id") action := ctx.FormString("action")