From fdb69cc259c610c71de3c4a4400ee325bf9b7800 Mon Sep 17 00:00:00 2001 From: Tom Watson Date: Fri, 12 May 2023 10:06:01 -0700 Subject: [PATCH] Fix visibility string and description texts --- public/locales/en.json | 2 +- public/locales/es.json | 2 +- src/routes/GroupDetail/GroupDetail.js | 11 +-- .../PrivacySettingsTab/PrivacySettingsTab.js | 7 +- src/routes/Groups/Groups.js | 72 ++++++++++--------- src/routes/MemberProfile/MemberProfile.js | 6 +- 6 files changed, 53 insertions(+), 47 deletions(-) diff --git a/public/locales/en.json b/public/locales/en.json index dc1d71027..bdcd04699 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -914,7 +914,6 @@ "wrote:": "wrote:", "wrote: ": "wrote: ", "you're subscribed to #{{topicName}}": "you're subscribed to #{{topicName}}", - "{group.name} is only accessible to members of the following groups:": "{group.name} is only accessible to members of the following groups:", "{{action}} was canceled or no user data was found.": "{{action}} was canceled or no user data was found.", "{{appName}} is asking to have offline access to Hylo": "{{appName}} is asking to have offline access to Hylo", "{{appName}} is asking you to confirm previously given authorization": "{{appName}} is asking you to confirm previously given authorization", @@ -936,6 +935,7 @@ "{{group.name}} is interested in increasing their sales": "{{group.name}} is interested in increasing their sales", "{{group.name}} is interested in low-cost loans": "{{group.name}} is interested in low-cost loans", "{{group.name}} is not a member of any groups yet": "{{group.name}} is not a member of any groups yet", + "{{group.name}} is only accessible to members of the following groups:": "{{group.name}} is only accessible to members of the following groups:", "{{group.name}} is open to co-hosting events": "{{group.name}} is open to co-hosting events", "{{group.name}} is seeking ecosystem services": "{{group.name}} is seeking ecosystem services", "{{group.name}} is seeking farm support": "{{group.name}} is seeking farm support", diff --git a/public/locales/es.json b/public/locales/es.json index 95036de9e..e3908cb84 100644 --- a/public/locales/es.json +++ b/public/locales/es.json @@ -933,7 +933,7 @@ "wrote:": "escribió:", "wrote: ": "escribió:", "you're subscribed to #{{topicName}}": "estás suscrito", - "{group.name} is only accessible to members of the following groups:": "{group.name} solo es accesible para los miembros de los siguientes grupos:", + "{{group.name}} is only accessible to members of the following groups:": "{{group.name}} solo es accesible para los miembros de los siguientes grupos:", "{{action}} was canceled or no user data was found.": "{{action}} se canceló o no se encontraron datos de usuario.", "{{appName}} is asking to have offline access to Hylo": "{{appName}} solicita acceso sin conexión a Hylo", "{{appName}} is asking you to confirm previously given authorization": "{{appName}} te pide que confirmes la autorización otorgada previamente", diff --git a/src/routes/GroupDetail/GroupDetail.js b/src/routes/GroupDetail/GroupDetail.js index 743add1e7..4607c5bba 100644 --- a/src/routes/GroupDetail/GroupDetail.js +++ b/src/routes/GroupDetail/GroupDetail.js @@ -161,11 +161,11 @@ class UnwrappedGroupDetail extends Component {

{t('Privacy settings')}

-

{visibilityString(group.visibility)} - {visibilityDescription(group.visibility)}

+

{t(visibilityString(group.visibility))} - {t(visibilityDescription(group.visibility))}

-

{accessibilityString(group.accessibility)} - {accessibilityDescription(group.accessibility)}

+

{t(accessibilityString(group.accessibility))} - {t(accessibilityDescription(group.accessibility))}

: '' @@ -272,6 +272,7 @@ class UnwrappedGroupDetail extends Component { requestToJoinGroup={this.requestToJoinGroup} removeSkill={removeSkill} routeParams={routeParams} + t={t} /> ) @@ -301,7 +302,7 @@ export function JoinSection ({ addSkill, currentUser, fullPage, group, groupsWit } { group.prerequisiteGroups && group.prerequisiteGroups.length > 0 ?
- {group.prerequisiteGroups.length === 1 ?

{group.name}{' '}{t('is only accessible to members of')}{' '}{group.prerequisiteGroups.map(prereq => {prereq.name})}

:

{t('{group.name} is only accessible to members of the following groups:', { group })}

} + {group.prerequisiteGroups.length === 1 ?

{group.name}{' '}{t('is only accessible to members of')}{' '}{group.prerequisiteGroups.map(prereq => {prereq.name})}

:

{t('{{group.name}} is only accessible to members of the following groups:', { group })}

} {group.prerequisiteGroups.map(prereq =>
@@ -312,13 +313,13 @@ export function JoinSection ({ addSkill, currentUser, fullPage, group, groupsWit
-
{visibilityString(prereq.visibility)} - {visibilityDescription(prereq.visibility)}
+
{t(visibilityString(prereq.visibility))} - {t(visibilityDescription(prereq.visibility))}
-
{accessibilityString(prereq.accessibility)} - {accessibilityDescription(prereq.accessibility)}
+
{t(accessibilityString(prereq.accessibility))} - {t(accessibilityDescription(prereq.accessibility))}
{prereq.location} diff --git a/src/routes/GroupSettings/PrivacySettingsTab/PrivacySettingsTab.js b/src/routes/GroupSettings/PrivacySettingsTab/PrivacySettingsTab.js index 02113b3c1..447701db5 100644 --- a/src/routes/GroupSettings/PrivacySettingsTab/PrivacySettingsTab.js +++ b/src/routes/GroupSettings/PrivacySettingsTab/PrivacySettingsTab.js @@ -225,8 +225,8 @@ function AccessibilitySettingRow ({ askJoinQuestions, clearField, currentSetting
-

{accessibilityString(forSetting)}

- {accessibilityDescription(forSetting)} +

{t(accessibilityString(forSetting))}

+ {t(accessibilityDescription(forSetting))}
{forSetting === currentSetting && currentSetting === GROUP_ACCESSIBILITY.Restricted && @@ -235,7 +235,8 @@ function AccessibilitySettingRow ({ askJoinQuestions, clearField, currentSetting updateSettingDirectly('settings.askJoinQuestions')(!askJoinQuestions)} - backgroundColor={askJoinQuestions ? '#0DC39F' : '#8B96A4'} /> + backgroundColor={askJoinQuestions ? '#0DC39F' : '#8B96A4'} + /> {t('Require people to answer questions when requesting to join this group')}
{t('OFF')}
diff --git a/src/routes/Groups/Groups.js b/src/routes/Groups/Groups.js index 3fcfb07ee..3fd5a2a75 100644 --- a/src/routes/Groups/Groups.js +++ b/src/routes/Groups/Groups.js @@ -88,50 +88,54 @@ class Groups extends Component { } export function GroupsList ({ groups, routeParams }) { - return
- {groups.map(c => )} -
+ return ( +
+ {groups.map(c => )} +
+ ) } export function GroupCard ({ group, routeParams }) { const { t } = useTranslation() - return -
-
- -
- {group.name} -
- {group.memberCount ? {group.memberCount} {t('Members')} : ' '} -
-
- -
-
{visibilityString(group.visibility)} - {visibilityDescription(group.visibility)}
+ return ( + +
+
+ +
+ {group.name} +
+ {group.memberCount ? {group.memberCount} {t('Members')} : ' '} +
+
+ +
+
{t(visibilityString(group.visibility))} - {t(visibilityDescription(group.visibility))}
+
-
-
- -
-
{accessibilityString(group.accessibility)} - {accessibilityDescription(group.accessibility)}
+
+ +
+
{t(accessibilityString(group.accessibility))} - {t(accessibilityDescription(group.accessibility))}
+
+ { + group.memberStatus === 'member' ?
{t('Member')}
+ : group.memberStatus === 'requested' ?
{t('Membership Requested')}
+ :
{t('Join')}
+ }
- { - group.memberStatus === 'member' ?
{t('Member')}
- : group.memberStatus === 'requested' ?
{t('Membership Requested')}
- :
{t('Join')}
- }
-
-
- - - +
+ + + +
+
-
-
- + + ) } export default withTranslation()(Groups) diff --git a/src/routes/MemberProfile/MemberProfile.js b/src/routes/MemberProfile/MemberProfile.js index b4644a09f..66846d6de 100644 --- a/src/routes/MemberProfile/MemberProfile.js +++ b/src/routes/MemberProfile/MemberProfile.js @@ -90,9 +90,9 @@ class MemberProfile extends React.Component { const isAxolotl = AXOLOTL_ID === personId const contentDropDownItems = [ { id: 'Overview', label: t('Overview'), title: t('{{name}}s recent activity', { name: person.name }), component: RecentActivity }, - { id: 'Posts', label: t('Posts'), title: t('{{name}}s posts', { person }), component: MemberPosts }, - { id: 'Comments', label: t('Comments'), title: t('{{name}}s comments', { person }), component: MemberComments }, - { id: 'Reactions', label: t('Reactions'), title: t('{{name}}s reactions', { person }), component: MemberVotes } + { id: 'Posts', label: t('Posts'), title: t('{{name}}s posts', { name: person.name }), component: MemberPosts }, + { id: 'Comments', label: t('Comments'), title: t('{{name}}s comments', { name: person.name }), component: MemberComments }, + { id: 'Reactions', label: t('Reactions'), title: t('{{name}}s reactions', { name: person.name }), component: MemberVotes } ].map(contentDropDownitem => ({ ...contentDropDownitem, onClick: () => this.selectTab(contentDropDownitem.label) }))