Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.58k stars 2.92k forks source link

[HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [HIGH][ESM] Localize System Messages #42923

Closed trjExpensify closed 4 months ago

trjExpensify commented 6 months ago

Following the Localize System Messages section of the Enhance System Messages design doc, make the necessary changes to NewDot to ensure that system messages can be displayed in both English and in Spanish.

CC: @deetergp @dylanexpensify I've moved this issue from E/E here.

Issue OwnerCurrent Issue Owner: @dylanexpensify
melvin-bot[bot] commented 6 months ago

Auto-assigning issues to engineers is no longer supported. If you think this issue should receive engineering attention, please raise it in #whatsnext.

melvin-bot[bot] commented 6 months ago

Triggered auto assignment to @anmurali (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

BrtqKr commented 6 months ago

Hey, I'm a developer from SWM I'd like to take over this issue

trjExpensify commented 6 months ago

Perfect! Doc has been shared to you for access to the section referenced. 👍

melvin-bot[bot] commented 6 months ago

@BrtqKr, @dylanexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

BrtqKr commented 6 months ago

Update for today: I'm somewhere in the middle of that, I'll probably request translations and prepare a PR tomorrow
For now, I've got two questions:

BrtqKr commented 6 months ago

Update for today:

deetergp commented 6 months ago

I've asked about your questions:

I'm not sure if I understand where ended up in the discussion regarding the delayed reimbursement part, am I supposed to treat this reason as a param, or is it still during verification?

Here

And

I assume that in here it's about this url specifically https://help.expensify.com/articles/expensify-classic/reports/Set-a-random-report-audit-schedule

Here

deetergp commented 5 months ago

@BrtqKr: @dylanexpensify went ahead and got the translations for you:

English: changed merchant from [X] to [Y]
Spanish: cambió de comerciante de [X] a [Y]

English: changed amount from [X] to [Y]
Spanish: cantidad cambiada de [X] a [Y]

English: changed X from [Y] to [Z]
Spanish: cambió X de [X] a [Y]

English: sent this report to USER_B, as USER_A is on vacation
Spanish: envié este informe a USER_B, ya que USER_A está de vacaciones

English: exported this report to [CSV/Integration/QuickBooks]
Spanish: exportó este informe a [CSV/Integración/QuickBooks]

English: marked this report as manually exported to $destination
Spanish: marcó este informe como exportado manualmente a $destination

English: removed the receipt
Spanish: quitó el recibo

English: added a receipt
Spanish: agregó un recibo

English: processed the payment but it’s delayed by 1-2 more business days
Spanish: procesó el pago pero se retrasó entre 1 y 2 días hábiles más

English: canceled the payment
Spanish: canceló el pago

English: paid $X.XX elsewhere
Spanish: pagó $X.XX en otro lugar

English: paid $X.XX via integration
Spanish: pagó $X.XX mediante integración

English: randomly selected for review
Spanish: seleccionado al azar para revisión

English: invited user B
Spanish: usuario invitado B

English: removed user B
Spanish: usuario eliminado B

English: paid $X.XX
Spanish: pagado $X.XX

English: took control
Spanish: tomó el control

English: unapproved $X.XX
Spanish: no aprobado $X.XX

English: failed to export this report to NetSuite. [Specific error message]
Spanish: No se pudo exportar este informe a NetSuite. [Specific error message]

English: couldn’t process the payment, as the payer doesn’t have sufficient funds
Spanish: no se pudo procesar el pago porque el pagador no tiene fondos suficientes

English: couldn’t process the payment due to a problem with the payer’s bank account
Spanish: no se pudo procesar el pago debido a un problema con la cuenta bancaria del pagador.

English: couldn’t process the payment, as the payer changed bank accounts
Spanish: no se pudo procesar el pago porque el pagador cambió de cuenta bancaria.
BrtqKr commented 5 months ago

Update for today: I've applied the translation changes. I'm waiting for the messaging part, so I can apply types, test the whole flow, and pass it to the review. Please let me know when it's available 🙏

BrtqKr commented 5 months ago

Update for today: Haven't touched this ticket - still waiting for the back-end PR, which is close to being merged and deployed.

melvin-bot[bot] commented 5 months ago

@deetergp, @BrtqKr, @dylanexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

deetergp commented 5 months ago

The backend PR should be merged sometime today 🤞

BrtqKr commented 5 months ago

Thanks a lot! I'll try to wire this up soon

deetergp commented 5 months ago

Answered some questions @BrtqKr had in Slack.

deetergp commented 5 months ago

Okay @BrtqKr I think this should give you what you need. If you see a blank array, that means you just need to show the actor's display name. Please let me know if you have any remaining questions:

{
    "ACTION_CHANGE_FIELD": {
        "fieldName": "<string>",
    "oldValue": "<string>",
    "newValue": "<string>"
    },
    "ACTION_CHANGE_POLICY": {
        "fromPolicy": "<string>",
        "toPolicy": "<string>"
    },
    "ACTION_CHANGETYPE": {
        "newType": "<string>"
    },
    "ACTION_DELEGATE_SUBMIT": {
        "automaticAction":"<bool>",
        "delegate":"<string> email",
        "harvesting":"<bool>",
        "harvestingGUID":"<string>",
        "isOnPolicy":"<bool>",
        "lastModified":"<string> datetime",
        "originalManager":"<string> email"
    },
    "ACTION_EXPORTED_TO_CSV": [],
    "ACTION_EXPORTED_TO_INTEGRATION": {
        "label":"<string> integration name",
        "markedManually": "<bool>",
        "automaticAction":"<bool>",
        "reimbursableUrls":[],
        "nonReimbursableUrls":[]
    },
    "ACTION_FORWARDED": {
        "automaticAction": "<string>"
    },
    "ACTION_MANAGER_ATTACH_RECEIPT": {
        "merchant": "<string>"
    },
    "ACTION_MANAGER_DETACH_RECEIPT": {
        "merchant": "<string>"
    },
    "ACTION_REIMBURSEMENT_DELAYED": {
        "automaticAction": "<bool>"
    },
    "ACTION_REIMBURSEMENT_ACH_CANCELED": {
        {"cancellationReason":"<string> consts that symbolize preset reasons"}
    },
    "ACTION_MARKEDREIMBURSED": {
        "isApproved": "<bool>",
        "who": "account of sender"
    },
    "ACTION_MARK_REIMBURSED_FROM_INTEGRATION": {
        "label":"<string>",
        "amount":"<string>",
        "currency":"<string>"
    },
    "ACTION_SELECTED_FOR_RANDOM_AUDIT": [],
    "ACTION_SHARE_REPORT": {
        "message":"<string>",
        "to":"<string>"
    },
    "ACTION_UNSHARE": {
        "lastModified":"<string>",
        "message":"<string>",
        "to":"<string>"
    },
    "ACTION_STRIPE_PAID": [],
    "ACTION_TAKE_CONTROL": {
        "delegate":"<string> email"
    },
    "ACTION_UNAPPROVED": {
        "delegate":"<string> email",
        "lastModified":"<string> datetime"
    }
}
BrtqKr commented 5 months ago

@deetergp

  1. I think the format of this message was identical to the rest change actions, so this is probably missing oldType, right?
    "ACTION_CHANGETYPE": {
        "newType": "<string>"
    },
  2. What is automaticAction in this case? I expected something akin to the rest of the messages containing specific values since the message is approved $XXX.XX.
    "ACTION_FORWARDED": {
        "automaticAction": "<string>"
    },
  1. I'm missing the INTEGRATIONSMESSAGE action with a param, will this be passed as errorMessage?

({errorMessage}: IntegrationsMessageParams) =>failed to export this report to NetSuite. ${errorMessage}``

  1. MARKEDREIMBURSED is probably also missing currency and amount

paid $X.XX elsewhere

  1. STRIPEPAID as above

paid $X.XX

  1. UNAPPROVED as above

unapproved $X.XX

deetergp commented 5 months ago

@BartoszGrajdek I'll give you some real world example of each of these from the DB.

I don't think oldType is a part of this message.

CHANGETYPE

``` {"newType":"invoice"} {"newType":"invoice"} {"newType":"expense"} {"lastModified":"2023-06-16 03:26:42.677","newType":"expense"} {"lastModified":"2024-05-09 16:09:45.019","newType":"expense"} {"delegate":"user@email.com","newType":"expense"} {"newType":"expense"} {"delegate":"user@email.com","lastModified":"2024-03-11 15:52:43.248","newType":"expense"} {"lastModified":"2023-08-22 14:01:55.092","newType":"expense"} {"newType":"expense"} ```

FORWARDED

``` {"cc":"","hasExternalComment":false,"lastModified":"2024-02-15 00:23:54.166","message":"","to":"user@email.com","workflow":"ADVANCED"} {"message":"Andy please review, thanks!","to":"user@email.com","cc":"","workflow":"ADVANCED","hasExternalComment":false} {"cc":"","hasExternalComment":false,"lastModified":"2023-08-17 21:13:47.444","message":"","to":"user@email.com","workflow":"ADVANCED"} {"cc":"","hasExternalComment":false,"lastModified":"2023-11-13 15:17:18.730","message":"","to":"ruser@email.com","workflow":"ADVANCED"} {"message":"","to":"user@email.com","cc":"","workflow":"ADVANCED","hasExternalComment":false} {"cc":"","hasExternalComment":false,"lastModified":"2024-05-08 19:20:14.264","message":"","to":"user@email.com","workflow":"ADVANCED"} {"cc":"","hasExternalComment":true,"lastModified":"2024-03-29 19:33:10.125","message":"","to":"user@email.com","workflow":"DYNAMIC_EXTERNAL"} {"message":"user@email.com is set as the next approver in the policy settings.","to":"user@email.com","cc":"","workflow":"DYNAMIC_EXTERNAL","hasExternalComment":true} {"cc":"","hasExternalComment":false,"lastModified":"2024-04-16 15:50:16.740","message":"Detail review completed by MB, provide final approval if expenses are appropriate","to":"user@email.com","workflow":"ADVANCED"} {"message":"","to":"user@email.com","cc":"","workflow":"ADVANCED","hasExternalComment":false} ```

INTEGRATIONSMESSAGE

``` {"result":{"code":200,"success":true,"messages":["Error marking NetSuite Expense Report ID 176906 (Expensify ReportID: 6642144355609444) as paid: We weren't able to create a Bill Payment for this report, because we don't know what value we should set for Department. This is because the Department field is required on the Bill Payment form, but we couldn't see a value for Department either in the expense report in Expensify, or on the employee's record in NetSuite. You'll need to set this field as not required, or provide a value on the report in Expensify or in the employee record in NetSuite."],"action":"Mark as Paid"},"automaticAction":true,"source":"netsuite","label":"NetSuite"} {"automaticAction":true,"label":"NetSuite","lastModified":"2024-02-18 00:16:51.997","result":{"action":"Mark as Paid","code":200,"messages":["Error marking NetSuite Expense Report ID 59187 (Expensify ReportID: 1234812370475635) as paid: We weren't able to create a Bill Payment for this report, probably because we couldn't find the department field on the Bill Payment form. Please enable the department field on the Bill Payment form."],"success":true},"source":"netsuite"} {"automaticAction":true,"label":"NetSuite","lastModified":"2023-12-13 01:12:21.936","result":{"action":"Mark as Paid","code":200,"messages":["Error marking NetSuite Expense Report ID 9240584 (Expensify ReportID: 1795435432609086) as paid: Invalid account reference key 229 for subsidiary 2."],"success":true},"source":"netsuite"} {"automaticAction":true,"label":"NetSuite","lastModified":"2023-09-22 08:23:29.740","result":{"action":"Mark as Paid","code":200,"messages":["Error marking NetSuite Expense Report ID 1399549 (Expensify ReportID: 53545916) as paid: Invalid account reference key 897 for subsidiary 13."],"success":true},"source":"netsuite"} {"automaticAction":true,"label":"NetSuite","lastModified":"2024-04-20 14:21:51.632","result":{"action":"Mark as Paid","code":200,"messages":["Error marking NetSuite Expense Report ID 47511 (Expensify ReportID: 96158533) as paid: We weren't able to create a Bill Payment for this report, because the payable account is not applicable this type of payment. You will need to make sure that you have set the correct A/P Approval Account via the Advanced section of your NetSuite connection configuration."],"success":true},"source":"netsuite"} {"automaticAction":true,"label":"NetSuite","lastModified":"2023-11-27 07:59:03.757","result":{"action":"Mark as Paid","code":200,"messages":["Error marking NetSuite Expense Report ID 2040619 (Expensify ReportID: 73293945) as paid: Invalid entity reference key 103156."],"success":true},"source":"netsuite"} {"automaticAction":true,"label":"NetSuite","lastModified":"2024-05-03 15:10:11.499","result":{"action":"Mark as Paid","code":200,"messages":["Error marking NetSuite Expense Report ID 116545 (Expensify ReportID: 70583154) as paid: We weren't able to create a Bill Payment for this report, because the payable account is not applicable this type of payment. You will need to make sure that you have set the correct A/P Approval Account via the Advanced section of your NetSuite connection configuration."],"success":true},"source":"netsuite"} {"automaticAction":true,"label":"NetSuite","lastModified":"2024-01-28 01:34:22.210","result":{"action":"Mark as Paid","code":200,"messages":["Error marking NetSuite Expense Report ID 218120 (Expensify ReportID: 4237600728108838) as paid: Invalid account reference key 1 for subsidiary 10."],"success":true},"source":"netsuite"} {"automaticAction":true,"label":"NetSuite","lastModified":"2023-06-22 17:24:16.280","result":{"action":"Mark as Paid","code":200,"messages":["Error marking NetSuite Expense Report ID 214531 (Expensify ReportID: 3260014260527700) as paid: We weren't able to create a Bill Payment for this report, probably because we couldn't find the department field on the Bill Payment form. Please enable the department field on the Bill Payment form."],"success":true},"source":"netsuite"} {"automaticAction":false,"label":"Intacct","lastModified":"2023-12-11 19:12:48.410","result":{"code":200,"messages":["Sage Intacct appears to be unavailable at this time; please try again later."],"success":true},"source":"intacct"} ```

MARKEDREIMBURSED

``` {"message":"Reimbursed- see Nov 15th, 2022 paycheck"} {"message":""} {"lastModified":"2023-10-09 15:47:10.595","message":""} {"delegate":"user@email.com","lastModified":"2023-07-14 11:26:50.528","message":""} {"message":""} {"lastModified":"2023-12-06 15:20:28.944","message":"reimbursed manually"} {"lastModified":"2023-10-24 08:21:41.426","message":""} {"delegate":"user@email.com","lastModified":"2023-12-12 11:23:15.752","message":""} {"message":""} {"lastModified":"2024-03-15 12:01:26.015","message":""} ```

STRIPEPAID

All empty arrays 🤷 ``` [] [] [] [] [] [] [] [] [] [] ```

UNAPPROVED

``` {"delegate":"user@email.com","lastModified":"2023-08-10 15:25:17.006"} [] [] [] [] [] [] [] [] [] ```

BartoszGrajdek commented 5 months ago

Wrong mention ^ 😅

trjExpensify commented 5 months ago

yeah, that was for @BrtqKr!

deetergp commented 5 months ago

Apologies for the ping Bartosz — I was too quick with the tab-completion 😅

dylanexpensify commented 5 months ago

Haha, we're moving! ETA on this being ready for review, @BrtqKr?

deetergp commented 5 months ago

Just reviewed the draft PR. Final should be out for review soon!

melvin-bot[bot] commented 5 months ago

@deetergp, @BrtqKr, @dylanexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

parasharrajat commented 5 months ago

Can I get access to doc @deetergp @dylanexpensify?

parasharrajat commented 5 months ago

Thanks that is correct. Could you please remove the message to protect email privacy?

parasharrajat commented 5 months ago

I was C+ on the PR @dylanexpensify. Please assign me.

dylanexpensify commented 5 months ago

Done!

melvin-bot[bot] commented 5 months ago

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

melvin-bot[bot] commented 4 months ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 4 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.5-13 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-17. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 4 months ago

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

melvin-bot[bot] commented 4 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.6-8 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-22. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 4 months ago

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

dylanexpensify commented 4 months ago

Coming up!

dylanexpensify commented 4 months ago

Payment summary:

Please request!

parasharrajat commented 4 months ago

Payment requested as per https://github.com/Expensify/App/issues/42923#issuecomment-2236006198

JmillsExpensify commented 4 months ago

$500 approved for @parasharrajat