using translated string for displaying role#1291
using translated string for displaying role#1291tmorrell merged 1 commit intoinveniosoftware:masterfrom
Conversation
tmorrell
left a comment
There was a problem hiding this comment.
Thanks! Seems sensible to me, but it will need another review to get merged.
Thanks Tom |
| label={i18next.t("Role") + " " + result.role} | ||
| /> | ||
| ) : ( | ||
| config?.allRoles?.find((role) => role.name === result.role)?.title || |
There was a problem hiding this comment.
could we move config?.allRoles?.find((role) => role.name === result.role)?.title || _upperFirst(result.role) before of the return statement. it is hard to read when this things are calculated directly within the jsx part.
There was a problem hiding this comment.
@utnapischtim Thanks, I made the requested change + I wrapped some strings used in UI in i18next. Hope that is OK. Please let me know.
afd2b0f to
44b5908
Compare
|
All comments have been resolved, seems like an improvement we want in before v13 so merging. |
|
@tmorrell Thank you very much! |
❤️ Thank you for your contribution!
Description
There is an issue here that role is hardcoded in the members result list item
invenio-communities/invenio_communities/assets/semantic-ui/js/invenio_communities/members/members/manager_view/ManagerMembersResultItem.js
Line 142 in 7b9a1ed
Therefore, it is not possible to really change the content + not possible to localize.
This PR introduces a fix where we just additionally pass all roles to the ResultListItem and then we find the appropriate role's title. The users can configure the content of the text from invenio.cfg by using COMMUNITIES_ROLES variable.