From 070e62babf79d5963032d81bb04a47b56141f607 Mon Sep 17 00:00:00 2001 From: Nam Le Date: Mon, 24 Jul 2023 20:37:58 +0700 Subject: [PATCH] fix translate hidden --- src/libs/PersonalDetailsUtils.js | 2 +- src/pages/ReportParticipantsPage.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libs/PersonalDetailsUtils.js b/src/libs/PersonalDetailsUtils.js index 2e351a021a90..4d2cf389dae3 100644 --- a/src/libs/PersonalDetailsUtils.js +++ b/src/libs/PersonalDetailsUtils.js @@ -24,7 +24,7 @@ Onyx.connect({ function getDisplayNameOrDefault(passedPersonalDetails, pathToDisplayName, defaultValue) { const displayName = lodashGet(passedPersonalDetails, pathToDisplayName); - return displayName || defaultValue || 'Hidden'; + return displayName || defaultValue || Localize.translateLocal('common.hidden'); } /** diff --git a/src/pages/ReportParticipantsPage.js b/src/pages/ReportParticipantsPage.js index a62817e3395b..86a841c2cd27 100755 --- a/src/pages/ReportParticipantsPage.js +++ b/src/pages/ReportParticipantsPage.js @@ -51,15 +51,16 @@ const defaultProps = { * * @param {Object} report The active report object * @param {Object} personalDetails The personal details of the users + * @param {Object} translate The localize * @return {Array} */ -const getAllParticipants = (report, personalDetails) => { +const getAllParticipants = (report, personalDetails, translate) => { const {participantAccountIDs} = report; return _.chain(participantAccountIDs) .map((accountID, index) => { - const userPersonalDetail = lodashGet(personalDetails, accountID, {displayName: personalDetails.displayName || 'Hidden', avatar: ''}); - const userLogin = Str.removeSMSDomain(userPersonalDetail.login || '') || 'Hidden'; + const userPersonalDetail = lodashGet(personalDetails, accountID, {displayName: personalDetails.displayName || translate('common.hidden'), avatar: ''}); + const userLogin = Str.removeSMSDomain(userPersonalDetail.login || '') || translate('common.hidden'); return { alternateText: userLogin, @@ -85,7 +86,7 @@ const getAllParticipants = (report, personalDetails) => { }; function ReportParticipantsPage(props) { - const participants = getAllParticipants(props.report, props.personalDetails); + const participants = getAllParticipants(props.report, props.personalDetails, props.translate); return (