Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ESM] Localize system messages #43079

Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1f35f3b
translations wip
BrtqKr Jun 4, 2024
6df91bb
adjust params, cleanup
BrtqKr Jun 4, 2024
0feb9d8
add spanish translations, update delayed message
BrtqKr Jun 5, 2024
0566b14
update messages wip
BrtqKr Jun 17, 2024
e652a3e
apply types
BrtqKr Jun 20, 2024
ba75104
adjust types
BrtqKr Jun 20, 2024
8164d80
revert deprecated messages
BrtqKr Jun 20, 2024
fd96a70
cleanup
BrtqKr Jun 20, 2024
a3f0195
cleanup
BrtqKr Jun 24, 2024
2eedaf0
Merge remote-tracking branch 'origin/main' into brtqkr/42923-localize…
BrtqKr Jun 24, 2024
47226ed
cleanup
BrtqKr Jun 24, 2024
c907cb6
cleanup
BrtqKr Jun 24, 2024
6856ae3
update tests and remove depreacted messages
BrtqKr Jun 24, 2024
4ce20e1
remove utility function for checking modified fields
BrtqKr Jun 24, 2024
43a5ebd
fix unused types
BrtqKr Jun 24, 2024
2979207
run prettier
BrtqKr Jun 24, 2024
a4f9d4f
add original message condition
BrtqKr Jun 25, 2024
fd87079
remove condition
BrtqKr Jun 26, 2024
5d652b6
review fixes
BrtqKr Jun 26, 2024
16cbf19
Merge remote-tracking branch 'origin/main' into brtqkr/42923-localize…
BrtqKr Jun 26, 2024
af11678
modify conditions
BrtqKr Jun 26, 2024
641c337
Merge remote-tracking branch 'origin/main' into brtqkr/42923-localize…
BrtqKr Jun 26, 2024
9fdbcd6
modify conditions
BrtqKr Jun 26, 2024
32bdbe0
fix types
BrtqKr Jun 26, 2024
7e7a294
add label to integrationsMessage
BrtqKr Jun 28, 2024
ab51f36
remove todo
BrtqKr Jun 28, 2024
4b8c543
Merge remote-tracking branch 'origin/main' into brtqkr/42923-localize…
BrtqKr Jun 28, 2024
98a4d0f
add condition for no field
BrtqKr Jun 28, 2024
155937b
Merge remote-tracking branch 'origin/main' into brtqkr/42923-localize…
BrtqKr Jun 30, 2024
eb2550b
revert tests
BrtqKr Jun 30, 2024
a65a680
revert tests
BrtqKr Jun 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1942,7 +1942,7 @@ PODS:
- React-Codegen
- React-Core
- ReactCommon/turbomodule/core
- RNReanimated (3.7.2):
- RNReanimated (3.8.1):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you explicitly need these changes? If not, let's not include these.

- glog
- hermes-engine
- RCT-Folly (= 2022.05.16.00)
Expand Down Expand Up @@ -2594,7 +2594,7 @@ SPEC CHECKSUMS:
rnmapbox-maps: df8fe93dbd251f25022f4023d31bc04160d4d65c
RNPermissions: 0b61d30d21acbeafe25baaa47d9bae40a0c65216
RNReactNativeHapticFeedback: 616c35bdec7d20d4c524a7949ca9829c09e35f37
RNReanimated: 51db0fff543694d931bd3b7cab1a3b36bd86c738
RNReanimated: 323436b1a5364dca3b5f8b1a13458455e0de9efe
RNScreens: 9ec969a95987a6caae170ef09313138abf3331e1
RNShare: 2a4cdfc0626ad56b0ef583d424f2038f772afe58
RNSound: 6c156f925295bdc83e8e422e7d8b38d33bc71852
Expand All @@ -2606,7 +2606,7 @@ SPEC CHECKSUMS:
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Turf: 13d1a92d969ca0311bbc26e8356cca178ce95da2
VisionCamera: 1394a316c7add37e619c48d7aa40b38b954bf055
Yoga: 64cd2a583ead952b0315d5135bf39e053ae9be70
Yoga: 1b901a6d6eeba4e8a2e8f308f708691cdb5db312

PODFILE CHECKSUM: 66a5c97ae1059e4da1993a4ad95abe5d819f555b

Expand Down
11 changes: 5 additions & 6 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,12 +658,11 @@ const CONST = {
CLOSED: 'CLOSED',
CREATED: 'CREATED',
DELEGATE_SUBMIT: 'DELEGATESUBMIT', // OldDot Action
DELETED_ACCOUNT: 'DELETEDACCOUNT', // OldDot Action
DELETED_ACCOUNT: 'DELETEDACCOUNT', // Deprecated OldDot Action
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go ahead and just remove all the deprecated actions. They are blocked at the back end.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is sequenceNumber case covered as well? This temporary fallback has been there for over a year

    // HACK ALERT: We're temporarily filtering out any reportActions keyed by sequenceNumber
    // to prevent bugs during the migration from sequenceNumber -> reportActionID
    if (String(reportAction.sequenceNumber) === key) {
        Log.info('Front-end filtered out reportAction keyed by sequenceNumber!', false, reportAction);
        return true;
    }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave that one be for now

DISMISSED_VIOLATION: 'DISMISSEDVIOLATION',
DONATION: 'DONATION', // OldDot Action
DONATION: 'DONATION', // Deprecated OldDot Action
EXPORTED_TO_CSV: 'EXPORTCSV', // OldDot Action
EXPORTED_TO_INTEGRATION: 'EXPORTINTEGRATION', // OldDot Action
EXPORTED_TO_QUICK_BOOKS: 'EXPORTED', // OldDot Action
FORWARDED: 'FORWARDED', // OldDot Action
HOLD: 'HOLD',
HOLD_COMMENT: 'HOLDCOMMENT',
Expand All @@ -683,9 +682,9 @@ const CONST = {
REIMBURSEMENT_DELAYED: 'REIMBURSEMENTDELAYED', // OldDot Action
REIMBURSEMENT_QUEUED: 'REIMBURSEMENTQUEUED',
REIMBURSEMENT_DEQUEUED: 'REIMBURSEMENTDEQUEUED',
REIMBURSEMENT_REQUESTED: 'REIMBURSEMENTREQUESTED', // OldDot Action
REIMBURSEMENT_SETUP: 'REIMBURSEMENTSETUP', // OldDot Action
REIMBURSEMENT_SETUP_REQUESTED: 'REIMBURSEMENTSETUPREQUESTED', // OldDot Action
REIMBURSEMENT_REQUESTED: 'REIMBURSEMENTREQUESTED', // Deprecated OldDot Action
REIMBURSEMENT_SETUP: 'REIMBURSEMENTSETUP', // Deprecated OldDot Action
REIMBURSEMENT_SETUP_REQUESTED: 'REIMBURSEMENTSETUPREQUESTED', // Deprecated OldDot Action
RENAMED: 'RENAMED',
REPORT_PREVIEW: 'REPORTPREVIEW',
SELECTED_FOR_RANDOM_AUDIT: 'SELECTEDFORRANDOMAUDIT', // OldDot Action
Expand Down
41 changes: 41 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,35 @@ import type {
BeginningOfChatHistoryAnnounceRoomPartTwo,
BeginningOfChatHistoryDomainRoomPartOneParams,
CanceledRequestParams,
ChangeFieldParams,
ChangePolicyParams,
ChangeTypeParams,
CharacterLimitParams,
ConfirmThatParams,
DateShouldBeAfterParams,
DateShouldBeBeforeParams,
DelegateSubmitParams,
DeleteActionParams,
DeleteConfirmationParams,
DidSplitAmountMessageParams,
DistanceRateOperationsParams,
EditActionParams,
ElectronicFundsParams,
EnterMagicCodeParams,
ExportedToIntegrationParams,
FormattedMaxLengthParams,
ForwardedParams,
GoBackMessageParams,
GoToRoomParams,
InstantSummaryParams,
IntegrationsMessageParams,
LocalTimeParams,
LoggedInAsParams,
LogSizeParams,
ManagerApprovedAmountParams,
ManagerApprovedParams,
MarkedReimbursedParams,
MarkReimbursedFromIntegrationParams,
NewFaceEnterMagicCodeParams,
NoLongerHaveAccessParams,
NotAllowedExtensionParams,
Expand Down Expand Up @@ -66,16 +75,20 @@ import type {
SetTheRequestParams,
SettledAfterAddedBankAccountParams,
SettleExpensifyCardParams,
ShareParams,
SizeExceededParams,
SplitAmountParams,
StepCounterParams,
StripePaidParams,
TaskCreatedActionParams,
TermsParams,
ThreadRequestReportNameParams,
ThreadSentMoneyReportNameParams,
ToValidateLoginParams,
TransferParams,
TranslationBase,
UnapprovedParams,
UnshareParams,
UntilTimeParams,
UpdatedTheDistanceParams,
UpdatedTheRequestParams,
Expand Down Expand Up @@ -2837,6 +2850,34 @@ export default {
genericUpdateReportFieldFailureMessage: 'Unexpected error while updating the field, please try again later.',
genericUpdateReporNameEditFailureMessage: 'Unexpected error while renaming the report, please try again later.',
noActivityYet: 'No activity yet',
actions: {
type: {
changeField: ({oldValue, newValue, fieldName}: ChangeFieldParams) => `changed ${fieldName} from ${oldValue} to ${newValue}`,
changePolicy: ({fromPolicy, toPolicy}: ChangePolicyParams) => `changed policy from ${fromPolicy} to ${toPolicy}`,
changeType: ({oldType, newType}: ChangeTypeParams) => `changed type from ${oldType} to ${newType}`,
delegateSubmit: ({delegateUser, originalManager}: DelegateSubmitParams) => `sent this report to ${delegateUser} since ${originalManager} is on vacation`,
exportedToCSV: `exported this report to CSV`,
exportedToIntegration: ({label}: ExportedToIntegrationParams) => `exported this report to ${label}`,
forwarded: ({amount, currency}: ForwardedParams) => `approved ${currency}${amount}`,
// verify errorMessage
integrationsMessage: ({errorMessage}: IntegrationsMessageParams) => `failed to export this report to NetSuite. ${errorMessage}`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking but NetSuite here doesn't seem to be variable depending on what accounting solution is connected? I.e they could be exporting to Xero, not NetSuite, for example.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's done.

managerAttachReceipt: `added a receipt`,
managerDetachReceipt: `removed the receipt`,
markedReimbursed: ({amount, currency}: MarkedReimbursedParams) => `paid ${currency}${amount} elsewhere`,
markedReimbursedFromIntegration: ({amount, currency}: MarkReimbursedFromIntegrationParams) => `paid ${currency}${amount} via integration`,
outdatedBankAccount: `couldn’t process the payment due to a problem with the payer’s bank account`,
reimbursementACHBounce: `couldn’t process the payment, as the payer doesn’t have sufficient funds`,
reimbursementACHCancelled: `canceled the payment`,
reimbursementAccountChanged: `couldn’t process the payment, as the payer changed bank accounts`,
reimbursementDelayed: `processed the payment but it’s delayed by 1-2 more business days`,
selectedForRandomAudit: `[randomly selected](https://help.expensify.com/articles/expensify-classic/reports/Set-a-random-report-audit-schedule) for review`,
Copy link
Contributor

@Pujan92 Pujan92 Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this olddot action, it shows a message in a plain text instead of converted markdown which caused the issue #45819

share: ({to}: ShareParams) => `invited user ${to}`,
unshare: ({to}: UnshareParams) => `removed user ${to}`,
stripePaid: ({amount, currency}: StripePaidParams) => `paid ${currency}${amount}`,
takeControl: `took control`,
unapproved: ({amount, currency}: UnapprovedParams) => `unapproved ${currency}${amount}`,
},
},
},
chronos: {
oooEventSummaryFullDay: ({summary, dayCount, date}: OOOEventSummaryFullDayParams) => `${summary} for ${dayCount} ${dayCount === 1 ? 'day' : 'days'} until ${date}`,
Expand Down
41 changes: 41 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ import type {
BeginningOfChatHistoryAnnounceRoomPartTwo,
BeginningOfChatHistoryDomainRoomPartOneParams,
CanceledRequestParams,
ChangeFieldParams,
ChangePolicyParams,
ChangeTypeParams,
CharacterLimitParams,
ConfirmThatParams,
DateShouldBeAfterParams,
DateShouldBeBeforeParams,
DelegateSubmitParams,
DeleteActionParams,
DeleteConfirmationParams,
DidSplitAmountMessageParams,
Expand All @@ -23,15 +27,20 @@ import type {
ElectronicFundsParams,
EnglishTranslation,
EnterMagicCodeParams,
ExportedToIntegrationParams,
FormattedMaxLengthParams,
ForwardedParams,
GoBackMessageParams,
GoToRoomParams,
InstantSummaryParams,
IntegrationsMessageParams,
LocalTimeParams,
LoggedInAsParams,
LogSizeParams,
ManagerApprovedAmountParams,
ManagerApprovedParams,
MarkedReimbursedParams,
MarkReimbursedFromIntegrationParams,
NewFaceEnterMagicCodeParams,
NoLongerHaveAccessParams,
NotAllowedExtensionParams,
Expand Down Expand Up @@ -65,15 +74,19 @@ import type {
SetTheRequestParams,
SettledAfterAddedBankAccountParams,
SettleExpensifyCardParams,
ShareParams,
SizeExceededParams,
SplitAmountParams,
StepCounterParams,
StripePaidParams,
TaskCreatedActionParams,
TermsParams,
ThreadRequestReportNameParams,
ThreadSentMoneyReportNameParams,
ToValidateLoginParams,
TransferParams,
UnapprovedParams,
UnshareParams,
UntilTimeParams,
UpdatedTheDistanceParams,
UpdatedTheRequestParams,
Expand Down Expand Up @@ -2879,6 +2892,34 @@ export default {
genericUpdateReportFieldFailureMessage: 'Error inesperado al actualizar el campo. Por favor, inténtalo más tarde.',
genericUpdateReporNameEditFailureMessage: 'Error inesperado al cambiar el nombre del informe. Vuelva a intentarlo más tarde.',
noActivityYet: 'Sin actividad todavía',
actions: {
type: {
changeField: ({oldValue, newValue, fieldName}: ChangeFieldParams) => `cambió ${fieldName} de ${oldValue} a ${newValue}`,
changePolicy: ({fromPolicy, toPolicy}: ChangePolicyParams) => `cambió policy de ${fromPolicy} a ${toPolicy}`,
changeType: ({oldType, newType}: ChangeTypeParams) => `cambió type de ${oldType} a ${newType}`,
delegateSubmit: ({delegateUser, originalManager}: DelegateSubmitParams) => `envié este informe a ${delegateUser} ya que ${originalManager} está de vacaciones`,
exportedToCSV: `exportó este informe a CSV`,
exportedToIntegration: ({label}: ExportedToIntegrationParams) => `exportó este informe a ${label}`,
forwarded: ({amount, currency}: ForwardedParams) => `aprobado ${currency}${amount}`,
// verify errorMessage
integrationsMessage: ({errorMessage}: IntegrationsMessageParams) => `no se pudo exportar este informe a NetSuite. ${errorMessage}`,
managerAttachReceipt: `agregó un recibo`,
managerDetachReceipt: `quitó el recibo`,
markedReimbursed: ({amount, currency}: MarkedReimbursedParams) => `pagó ${currency}${amount} en otro lugar`,
markedReimbursedFromIntegration: ({amount, currency}: MarkReimbursedFromIntegrationParams) => `pagó ${currency}${amount} mediante integración`,
outdatedBankAccount: `no se pudo procesar el pago debido a un problema con la cuenta bancaria del pagador`,
reimbursementACHBounce: `no se pudo procesar el pago porque el pagador no tiene fondos suficientes`,
reimbursementACHCancelled: `canceled the payment`,
reimbursementAccountChanged: `no se pudo procesar el pago porque el pagador cambió de cuenta bancaria`,
reimbursementDelayed: `procesó el pago pero se retrasó entre 1 y 2 días hábiles más`,
selectedForRandomAudit: `[seleccionado al azar](https://help.expensify.com/articles/expensify-classic/reports/Set-a-random-report-audit-schedule) para revisión`,
share: ({to}: ShareParams) => `usuario invitado ${to}`,
unshare: ({to}: UnshareParams) => `usuario eliminado ${to}`,
stripePaid: ({amount, currency}: StripePaidParams) => `pagado ${currency}${amount}`,
takeControl: `tomó el control`,
unapproved: ({amount, currency}: UnapprovedParams) => `no aprobado ${currency}${amount}`,
},
},
},
chronos: {
oooEventSummaryFullDay: ({summary, dayCount, date}: OOOEventSummaryFullDayParams) => `${summary} por ${dayCount} ${dayCount === 1 ? 'día' : 'días'} hasta el ${date}`,
Expand Down
39 changes: 39 additions & 0 deletions src/languages/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,32 @@ type DistanceRateOperationsParams = {count: number};

type ReimbursementRateParams = {unit: Unit};

type ChangeFieldParams = {oldValue: string; newValue: string; fieldName: string};

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

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

type DelegateSubmitParams = {delegateUser: string; originalManager: string};

type ExportedToIntegrationParams = {label: string};

type ForwardedParams = {amount: string; currency: string};

type IntegrationsMessageParams = {errorMessage: string};

type MarkedReimbursedParams = {amount: string; currency: string};

type MarkReimbursedFromIntegrationParams = {amount: string; currency: string};

type ShareParams = {to: string};

type UnshareParams = {to: string};

type StripePaidParams = {amount: string; currency: string};

type UnapprovedParams = {amount: string; currency: string};

export type {
AdminCanceledRequestParams,
ApprovedAmountParams,
Expand Down Expand Up @@ -402,4 +428,17 @@ export type {
HeldRequestParams,
PaySomeoneParams,
ReimbursementRateParams,
ChangeFieldParams,
ChangePolicyParams,
ChangeTypeParams,
ExportedToIntegrationParams,
DelegateSubmitParams,
ForwardedParams,
IntegrationsMessageParams,
MarkedReimbursedParams,
MarkReimbursedFromIntegrationParams,
ShareParams,
UnshareParams,
StripePaidParams,
UnapprovedParams,
};
Loading
Loading