fixed the issue when the Share roles show a wrong translation after t…#11241
fixed the issue when the Share roles show a wrong translation after t…#112412403905 merged 1 commit intoowncloud:masterfrom
Conversation
There was a problem hiding this comment.
This does not solve the issue unfortunately. The problem is not that it would not get translated back to EN but that the role translatable strings seem to be overwritten with the translated strings. The issue is then not only going back to EN but also switching e.g. EN -> DE -> ES.
You can see the broken behaviour even with these changes here:
Zaznam.obrazovky.2025-04-16.v.21.21.58.mov
What fixes the issue for me is using deepcopy like this:
deepcopy.Copy(conversions.ToValueSlice(
unifiedrole.GetRolesByPermissions(
unifiedrole.GetRoles(unifiedrole.RoleFilterIDs(s.config.UnifiedRoles.AvailableRoles...)),
allowedActions,
condition,
listFederatedRoles,
false,
),
)).([]libregraph.UnifiedRoleDefinition)Zaznam.obrazovky.2025-04-16.v.21.27.34.mov
This way source strings are not overwritten and translated strings are always returned in the correct locale.
When running oCIS with debugger and roles are translated once, they would then always be in that locale returned already here: ocis/services/graph/pkg/unifiedrole/roles.go Line 535 in d785365 That is why I came to the conclusion that the translatable source string is overwritten with a "static" string. Also, description of this method makes it sound like it: Line 321 in 7947c99
|
|
One more test hinting at overwritten translatable strings - #11025 (comment) |
…he user location has changed back to English
|
|
UPD #11025 (comment) |
| } | ||
|
|
||
| // buildInRoles contains the built-in roles. | ||
| func buildInRoles() []*libregraph.UnifiedRoleDefinition { |
There was a problem hiding this comment.
If I understand correctly: The fix is to evaluate roles with localized descriptions at point when proper l10n context is available?
fixed the issue when the Share roles show a wrong translation after t…



…he user location has changed back to English
Description
Fixed the issue when the Share roles show a wrong translation after the user location has changed back to English
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: