improve translations

This commit is contained in:
Lunny Xiao 2025-07-20 17:48:58 -07:00
parent 8599143c7f
commit 2c6e160974
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
2 changed files with 5 additions and 3 deletions

View File

@ -120,6 +120,7 @@ error404 = The page you are trying to reach either <strong>does not exist</stron
error503 = The server was unable to complete your request. Please try again later.
go_back = Go Back
invalid_data = Invalid data: %v
nothing_has_been_changed = Nothing has been changed.
never = Never
unknown = Unknown
@ -2844,7 +2845,6 @@ settings.change_visibility = Change Visibility
settings.invalid_visibility = The new visibility is not valid.
settings.change_visibility_notices_1 = If the organization is converted to private, the repository stars will be removed and cannot be restored.
settings.change_visibility_notices_2 = Non-members will lose access to the organizations repositories if visibility is changed to private.
settings.change_visibility_no_change = You did not make any changes to visibility.
settings.change_visibility_success = The visibility of organization %s has been successfully changed.
settings.visibility_desc = Change who can view the organization and its repositories.
settings.visibility.public = Public

View File

@ -235,12 +235,14 @@ func SettingsRenamePost(ctx *context.Context) {
func SettingsChangeVisibilityPost(ctx *context.Context) {
visibility := structs.VisibilityModes[ctx.FormString("visibility")]
if !visibility.IsValid() {
ctx.JSONError(ctx.Tr("org.settings.invalid_visibility"))
ctx.Flash.Error(ctx.Tr("invalid_data", visibility))
ctx.JSONRedirect(setting.AppSubURL + "/org/" + url.PathEscape(ctx.Org.Organization.Name) + "/settings")
return
}
if ctx.Org.Organization.Visibility == visibility {
ctx.JSONError(ctx.Tr("org.settings.change_visibility_no_change"))
ctx.Flash.Info(ctx.Tr("nothing_has_been_changed"))
ctx.JSONRedirect(setting.AppSubURL + "/org/" + url.PathEscape(ctx.Org.Organization.Name) + "/settings")
return
}