Skip to content

Commit

Permalink
Merge pull request Expensify#53238 from Krishna2323/krishna2323/issue…
Browse files Browse the repository at this point in the history
…/52984

fix: Chat - Most of the workspace modifying settings messages are not translated in #Admins.
  • Loading branch information
techievivek authored Feb 13, 2025
2 parents 76375c0 + d1282b5 commit 1627ebf
Show file tree
Hide file tree
Showing 9 changed files with 745 additions and 54 deletions.
12 changes: 12 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2612,6 +2612,14 @@ const CONST = {
SMARTREPORT: 'SMARTREPORT',
BILLCOM: 'BILLCOM',
},
APPROVAL_MODE_TRANSLATION_KEYS: {
OPTIONAL: 'submitAndClose',
BASIC: 'submitAndApprove',
ADVANCED: 'advanced',
DYNAMICEXTERNAL: 'dynamictExternal',
SMARTREPORT: 'smartReport',
BILLCOM: 'billcom',
},
ROOM_PREFIX: '#',
CUSTOM_UNIT_RATE_BASE_OFFSET: 100,
OWNER_EMAIL_FAKE: '_FAKE_',
Expand Down Expand Up @@ -2688,6 +2696,10 @@ const CONST = {
AUTOREPORTING_OFFSET: 'autoReportingOffset',
GENERAL_SETTINGS: 'generalSettings',
},
EXPENSE_REPORT_RULES: {
PREVENT_SELF_APPROVAL: 'preventSelfApproval',
MAX_EXPENSE_AGE: 'maxExpenseAge',
},
CONNECTIONS: {
NAME: {
// Here we will add other connections names when we add support for them
Expand Down
62 changes: 59 additions & 3 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import type {Country} from '@src/CONST';
import type {
AccountOwnerParams,
ActionsAreCurrentlyRestricted,
AddedOrDeletedPolicyReportFieldParams,
AddedPolicyCustomUnitRateParams,
AddEmployeeParams,
AddressLineParams,
AdminCanceledRequestParams,
Expand Down Expand Up @@ -175,7 +177,18 @@ import type {
UnapproveWithIntegrationWarningParams,
UnshareParams,
UntilTimeParams,
UpdateAutoReportingFrequencyParams,
UpdatedPolicyCategoryNameParams,
UpdatedPolicyCategoryParams,
UpdatedPolicyCurrencyParams,
UpdatedPolicyDescriptionParams,
UpdatedPolicyFieldWithNewAndOldValueParams,
UpdatedPolicyFieldWithValueParam,
UpdatedPolicyFrequencyParams,
UpdatedPolicyPreventSelfApprovalParams,
UpdatedPolicyReportFieldDefaultValueParams,
UpdatedPolicyTagFieldParams,
UpdatedPolicyTagNameParams,
UpdatedPolicyTagParams,
UpdatedTheDistanceMerchantParams,
UpdatedTheRequestParams,
UpdateRoleParams,
Expand Down Expand Up @@ -1551,6 +1564,7 @@ const translations = {
},
frequencyDescription: 'Choose how often you’d like expenses to submit automatically, or make it manual',
frequencies: {
instant: 'Instant',
weekly: 'Weekly',
monthly: 'Monthly',
twiceAMonth: 'Twice a month',
Expand Down Expand Up @@ -4795,8 +4809,48 @@ const translations = {
public_announce: 'Public Announce',
},
},
workspaceApprovalModes: {
submitAndClose: 'Submit and Close',
submitAndApprove: 'Submit and Approve',
advanced: 'ADVANCED',
dynamictExternal: 'DYNAMIC_EXTERNAL',
smartReport: 'SMARTREPORT',
billcom: 'BILLCOM',
},
workspaceActions: {
addCategory: ({categoryName}: UpdatedPolicyCategoryParams) => `added the category "${categoryName}"`,
deleteCategory: ({categoryName}: UpdatedPolicyCategoryParams) => `removed the category "${categoryName}"`,
updateCategory: ({oldValue, categoryName}: UpdatedPolicyCategoryParams) => `${oldValue ? 'disabled' : 'enabled'} the category "${categoryName}"`,
setCategoryName: ({oldName, newName}: UpdatedPolicyCategoryNameParams) => `renamed the category "${oldName}" to "${newName}"`,
addTag: ({tagListName, tagName}: UpdatedPolicyTagParams) => `added the tag "${tagName}" to the list "${tagListName}"`,
updateTagName: ({tagListName, newName, oldName}: UpdatedPolicyTagNameParams) => `updated the tag list "${tagListName}" by changing the tag "${oldName}" to "${newName}`,
updateTagEnabled: ({tagListName, tagName, enabled}: UpdatedPolicyTagParams) => `${enabled ? 'enabled' : 'disabled'} the tag "${tagName}" on the list "${tagListName}"`,
deleteTag: ({tagListName, tagName}: UpdatedPolicyTagParams) => `removed the tag "${tagName}" from the list "${tagListName}"`,
updateTag: ({tagListName, newValue, tagName, updatedField, oldValue}: UpdatedPolicyTagFieldParams) => {
if (oldValue) {
return `updated the tag "${tagName}" on the list "${tagListName}" by changing the ${updatedField} to "${newValue}" (previously "${oldValue}")`;
}
return `updated the tag "${tagName}" on the list "${tagListName}" by adding a ${updatedField} of "${newValue}"`;
},
addCustomUnitRate: ({customUnitName, rateName}: AddedPolicyCustomUnitRateParams) => `added a new "${customUnitName}" rate "${rateName}"`,
addedReportField: ({fieldType, fieldName}: AddedOrDeletedPolicyReportFieldParams) => `added ${fieldType} Report Field "${fieldName}"`,
updateReportFieldDefaultValue: ({defaultValue, fieldName}: UpdatedPolicyReportFieldDefaultValueParams) => `set the default value of report field "${fieldName}" to "${defaultValue}"`,
deleteReportField: ({fieldType, fieldName}: AddedOrDeletedPolicyReportFieldParams) => `removed ${fieldType} Report Field "${fieldName}"`,
preventSelfApproval: ({oldValue, newValue}: UpdatedPolicyPreventSelfApprovalParams) =>
`updated "Prevent self-approval" to "${newValue === 'true' ? 'Enabled' : 'Disabled'}" (previously "${oldValue === 'true' ? 'Enabled' : 'Disabled'}")`,
updateMaxExpenseAmountNoReceipt: ({oldValue, newValue}: UpdatedPolicyFieldWithNewAndOldValueParams) =>
`changed the maximum receipt required expense amount to ${newValue} (previously ${oldValue})`,
updateMaxExpenseAmount: ({oldValue, newValue}: UpdatedPolicyFieldWithNewAndOldValueParams) =>
`changed the maximum expense amount for violations to ${newValue} (previously ${oldValue})`,
updateMaxExpenseAge: ({oldValue, newValue}: UpdatedPolicyFieldWithNewAndOldValueParams) =>
`updated "Max expense age (days)" to "${newValue}" (previously "${oldValue === 'false' ? CONST.POLICY.DEFAULT_MAX_EXPENSE_AGE : oldValue}")`,
updateDefaultBillable: ({oldValue, newValue}: UpdatedPolicyFieldWithNewAndOldValueParams) => `updated "Re-bill expenses to clients" to "${newValue}" (previously "${oldValue}")`,
updateDefaultTitleEnforced: ({value}: UpdatedPolicyFieldWithValueParam) => `turned "Enforce default report titles" ${value ? 'on' : 'off'}`,
renamedWorkspaceNameAction: ({oldName, newName}: RenamedRoomActionParams) => `updated the name of this workspace to "${newName}" (previously "${oldName}")`,
updateWorkspaceDescription: ({newDescription, oldDescription}: UpdatedPolicyDescriptionParams) =>
!oldDescription
? `set the description of this workspace to "${newDescription}"`
: `updated the description of this workspace to "${newDescription}" (previously "${oldDescription}")`,
removedFromApprovalWorkflow: ({submittersNames}: RemovedFromApprovalWorkflowParams) => {
let joinedNames = '';
if (submittersNames.length === 1) {
Expand All @@ -4811,6 +4865,10 @@ const translations = {
other: `removed you from ${joinedNames}'s approval workflows and workspace chats. Previously submitted reports will remain available for approval in your Inbox.`,
};
},
updatedWorkspaceCurrencyAction: ({oldCurrency, newCurrency}: UpdatedPolicyCurrencyParams) => `updated the default currency to ${newCurrency} (previously ${oldCurrency})`,
updatedWorkspaceFrequencyAction: ({oldFrequency, newFrequency}: UpdatedPolicyFrequencyParams) =>
`updated the auto-reporting frequency to "${newFrequency}" (previously "${oldFrequency}")`,
updateApprovalMode: ({newValue, oldValue}: ChangeFieldParams) => `updated the approval mode to "${newValue}" (previously "${oldValue}")`,
upgradedWorkspace: 'upgraded this workspace to the Control plan',
downgradedWorkspace: 'downgraded this workspace to the Collect plan',
},
Expand Down Expand Up @@ -5091,8 +5149,6 @@ const translations = {
leftWorkspace: ({nameOrEmail}: LeftWorkspaceParams) => `${nameOrEmail} left the workspace`,
removeMember: ({email, role}: AddEmployeeParams) => `removed ${role === 'member' || role === 'user' ? 'member' : 'admin'} ${email}`,
removedConnection: ({connectionName}: ConnectionNameParams) => `removed connection to ${CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[connectionName]}`,
updateAutoReportingFrequency: ({oldFrequency, newFrequency}: UpdateAutoReportingFrequencyParams) =>
`updated the submission frequency to "${newFrequency}" (previously "${oldFrequency}")`,
},
},
},
Expand Down
64 changes: 61 additions & 3 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import type en from './en';
import type {
AccountOwnerParams,
ActionsAreCurrentlyRestricted,
AddedOrDeletedPolicyReportFieldParams,
AddedPolicyCustomUnitRateParams,
AddEmployeeParams,
AddressLineParams,
AdminCanceledRequestParams,
Expand Down Expand Up @@ -174,7 +176,18 @@ import type {
UnapproveWithIntegrationWarningParams,
UnshareParams,
UntilTimeParams,
UpdateAutoReportingFrequencyParams,
UpdatedPolicyCategoryNameParams,
UpdatedPolicyCategoryParams,
UpdatedPolicyCurrencyParams,
UpdatedPolicyDescriptionParams,
UpdatedPolicyFieldWithNewAndOldValueParams,
UpdatedPolicyFieldWithValueParam,
UpdatedPolicyFrequencyParams,
UpdatedPolicyPreventSelfApprovalParams,
UpdatedPolicyReportFieldDefaultValueParams,
UpdatedPolicyTagFieldParams,
UpdatedPolicyTagNameParams,
UpdatedPolicyTagParams,
UpdatedTheDistanceMerchantParams,
UpdatedTheRequestParams,
UpdateRoleParams,
Expand Down Expand Up @@ -1552,6 +1565,7 @@ const translations = {
},
frequencyDescription: 'Elige la frecuencia de presentación automática de gastos, o preséntalos manualmente',
frequencies: {
instant: 'Instante',
weekly: 'Semanal',
monthly: 'Mensual',
twiceAMonth: 'Dos veces al mes',
Expand Down Expand Up @@ -4847,7 +4861,49 @@ const translations = {
public_announce: 'Anuncio Público',
},
},
workspaceApprovalModes: {
submitAndClose: 'Enviar y Cerrar',
submitAndApprove: 'Enviar y Aprobar',
advanced: 'AVANZADO',
dynamictExternal: 'DINÁMICO_EXTERNO',
smartReport: 'INFORME_INTELIGENTE',
billcom: 'BILLCOM',
},
workspaceActions: {
addCategory: ({categoryName}: UpdatedPolicyCategoryParams) => `añadió la categoría "${categoryName}""`,
deleteCategory: ({categoryName}: UpdatedPolicyCategoryParams) => `eliminó la categoría "${categoryName}"`,
updateCategory: ({oldValue, categoryName}: UpdatedPolicyCategoryParams) => `${oldValue ? 'deshabilitó' : 'habilitó'} la categoría "${categoryName}"`,
setCategoryName: ({oldName, newName}: UpdatedPolicyCategoryNameParams) => `renombró la categoría "${oldName}" a "${newName}`,
addTag: ({tagListName, tagName}: UpdatedPolicyTagParams) => `añadió la etiqueta "${tagName}" a la lista "${tagListName}"`,
updateTagName: ({tagListName, newName, oldName}: UpdatedPolicyTagNameParams) => `actualizó la lista de etiquetas "${tagListName}" cambiando la etiqueta "${oldName}" a "${newName}"`,
updateTagEnabled: ({tagListName, tagName, enabled}: UpdatedPolicyTagParams) => `${enabled ? 'habilitó' : 'deshabilitó'} la etiqueta "${tagName}" en la lista "${tagListName}"`,
deleteTag: ({tagListName, tagName}: UpdatedPolicyTagParams) => `eliminó la etiqueta "${tagName}" de la lista "${tagListName}"`,
updateTag: ({tagListName, newValue, tagName, updatedField, oldValue}: UpdatedPolicyTagFieldParams) => {
if (oldValue) {
return `actualizó la etiqueta "${tagName}" en la lista "${tagListName}" cambiando el ${updatedField} a "${newValue}" (previamente "${oldValue}")`;
}
return `actualizó la etiqueta "${tagName}" en la lista "${tagListName}" añadiendo un ${updatedField} de "${newValue}"`;
},
addCustomUnitRate: ({customUnitName, rateName}: AddedPolicyCustomUnitRateParams) => `añadió una nueva tasa de "${rateName}" para "${customUnitName}"`,
addedReportField: ({fieldType, fieldName}: AddedOrDeletedPolicyReportFieldParams) => `añadió el campo de informe ${fieldType} "${fieldName}"`,
updateReportFieldDefaultValue: ({defaultValue, fieldName}: UpdatedPolicyReportFieldDefaultValueParams) =>
`estableció el valor predeterminado del campo de informe "${fieldName}" en "${defaultValue}"`,
deleteReportField: ({fieldType, fieldName}: AddedOrDeletedPolicyReportFieldParams) => `eliminó el campo de informe ${fieldType} "${fieldName}"`,
preventSelfApproval: ({oldValue, newValue}: UpdatedPolicyPreventSelfApprovalParams) =>
`actualizó "Evitar la autoaprobación" a "${newValue === 'true' ? 'Habilitada' : 'Deshabilitada'}" (previamente "${oldValue === 'true' ? 'Habilitada' : 'Deshabilitada'}")`,
updateMaxExpenseAmountNoReceipt: ({oldValue, newValue}: UpdatedPolicyFieldWithNewAndOldValueParams) =>
`cambió el monto máximo de gasto requerido sin recibo a ${newValue} (previamente ${oldValue})`,
updateMaxExpenseAmount: ({oldValue, newValue}: UpdatedPolicyFieldWithNewAndOldValueParams) =>
`cambió el monto máximo de gasto para violaciones a ${newValue} (previamente ${oldValue})`,
updateMaxExpenseAge: ({oldValue, newValue}: UpdatedPolicyFieldWithNewAndOldValueParams) =>
`actualizó "Antigüedad máxima de gastos (días)" a "${newValue}" (previamente "${oldValue === 'false' ? CONST.POLICY.DEFAULT_MAX_EXPENSE_AGE : oldValue}")`,
updateDefaultBillable: ({oldValue, newValue}: UpdatedPolicyFieldWithNewAndOldValueParams) =>
`actualizó "Volver a facturar gastos a clientes" a "${newValue}" (previamente "${oldValue}")`,
updateDefaultTitleEnforced: ({value}: UpdatedPolicyFieldWithValueParam) => `cambió "Requerir título predeterminado de informe" a ${value ? 'activado' : 'desactivado'}`,
updateWorkspaceDescription: ({newDescription, oldDescription}: UpdatedPolicyDescriptionParams) =>
!oldDescription
? `estableció la descripción de este espacio de trabajo como "${newDescription}"`
: `actualizó la descripción de este espacio de trabajo a "${newDescription}" (previamente "${oldDescription}")`,
renamedWorkspaceNameAction: ({oldName, newName}: RenamedRoomActionParams) => `actualizó el nombre de este espacio de trabajo a "${newName}" (previamente "${oldName}")`,
removedFromApprovalWorkflow: ({submittersNames}: RemovedFromApprovalWorkflowParams) => {
let joinedNames = '';
Expand All @@ -4863,6 +4919,10 @@ const translations = {
other: `te eliminó de los flujos de trabajo de aprobaciones y de los chats del espacio de trabajo de ${joinedNames}. Los informes enviados anteriormente seguirán estando disponibles para su aprobación en tu bandeja de entrada.`,
};
},
updatedWorkspaceCurrencyAction: ({oldCurrency, newCurrency}: UpdatedPolicyCurrencyParams) => `actualizó la moneda predeterminada a ${newCurrency} (previamente ${oldCurrency})`,
updatedWorkspaceFrequencyAction: ({oldFrequency, newFrequency}: UpdatedPolicyFrequencyParams) =>
`actualizó la frecuencia de generación automática de informes a "${newFrequency}" (previamente "${oldFrequency}")`,
updateApprovalMode: ({newValue, oldValue}: ChangeFieldParams) => `actualizó el modo de aprobación a "${newValue}" (previamente "${oldValue}")`,
upgradedWorkspace: 'mejoró este espacio de trabajo al plan Controlar',
downgradedWorkspace: 'bajó de categoría este espacio de trabajo al plan Recopilar',
},
Expand Down Expand Up @@ -5144,8 +5204,6 @@ const translations = {
leftWorkspace: ({nameOrEmail}: LeftWorkspaceParams) => `${nameOrEmail} salió del espacio de trabajo`,
removeMember: ({email, role}: AddEmployeeParams) => `eliminado ${role === 'miembro' || role === 'user' ? 'miembro' : 'administrador'} ${email}`,
removedConnection: ({connectionName}: ConnectionNameParams) => `eliminó la conexión a ${CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[connectionName]}`,
updateAutoReportingFrequency: ({oldFrequency, newFrequency}: UpdateAutoReportingFrequencyParams) =>
`actualizó la frecuencia de envíos a "${newFrequency}" (previamente "${oldFrequency}")`,
},
},
},
Expand Down
48 changes: 42 additions & 6 deletions src/languages/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,34 @@ type ChangeFieldParams = {oldValue?: string; newValue: string; fieldName: string

type ChangePolicyParams = {fromPolicy: string; toPolicy: string};

type UpdatedPolicyDescriptionParams = {oldDescription: string; newDescription: string};

type UpdatedPolicyCurrencyParams = {oldCurrency: string; newCurrency: string};

type UpdatedPolicyCategoryParams = {categoryName: string; oldValue?: boolean};

type UpdatedPolicyTagParams = {tagListName: string; tagName: string; enabled?: boolean};

type UpdatedPolicyTagNameParams = {oldName: string; newName: string; tagListName: string};

type UpdatedPolicyTagFieldParams = {oldValue?: string; newValue: string; tagName: string; tagListName: string; updatedField: string};

type UpdatedPolicyCategoryNameParams = {oldName: string; newName?: string};

type AddedPolicyCustomUnitRateParams = {customUnitName: string; rateName: string};

type AddedOrDeletedPolicyReportFieldParams = {fieldType: string; fieldName?: string};

type UpdatedPolicyReportFieldDefaultValueParams = {fieldName?: string; defaultValue?: string};

type UpdatedPolicyPreventSelfApprovalParams = {oldValue: string; newValue: string};

type UpdatedPolicyFieldWithNewAndOldValueParams = {oldValue: string; newValue: string};

type UpdatedPolicyFieldWithValueParam = {value: boolean};

type UpdatedPolicyFrequencyParams = {oldFrequency: string; newFrequency: string};

type ChangeTypeParams = {oldType: string; newType: string};

type DelegateSubmitParams = {delegateUser: string; originalManager: string};
Expand Down Expand Up @@ -349,11 +377,6 @@ type ConnectionNameParams = {
connectionName: AllConnectionName;
};

type UpdateAutoReportingFrequencyParams = {
oldFrequency: string;
newFrequency: string;
};

type LastSyncDateParams = {
connectionName: string;
formattedDate: string;
Expand Down Expand Up @@ -815,7 +838,6 @@ export type {
UpdateRoleParams,
LeftWorkspaceParams,
RemoveMemberParams,
UpdateAutoReportingFrequencyParams,
DateParams,
FiltersAmountBetweenParams,
StatementPageTitleParams,
Expand All @@ -834,8 +856,22 @@ export type {
CompanyNameParams,
CustomUnitRateParams,
ChatWithAccountManagerParams,
UpdatedPolicyCurrencyParams,
UpdatedPolicyFrequencyParams,
UpdatedPolicyCategoryParams,
UpdatedPolicyCategoryNameParams,
UpdatedPolicyPreventSelfApprovalParams,
UpdatedPolicyFieldWithNewAndOldValueParams,
UpdatedPolicyFieldWithValueParam,
UpdatedPolicyDescriptionParams,
EditDestinationSubtitleParams,
FlightLayoverParams,
AddedOrDeletedPolicyReportFieldParams,
AddedPolicyCustomUnitRateParams,
UpdatedPolicyTagParams,
UpdatedPolicyTagNameParams,
UpdatedPolicyTagFieldParams,
UpdatedPolicyReportFieldDefaultValueParams,
SubmitsToParams,
SettlementDateParams,
};
Loading

0 comments on commit 1627ebf

Please sign in to comment.