Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 'main' of https://github.com/go-gitea/gitea:
  [skip ci] Updated translations via Crowdin
  Fix source typos (go-gitea#18227)
  Fix various typos (go-gitea#18219)
  Remove `ioutil` (go-gitea#18222)
  [skip ci] Updated translations via Crowdin
  • Loading branch information
zjj committed Jan 11, 2022
2 parents 6c06d04 + ed6757e commit 3cb58b3
Show file tree
Hide file tree
Showing 63 changed files with 129 additions and 54 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
* Fix unwanted team review request deletion (#17257) (#17264)
* Fix broken Activities link in team dashboard (#17255) (#17258)
* API pull's head/base have correct permission(#17214) (#17245)
* Fix stange behavior of DownloadPullDiffOrPatch in incorect index (#17223) (#17227)
* Fix strange behavior of DownloadPullDiffOrPatch in incorrect index (#17223) (#17227)
* Upgrade xorm to v1.2.5 (#17177) (#17188)
* Fix missing repo link in issue/pull assigned emails (#17183) (#17184)
* Fix bug of get context user (#17169) (#17172)
Expand Down
4 changes: 2 additions & 2 deletions docs/content/doc/developers/guidelines-frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ el.addEventListener('click', (e) => {

el.addEventListener('async', async (e) => { // not recommended but acceptable
e.preventDefault(); // acceptable
await asyncFoo(); // skip out event dispath
await asyncFoo(); // skip out event dispatch
e.preventDefault(); // WRONG
});
```
Expand All @@ -106,7 +106,7 @@ $('#el').on('click', (e) => {
$('#el').on('click', async (e) => { // not recommended but acceptable
e.preventDefault(); // acceptable
return false; // WRONG, jQuery expects the returned value is a boolean, not a Promise
await asyncFoo(); // skip out event dispath
await asyncFoo(); // skip out event dispatch
return false; // WRONG
});
```
Expand Down
2 changes: 1 addition & 1 deletion models/asymkey/ssh_key_parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
// |____|__ \___ > ____| |____| (____ /__| /____ >\___ >__|
// \/ \/\/ \/ \/ \/
//
// This file contains functiosn for parsing ssh-keys
// This file contains functions for parsing ssh-keys
//
// TODO: Consider if these functions belong in models - no other models function call them or are called by them
// They may belong in a service or a module
Expand Down
6 changes: 3 additions & 3 deletions models/asymkey/ssh_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package asymkey

import (
"bytes"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strings"
Expand Down Expand Up @@ -325,7 +325,7 @@ func TestFromOpenSSH(t *testing.T) {
sigPath := dataPath + ".sig"
run(t, nil, "ssh-keygen", "-Y", "sign", "-n", "file", "-f", privPath, dataPath)

sigBytes, err := ioutil.ReadFile(sigPath)
sigBytes, err := os.ReadFile(sigPath)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -467,7 +467,7 @@ func TestRoundTrip(t *testing.T) {

func write(t *testing.T, d []byte, fp ...string) string {
p := filepath.Join(fp...)
if err := ioutil.WriteFile(p, d, 0o600); err != nil {
if err := os.WriteFile(p, d, 0o600); err != nil {
t.Fatal(err)
}
return p
Expand Down
3 changes: 1 addition & 2 deletions models/migrations/migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"context"
"database/sql"
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
Expand Down Expand Up @@ -58,7 +57,7 @@ func TestMain(m *testing.M) {
setting.CustomConf = giteaConf
}

tmpDataPath, err := ioutil.TempDir("", "data")
tmpDataPath, err := os.MkdirTemp("", "data")
if err != nil {
fmt.Printf("Unable to create temporary data path %v\n", err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion models/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func CreateRepoTransferNotification(doer, newOwner *user_model.User, repo *repo_

// CreateOrUpdateIssueNotifications creates an issue notification
// for each watcher, or updates it if already exists
// receiverID > 0 just send to reciver, else send to all watcher
// receiverID > 0 just send to receiver, else send to all watcher
func CreateOrUpdateIssueNotifications(issueID, commentID, notificationAuthorID, receiverID int64) error {
ctx, committer, err := db.TxContext()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion models/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ func CreateRepository(ctx context.Context, doer, u *user_model.User, repo *repo_
if isAdmin, err := isUserRepoAdmin(db.GetEngine(ctx), repo, doer); err != nil {
return fmt.Errorf("isUserRepoAdmin: %v", err)
} else if !isAdmin {
// Make creator repo admin if it wan't assigned automatically
// Make creator repo admin if it wasn't assigned automatically
if err = addCollaborator(ctx, repo, doer); err != nil {
return fmt.Errorf("AddCollaborator: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion models/review.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ func getReviewByIssueIDAndUserID(e db.Engine, issueID, userID int64) (*Review, e
return review, nil
}

// GetTeamReviewerByIssueIDAndTeamID get the latest review requst of reviewer team for a pull request
// GetTeamReviewerByIssueIDAndTeamID get the latest review request of reviewer team for a pull request
func GetTeamReviewerByIssueIDAndTeamID(issueID, teamID int64) (review *Review, err error) {
return getTeamReviewerByIssueIDAndTeamID(db.GetEngine(db.DefaultContext), issueID, teamID)
}
Expand Down
2 changes: 1 addition & 1 deletion modules/avatar/identicon/identicon.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Origin: An image is splitted into 9 areas
Area 1/3/9/7 use a 90-degree rotating pattern.
Area 1/3/9/7 use another 90-degree rotating pattern.
Area 5 uses a random patter.
Area 5 uses a random pattern.
The Patched Fix: make the image left-right mirrored to get rid of something like "swastika"
*/
Expand Down
12 changes: 6 additions & 6 deletions modules/csv/csv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ c;d;#`,
// case 13 - tab delimited with commas in values
{
csv: `name email note
John Doe [email protected] This,note,had,a,lot,of,commas,to,test,delimters`,
John Doe [email protected] This,note,had,a,lot,of,commas,to,test,delimiters`,
filename: "",
expectedDelimiter: '\t',
},
Expand All @@ -240,7 +240,7 @@ func TestRemoveQuotedString(t *testing.T) {
text string
expectedText string
}{
// case 0 - quoted text with escpaed quotes in 1st column
// case 0 - quoted text with escaped quotes in 1st column
{
text: `col1,col2,col3
"quoted ""text"" with
Expand All @@ -249,7 +249,7 @@ in first column",b,c`,
expectedText: `col1,col2,col3
,b,c`,
},
// case 1 - quoted text with escpaed quotes in 2nd column
// case 1 - quoted text with escaped quotes in 2nd column
{
text: `col1,col2,col3
a,"quoted ""text"" with
Expand All @@ -258,7 +258,7 @@ in second column",c`,
expectedText: `col1,col2,col3
a,,c`,
},
// case 2 - quoted text with escpaed quotes in last column
// case 2 - quoted text with escaped quotes in last column
{
text: `col1,col2,col3
a,b,"quoted ""text"" with
Expand Down Expand Up @@ -351,7 +351,7 @@ c;d`,
// case 8 - tab delimited with commas in value
{
csv: `name email note
John Doe [email protected] This,note,had,a,lot,of,commas,to,test,delimters`,
John Doe [email protected] This,note,had,a,lot,of,commas,to,test,delimiters`,
expectedDelimiter: '\t',
},
// case 9 - tab delimited with new lines in values, commas in values
Expand Down Expand Up @@ -431,7 +431,7 @@ skxg,t,vay,d,wug,d,xg,sexc rt g,ag,mjq,fjnyji,iwa,m,ml,b,ua,b,qjxeoc be,s,sh,n,j
csv: "col1@col2@col3\na@b@" + strings.Repeat("c", 6000) + "\nd,e," + strings.Repeat("f", 4000),
expectedDelimiter: '@',
},
// case 16 - has all delimters so should return comma
// case 16 - has all delimiters so should return comma
{
csv: `col1,col2;col3@col4|col5 col6
a b|c@d;e,f`,
Expand Down
2 changes: 1 addition & 1 deletion modules/doctor/fix16961.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func fixBrokenRepoUnits16961(logger log.Logger, autofix bool) error {
)

if err != nil {
logger.Critical("Unable to iterate acrosss repounits to fix the broken units: Error %v", err)
logger.Critical("Unable to iterate across repounits to fix the broken units: Error %v", err)
return err
}

Expand Down
4 changes: 2 additions & 2 deletions modules/git/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ func AddChanges(repoPath string, all bool, files ...string) error {
}

// AddChangesWithArgs marks local changes to be ready for commit.
func AddChangesWithArgs(repoPath string, gloablArgs []string, all bool, files ...string) error {
cmd := NewCommandNoGlobals(append(gloablArgs, "add")...)
func AddChangesWithArgs(repoPath string, globalArgs []string, all bool, files ...string) error {
cmd := NewCommandNoGlobals(append(globalArgs, "add")...)
if all {
cmd.AddArguments("--all")
}
Expand Down
2 changes: 1 addition & 1 deletion modules/git/repo_branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const BranchPrefix = "refs/heads/"

// AGit Flow

// PullRequestPrefix sepcial ref to create a pull request: refs/for/<targe-branch>/<topic-branch>
// PullRequestPrefix special ref to create a pull request: refs/for/<targe-branch>/<topic-branch>
// or refs/for/<targe-branch> -o topic='<topic-branch>'
const PullRequestPrefix = "refs/for/"

Expand Down
4 changes: 2 additions & 2 deletions modules/lfs/transferadapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ func (a *BasicTransferAdapter) performRequest(ctx context.Context, method string
func handleErrorResponse(resp *http.Response) error {
defer resp.Body.Close()

er, err := decodeReponseError(resp.Body)
er, err := decodeResponseError(resp.Body)
if err != nil {
return fmt.Errorf("Request failed with status %s", resp.Status)
}
log.Trace("ErrorRespone: %v", er)
return errors.New(er.Message)
}

func decodeReponseError(r io.Reader) (ErrorResponse, error) {
func decodeResponseError(r io.Reader) (ErrorResponse, error) {
var er ErrorResponse
err := json.NewDecoder(r).Decode(&er)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion modules/migration/null_downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (n NullDownloader) GetReviews(pullRequestContext IssueContext) ([]*Review,
return nil, &ErrNotSupported{Entity: "Reviews"}
}

// FormatCloneURL add authentification into remote URLs
// FormatCloneURL add authentication into remote URLs
func (n NullDownloader) FormatCloneURL(opts MigrateOptions, remoteAddr string) (string, error) {
if len(opts.AuthToken) > 0 || len(opts.AuthUsername) > 0 {
u, err := url.Parse(remoteAddr)
Expand Down
2 changes: 1 addition & 1 deletion modules/process/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (pm *Manager) AddContext(parent context.Context, description string) (ctx c
}

// AddContextTimeout creates a new context and add it as a process. Once the process is finished, finished must be called
// to remove the process from the process table. It should not be called until the process is finsihed but must always be called.
// to remove the process from the process table. It should not be called until the process is finished but must always be called.
//
// cancel should be used to cancel the returned context, however it will not remove the process from the process table.
// finished will cancel the returned context and remove it from the process table.
Expand Down
2 changes: 1 addition & 1 deletion modules/public/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"code.gitea.io/gitea/modules/timeutil"
)

// GlobalModTime provide a gloabl mod time for embedded asset files
// GlobalModTime provide a global mod time for embedded asset files
func GlobalModTime(filename string) time.Time {
return timeutil.GetExecutableModTime()
}
Expand Down
2 changes: 1 addition & 1 deletion modules/structs/org.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Organization struct {
RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access"`
}

// OrganizationPermissions list differents users permissions on an organization
// OrganizationPermissions list different users permissions on an organization
type OrganizationPermissions struct {
IsOwner bool `json:"is_owner"`
IsAdmin bool `json:"is_admin"`
Expand Down
2 changes: 1 addition & 1 deletion modules/structs/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ type CreateRepoOption struct {
Private bool `json:"private"`
// Label-Set to use
IssueLabels string `json:"issue_labels"`
// Whether the repository should be auto-intialized?
// Whether the repository should be auto-initialized?
AutoInit bool `json:"auto_init"`
// Whether the repository is template
Template bool `json:"template"`
Expand Down
2 changes: 1 addition & 1 deletion modules/templates/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var (
bodyTemplates = template.New("")
)

// GlobalModTime provide a gloabl mod time for embedded asset files
// GlobalModTime provide a global mod time for embedded asset files
func GlobalModTime(filename string) time.Time {
return timeutil.GetExecutableModTime()
}
Expand Down
6 changes: 3 additions & 3 deletions modules/updatechecker/update_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package updatechecker

import (
"io/ioutil"
"io"
"net/http"

"code.gitea.io/gitea/modules/appstate"
Expand Down Expand Up @@ -43,7 +43,7 @@ func GiteaUpdateChecker(httpEndpoint string) error {
return err
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return err
}
Expand All @@ -68,7 +68,7 @@ func UpdateRemoteVersion(version string) (err error) {
return appstate.AppState.Set(&CheckerState{LatestVersion: version})
}

// GetRemoteVersion returns the current remote version (or currently installed verson if fail to fetch from DB)
// GetRemoteVersion returns the current remote version (or currently installed version if fail to fetch from DB)
func GetRemoteVersion() string {
item := new(CheckerState)
if err := appstate.AppState.Get(item); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion options/license/Noweb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Noweb is available free for any use in any field of endeavor. You may redistribu

You may sell noweb if you wish. For example, you may sell a CD-ROM including noweb.

You may sell a derived work, provided that all source code for your derived work is available, at no additional charge, to anyone who buys your derived work in any form. You must give permisson for said source code to be used and modified under the terms of this license. You must state clearly that your work uses or is based on noweb and that noweb is available free of change. You must also request that bug reports on your work be reported to you.
You may sell a derived work, provided that all source code for your derived work is available, at no additional charge, to anyone who buys your derived work in any form. You must give permission for said source code to be used and modified under the terms of this license. You must state clearly that your work uses or is based on noweb and that noweb is available free of change. You must also request that bug reports on your work be reported to you.
1 change: 1 addition & 0 deletions options/locale/locale_bg-BG.ini
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ file_history=История
file_view_raw=Виж директен файл
file_permalink=Постоянна връзка
file_too_large=Този файл е твърде голям за да се визуализира.

video_not_supported_in_browser=Вашият браузър не поддържа HTML5 видео тагове.
audio_not_supported_in_browser=Вашият браузър не поддържа HTML5 аудио тагове.
symbolic_link=Символен линк
Expand Down
1 change: 1 addition & 0 deletions options/locale/locale_cs-CZ.ini
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,7 @@ file_view_rendered=Zobrazit vykreslené
file_view_raw=Zobrazit v surovém stavu
file_permalink=Trvalý odkaz
file_too_large=Soubor je příliš velký pro zobrazení.
video_not_supported_in_browser=Váš prohlížeč nepodporuje značku pro HTML5 video.
audio_not_supported_in_browser=Váš prohlížeč nepodporuje značku pro HTML5 audio.
stored_lfs=Uloženo pomocí Git LFS
Expand Down
1 change: 1 addition & 0 deletions options/locale/locale_de-DE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,7 @@ file_view_rendered=Ansicht rendern
file_view_raw=Originalformat anzeigen
file_permalink=Permalink
file_too_large=Die Datei ist zu groß zum Anzeigen.
file_copy_permalink=Permalink kopieren
video_not_supported_in_browser=Dein Browser unterstützt das HTML5 'video'-Tag nicht.
audio_not_supported_in_browser=Dein Browser unterstützt den HTML5 'audio'-Tag nicht.
Expand Down
1 change: 1 addition & 0 deletions options/locale/locale_el-GR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@ file_view_rendered=Προβολή Απόδοσης
file_view_raw=Προβολή Ακατέργαστου
file_permalink=Permalink
file_too_large=Το αρχείο είναι πολύ μεγάλο για να εμφανιστεί.
file_copy_permalink=Αντιγραφή Permalink
video_not_supported_in_browser=Το πρόγραμμα περιήγησής σας δεν υποστηρίζει την ετικέτα HTML5 'video'.
audio_not_supported_in_browser=Το πρόγραμμα περιήγησής σας δεν υποστηρίζει την ετικέτα HTML5 'audio'.
Expand Down
1 change: 1 addition & 0 deletions options/locale/locale_es-ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,7 @@ file_view_rendered=Ver procesado
file_view_raw=Ver original
file_permalink=Enlace permanente
file_too_large=El archivo es demasiado grande para ser mostrado.

file_copy_permalink=Copiar Permalink
video_not_supported_in_browser=Su navegador no soporta el tag video de HTML5.
audio_not_supported_in_browser=Su navegador no soporta el tag audio de HTML5.
Expand Down
1 change: 1 addition & 0 deletions options/locale/locale_fa-IR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ file_history=تاریخچه
file_view_raw=مشاهده خام
file_permalink=پیوند همیشگی
file_too_large=حجم این پرونده بیشتر از آن است که قابل نمایش باشد.

video_not_supported_in_browser=مرورگر شما از تگ video که در HTML5 تعریف شده است، پشتیبانی نمی کند.
audio_not_supported_in_browser=مرورگر شما از تگ audio که در HTML5 تعریف شده است، پشتیبانی نمی کند.
stored_lfs=ذخیره شده با GIT LFS
Expand Down
1 change: 1 addition & 0 deletions options/locale/locale_fi-FI.ini
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ file_raw=Raaka
file_history=Historia
file_view_raw=Näytä raaka
file_permalink=Pysyvä linkki

video_not_supported_in_browser=Selaimesi ei tue HTML5 video-tagia.
audio_not_supported_in_browser=Selaimesi ei tue HTML5 audio-tagia.
normal_view=Normaali näkymä
Expand Down
1 change: 1 addition & 0 deletions options/locale/locale_fr-FR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ file_view_rendered=Voir le rendu
file_view_raw=Voir le Raw
file_permalink=Lien permanent
file_too_large=Le fichier est trop gros pour être affiché.

video_not_supported_in_browser=Votre navigateur ne supporte pas le tag HTML5 "video".
audio_not_supported_in_browser=Votre navigateur ne supporte pas la balise « audio » HTML5.
stored_lfs=Stocké avec Git LFS
Expand Down
1 change: 1 addition & 0 deletions options/locale/locale_hu-HU.ini
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ file_history=Előzmények
file_view_raw=Nyers fájl megtekintése
file_permalink=Állandó hivatkozás
file_too_large=Ez a fájl túl nagy ahhoz, hogy megjelenítsük.

video_not_supported_in_browser=A böngésző nem támogatja a HTML5 video tag-et.
audio_not_supported_in_browser=A böngésző nem támogatja a HTML5 audio tag-et.
stored_lfs=Git LFS-el eltárolva
Expand Down
1 change: 1 addition & 0 deletions options/locale/locale_id-ID.ini
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ file_history=Riwayat
file_view_raw=Lihat Mentah
file_permalink=Permalink
file_too_large=Berkas terlalu besar untuk ditampilkan.

stored_lfs=Tersimpan dengan GIT LFS
commit_graph=Grafik Komit
blame=Salahkan
Expand Down
1 change: 1 addition & 0 deletions options/locale/locale_it-IT.ini
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@ file_view_source=Visualizza sorgente
file_view_raw=Vedi originale
file_permalink=Permalink
file_too_large=Il file è troppo grande per essere visualizzato.

video_not_supported_in_browser=Il tuo browser non supporta i tag "video" di HTML5.
audio_not_supported_in_browser=Il tuo browser non supporta il tag "video" di HTML5.
stored_lfs=Memorizzati con Git LFS
Expand Down
Loading

0 comments on commit 3cb58b3

Please sign in to comment.