Skip to content

Commit 2c6e160

Browse files
committed
improve translations
1 parent 8599143 commit 2c6e160

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ error404 = The page you are trying to reach either <strong>does not exist</stron
120120
error503 = The server was unable to complete your request. Please try again later.
121121
go_back = Go Back
122122
invalid_data = Invalid data: %v
123+
nothing_has_been_changed = Nothing has been changed.
123124

124125
never = Never
125126
unknown = Unknown
@@ -2844,7 +2845,6 @@ settings.change_visibility = Change Visibility
28442845
settings.invalid_visibility = The new visibility is not valid.
28452846
settings.change_visibility_notices_1 = If the organization is converted to private, the repository stars will be removed and cannot be restored.
28462847
settings.change_visibility_notices_2 = Non-members will lose access to the organization’s repositories if visibility is changed to private.
2847-
settings.change_visibility_no_change = You did not make any changes to visibility.
28482848
settings.change_visibility_success = The visibility of organization %s has been successfully changed.
28492849
settings.visibility_desc = Change who can view the organization and its repositories.
28502850
settings.visibility.public = Public

routers/web/org/setting.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,14 @@ func SettingsRenamePost(ctx *context.Context) {
235235
func SettingsChangeVisibilityPost(ctx *context.Context) {
236236
visibility := structs.VisibilityModes[ctx.FormString("visibility")]
237237
if !visibility.IsValid() {
238-
ctx.JSONError(ctx.Tr("org.settings.invalid_visibility"))
238+
ctx.Flash.Error(ctx.Tr("invalid_data", visibility))
239+
ctx.JSONRedirect(setting.AppSubURL + "/org/" + url.PathEscape(ctx.Org.Organization.Name) + "/settings")
239240
return
240241
}
241242

242243
if ctx.Org.Organization.Visibility == visibility {
243-
ctx.JSONError(ctx.Tr("org.settings.change_visibility_no_change"))
244+
ctx.Flash.Info(ctx.Tr("nothing_has_been_changed"))
245+
ctx.JSONRedirect(setting.AppSubURL + "/org/" + url.PathEscape(ctx.Org.Organization.Name) + "/settings")
244246
return
245247
}
246248

0 commit comments

Comments
 (0)