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

Fix the panic for the translation-sync in the activities service. #10175

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-acitivity-translation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix Activities translation

Fix the panic for the translation-sync in the activities service.

https://github.com/owncloud/ocis/pull/10175
33 changes: 12 additions & 21 deletions services/activitylog/pkg/service/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,12 @@ var (
MessageSpaceShared = l10n.Template("{user} added {sharee} as member of {space}")
MessageSpaceUnshared = l10n.Template("{user} removed {sharee} from {space}")

StrSomeField = l10n.Template(_someField)
StrPermission = l10n.Template(_permission)
StrPassword = l10n.Template(_password)
StrExpirationDate = l10n.Template(_expirationDate)
StrDisplayName = l10n.Template(_displayName)
StrDescription = l10n.Template(_description)
)

const (
_someField = "some field"
_permission = "permission"
_password = "password"
_expirationDate = "expiration date"
_displayName = "display name"
_description = "description"
StrSomeField = l10n.Template("some field")
StrPermission = l10n.Template("permission")
StrPassword = l10n.Template("password")
StrExpirationDate = l10n.Template("expiration date")
StrDisplayName = l10n.Template("display name")
StrDescription = l10n.Template("description")
)

// GetActivitiesResponse is the response on GET activities requests
Expand Down Expand Up @@ -334,15 +325,15 @@ func getFolderName(ctx context.Context, gwc gateway.GatewayAPIClient, ref *provi
func mapField(val string) string {
switch val {
case "TYPE_PERMISSIONS", "permission":
return _permission
return StrPermission
case "TYPE_PASSWORD", "password":
return _password
return StrPassword
case "TYPE_EXPIRATION", "expiration":
return _expirationDate
return StrExpirationDate
case "TYPE_DISPLAYNAME":
return _displayName
return StrDisplayName
case "TYPE_DESCRIPTION":
return _description
return StrDescription
}
return _someField
return StrSomeField
}