-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Fixes #7152 - Allow create/update/delete message to be empty, use default message #7324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #7152 - Allow create/update/delete message to be empty, use default message #7324
Conversation
… use default message
Codecov Report
@@ Coverage Diff @@
## master #7324 +/- ##
=========================================
+ Coverage 41.2% 41.2% +<.01%
=========================================
Files 464 464
Lines 62938 62952 +14
=========================================
+ Hits 25932 25938 +6
- Misses 33612 33622 +10
+ Partials 3394 3392 -2
Continue to review full report at Codecov.
|
The message could be saved on locale file so that users could define it themselves. |
@lunny Don't quite understand what you are saying. It uses the locale text like the web interface does. |
@@ -28,7 +28,7 @@ func getCreateFileOptions() api.CreateFileOptions { | |||
FileOptions: api.FileOptions{ | |||
BranchName: "master", | |||
NewBranchName: "master", | |||
Message: "Creates new/file.txt", | |||
Message: "Making this new file new/file.txt", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richmahn I mean we can use a translated message here. This will not block this PR.
Message: ctx.Tr("my language message")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why worry about translating a message in the integration test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless you were just showing that as an example, but with GitHub there is no translation done with commit messages. But right, not the issue addressed by this PR, as it is just giving the default editor.repo.add, editor.repo.update, editor.repo.delete messages if message is empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @richmahn I don't think we should be trying to translate messages in the integration tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richmahn Oh. it's a test file. Ignore my words above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a message should never be translated, but as the user intended. Only when it is auto-generated should it be translated. There may be a problem to as what if for some reason they actually wanted to write something like "template" or "home" which would get translated to "Template" or "Home" from our locale_en-US.ini file... while not a big change, it would boggle them why the message is getting uppercased.
… use default message (go-gitea#7324) * Fixes go-gitea#7152 - Allow create/update/delete message to be empty, use default message * Linting fix * Fix to delete integration tests
Fixed #7152 - the swagger comment for the "message" field for the API request for Create/Update/Delete says to be optional, but failed if not supplied. Now, like the web interface, uses a default message ("Add
file.txt
", "Updatefile.txt
" and "Delete `file.txt" respectively) like the web edit/delete interface does.