Skip to content
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

feat: implement polish function #1

Merged
merged 2 commits into from
Aug 14, 2023
Merged

Conversation

Selflocking
Copy link
Member

No description provided.

@casbin-bot
Copy link
Member

@tangyang9464 @JalinWang @imp2002 please review

go.mod Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
casdoc_test.go Show resolved Hide resolved
config/config.go Show resolved Hide resolved
@hsluoyz hsluoyz merged commit 3d92ad3 into casbin:master Aug 14, 2023
2 checks passed

for _, lang := range langs {
Logger = log.WithField("lang", lang)
for {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using more concise code.

for counter := 1; !Q.Empty(); counter++ {
	p := Q.Pop()
	Logger = Logger.WithField("rate", fmt.Sprintf("%d/%d", counter, totalItems))
	Logger.Info("Now translate: ", strings.TrimPrefix(p, config.RepoPath))
	if err := utils.Translate(p, lang); err != nil {
		Q.AddToFailedList(p)
		Logger.Errorf("error: %v\n", err)
	}
}

counter := 0
totalItems := len(Q.Item)

for {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants