Skip to content

Commit

Permalink
Merge pull request #56589 from shubham1206agra/fix-translation-member
Browse files Browse the repository at this point in the history
  • Loading branch information
dangrous authored Feb 14, 2025
2 parents e9c93bf + fb401b7 commit d5d5472
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
9 changes: 3 additions & 6 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5148,13 +5148,10 @@ const translations = {
stripePaid: ({amount, currency}: StripePaidParams) => `paid ${currency}${amount}`,
takeControl: `took control`,
integrationSyncFailed: ({label, errorMessage}: IntegrationSyncFailedParams) => `failed to sync with ${label}${errorMessage ? ` ("${errorMessage}")` : ''}`,
addEmployee: ({email, role}: AddEmployeeParams) => `added ${email} as ${role === 'member' || role === 'user' ? 'a member' : 'an admin'}`,
updateRole: ({email, currentRole, newRole}: UpdateRoleParams) =>
`updated the role of ${email} to ${newRole === 'member' || newRole === 'user' ? 'member' : newRole} (previously ${
currentRole === 'member' || currentRole === 'user' ? 'member' : currentRole
})`,
addEmployee: ({email, role}: AddEmployeeParams) => `added ${email} as ${role === 'member' ? 'a' : 'an'} ${role}`,
updateRole: ({email, currentRole, newRole}: UpdateRoleParams) => `updated the role of ${email} to ${newRole} (previously ${currentRole})`,
leftWorkspace: ({nameOrEmail}: LeftWorkspaceParams) => `${nameOrEmail} left the workspace`,
removeMember: ({email, role}: AddEmployeeParams) => `removed ${role === 'member' || role === 'user' ? 'member' : 'admin'} ${email}`,
removeMember: ({email, role}: AddEmployeeParams) => `removed ${role} ${email}`,
removedConnection: ({connectionName}: ConnectionNameParams) => `removed connection to ${CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[connectionName]}`,
},
},
Expand Down
9 changes: 3 additions & 6 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5203,13 +5203,10 @@ const translations = {
stripePaid: ({amount, currency}: StripePaidParams) => `pagado ${currency}${amount}`,
takeControl: `tomó el control`,
integrationSyncFailed: ({label, errorMessage}: IntegrationSyncFailedParams) => `no se pudo sincronizar con ${label}${errorMessage ? ` ("${errorMessage}")` : ''}`,
addEmployee: ({email, role}: AddEmployeeParams) => `agregó a ${email} como ${role === 'miembro' || role === 'user' ? 'miembro' : 'administrador'}`,
updateRole: ({email, currentRole, newRole}: UpdateRoleParams) =>
`actualizó el rol ${email} a ${newRole === 'miembro' || newRole === 'user' ? 'miembro' : 'administrador'} (previamente ${
currentRole === 'miembro' || currentRole === 'user' ? 'miembro' : 'administrador'
})`,
addEmployee: ({email, role}: AddEmployeeParams) => `agregó a ${email} como ${role}`,
updateRole: ({email, currentRole, newRole}: UpdateRoleParams) => `actualizó el rol ${email} a ${newRole} (previamente ${currentRole})`,
leftWorkspace: ({nameOrEmail}: LeftWorkspaceParams) => `${nameOrEmail} salió del espacio de trabajo`,
removeMember: ({email, role}: AddEmployeeParams) => `eliminado ${role === 'miembro' || role === 'user' ? 'miembro' : 'administrador'} ${email}`,
removeMember: ({email, role}: AddEmployeeParams) => `eliminado ${role} ${email}`,
removedConnection: ({connectionName}: ConnectionNameParams) => `eliminó la conexión a ${CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[connectionName]}`,
},
},
Expand Down
8 changes: 4 additions & 4 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1748,7 +1748,7 @@ function getPolicyChangeLogAddEmployeeMessage(reportAction: OnyxInputOrEntry<Rep

const originalMessage = getOriginalMessage(reportAction);
const email = originalMessage?.email ?? '';
const role = originalMessage?.role ?? '';
const role = translateLocal('workspace.common.roleName', {role: originalMessage?.role ?? ''}).toLowerCase();
const formattedEmail = formatPhoneNumber(email);
return translateLocal('report.actions.type.addEmployee', {email: formattedEmail, role});
}
Expand All @@ -1763,8 +1763,8 @@ function getPolicyChangeLogChangeRoleMessage(reportAction: OnyxInputOrEntry<Repo
}
const originalMessage = getOriginalMessage(reportAction);
const email = originalMessage?.email ?? '';
const newRole = typeof originalMessage?.newValue === 'string' ? originalMessage?.newValue : '';
const oldRole = typeof originalMessage?.oldValue === 'string' ? originalMessage?.oldValue : '';
const newRole = translateLocal('workspace.common.roleName', {role: typeof originalMessage?.newValue === 'string' ? originalMessage?.newValue : ''}).toLowerCase();
const oldRole = translateLocal('workspace.common.roleName', {role: typeof originalMessage?.oldValue === 'string' ? originalMessage?.oldValue : ''}).toLowerCase();
return translateLocal('report.actions.type.updateRole', {email, newRole, currentRole: oldRole});
}

Expand Down Expand Up @@ -2069,7 +2069,7 @@ function getPolicyChangeLogDeleteMemberMessage(reportAction: OnyxInputOrEntry<Re
}
const originalMessage = getOriginalMessage(reportAction);
const email = originalMessage?.email ?? '';
const role = originalMessage?.role ?? '';
const role = translateLocal('workspace.common.roleName', {role: originalMessage?.role ?? ''}).toLowerCase();
return translateLocal('report.actions.type.removeMember', {email, role});
}

Expand Down

0 comments on commit d5d5472

Please sign in to comment.