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

[HOLD for payment 2023-09-20] [$500] MacOS: Context Menu does not translate to Spanish #25704

Closed
1 of 6 tasks
izarutskaya opened this issue Aug 22, 2023 · 45 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@izarutskaya
Copy link

izarutskaya commented Aug 22, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Launch Expensify MacOS app
  2. Set Profile > Preferences > Language > Spanish > Close
  3. In Report Composer, right click

Expected Result:

ContextMenu options are translated to Spanish like MenuItems in ToolBar

Actual Result:

ContextMenu options are not translated to Spanish

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.55-7

Reproducible in staging?: Y

Reproducible in production?: Y

If this was caught during regression testing, add the test name, ID and link from TestRail:

Email or phone of affected tester (no customers):

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

context.translation.issue.mp4
2023-08-19.23.11.17.mp4

Expensify/Expensify Issue URL:

Issue reported by: @ygshbht

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1691379420264869

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01780b67747fbfff83
  • Upwork Job ID: 1696262248411463680
  • Last Price Increase: 2023-09-05
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 22, 2023

Triggered auto assignment to @michaelhaxhiu (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Aug 22, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@izarutskaya
Copy link
Author

Proposal from @ygshbht

Proposal

Please re-state the problem that we are trying to solve in this issue.

The issue is that on the Expensify MacOS app, the ContextMenu options are not being translated to Spanish, even when the user has set the language preference to Spanish.

What is the root cause of that problem?

The current setup for the ContextMenu in the application does not handle translations. Specifically, the labels for various options in the ContextMenu (like cut, paste, and copy) aren't being translated based on the user's language preference.

App/desktop/main.js

Lines 42 to 57 in 21146e5

contextMenu({
append: (defaultActions, parameters, browserWindow) => [
new MenuItem({
// Only enable the menu item for Editable context which supports paste
visible: parameters.isEditable && parameters.editFlags.canPaste,
role: 'pasteAndMatchStyle',
accelerator: DESKTOP_SHORTCUT_ACCELERATOR.PASTE_AND_MATCH_STYLE,
}),
new MenuItem({
label: Localize.translate(CONST.LOCALES.DEFAULT, 'desktopApplicationMenu.pasteAsPlainText'),
visible: parameters.isEditable && parameters.editFlags.canPaste && clipboard.readText().length > 0,
accelerator: DESKTOP_SHORTCUT_ACCELERATOR.PASTE_AS_PLAIN_TEXT,
click: () => pasteAsPlainText(browserWindow),
}),
],
});

What changes do you think we should make in order to solve the problem?

To address this issue, the ContextMenu function can be enhanced to support translations. Specifically, the labels for the default menu options can be provided directly using the labels option, like so:

labels: {
    cut: Localize.translate(preferredLocale, 'desktopApplicationMenu.cut'),
    paste: Localize.translate(preferredLocale, 'desktopApplicationMenu.paste'),
    copy: Localize.translate(preferredLocale, 'desktopApplicationMenu.copy'),
    /** Rest of the desired translations */
}

Additionally, for custom menu items that we're manually appending, the label can be set directly within the MenuItem:

append: (defaultActions, parameters, browserWindow) => [
        new MenuItem({
            // Only enable the menu item for Editable context which supports paste
            visible: parameters.isEditable && parameters.editFlags.canPaste,
            role: 'pasteAndMatchStyle',
            accelerator: DESKTOP_SHORTCUT_ACCELERATOR.PASTE_AND_MATCH_STYLE,
            label: Localize.translate(preferredLocale, 'desktopApplicationMenu.pasteAndMatchStyle'),
        }),
        new MenuItem({
            label: Localize.translate(preferredLocale, 'desktopApplicationMenu.pasteAsPlainText'),
            visible: parameters.isEditable && parameters.editFlags.canPaste && clipboard.readText().length > 0,
            accelerator: DESKTOP_SHORTCUT_ACCELERATOR.PASTE_AS_PLAIN_TEXT,
            click: () => pasteAsPlainText(browserWindow),
        }),
    ],

Please note this is the bulk of solution, minor modifications such as listening to language change events and recreating the menu also need to be done to ensure the app functions like in the video below

@ygshbht
Copy link
Contributor

ygshbht commented Aug 22, 2023

Thanks!

Solution video:

context.translation.solution.mp4

@melvin-bot melvin-bot bot added the Overdue label Aug 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

@michaelhaxhiu Eep! 4 days overdue now. Issues have feelings too...

@michaelhaxhiu
Copy link
Contributor

michaelhaxhiu commented Aug 28, 2023

EDITED: I had to brew on this one. I think it's a valid issue to fix, but it's small and non-urgent. For that reason I want to propose we dock the payments to be as follows for this one-off:

Bug reporting bonus: $250
Contributor fix: $500
C+ proposal/PR review: $500

I'm stating these now before I assign the External label so that folks know the prices before they invest too much time.

@melvin-bot melvin-bot bot removed the Overdue label Aug 28, 2023
@michaelhaxhiu michaelhaxhiu added the External Added to denote the issue can be worked on by a contributor label Aug 28, 2023
@melvin-bot melvin-bot bot changed the title MacOS: Context Menu does not translate to Spanish [$1000] MacOS: Context Menu does not translate to Spanish Aug 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01780b67747fbfff83

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

Current assignee @michaelhaxhiu is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @situchan (External)

@michaelhaxhiu michaelhaxhiu changed the title [$1000] MacOS: Context Menu does not translate to Spanish [$250] MacOS: Context Menu does not translate to Spanish Aug 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

Upwork job price has been updated to $250

@ygshbht
Copy link
Contributor

ygshbht commented Aug 29, 2023

@michaelhaxhiu At the very least, I think the bug reporting price is fixed $250

@michaelhaxhiu michaelhaxhiu changed the title [$250] MacOS: Context Menu does not translate to Spanish [$500] MacOS: Context Menu does not translate to Spanish Aug 29, 2023
@michaelhaxhiu
Copy link
Contributor

I got a little ahead of myself 🐴 there's a change underway, but it's not announced. I updated my prior comment.

The updated amounts for the bounty are as follows:

Bug reporting bonus: $250
Contributor fix: $500
C+ proposal/PR review: $500

@michaelhaxhiu
Copy link
Contributor

@situchan when you are ready we have a proposal from @ygshbht ready for your review above 👀 .

@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

Upwork job price has been updated to $500

@melvin-bot melvin-bot bot added the Overdue label Sep 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

@michaelhaxhiu, @situchan Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

@michaelhaxhiu @situchan this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Sep 6, 2023
@ygshbht
Copy link
Contributor

ygshbht commented Sep 6, 2023

@situchan The PR is ready for review! If you want to add more translations to the other lables that electron-context-menu provides (please see options argument and start reading from showLearnSpelling https://www.npmjs.com/package/electron-context-menu) please let me know

@situchan
Copy link
Contributor

situchan commented Sep 7, 2023

@situchan The PR is ready for review! If you want to add more translations to the other lables that electron-context-menu provides (please see options argument and start reading from showLearnSpelling https://www.npmjs.com/package/electron-context-menu) please let me know

I think they're out of scope. These are all app uses:

Screenshot 2023-09-07 at 11 06 04 PM

@ygshbht
Copy link
Contributor

ygshbht commented Sep 7, 2023

Ok

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 13, 2023
@melvin-bot melvin-bot bot changed the title [$500] MacOS: Context Menu does not translate to Spanish [HOLD for payment 2023-09-20] [$500] MacOS: Context Menu does not translate to Spanish Sep 13, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

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

If no regressions arise, payment will be issued on 2023-09-20. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

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

  • [@situchan] The PR that introduced the bug has been identified. Link to the PR:
  • [@situchan] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@situchan] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@situchan] Determine if we should create a regression test for this bug.
  • [@situchan] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@michaelhaxhiu] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Sep 19, 2023
@neil-marcellini
Copy link
Contributor

Bump for payment @michaelhaxhiu

@melvin-bot melvin-bot bot removed the Overdue label Sep 22, 2023
@michaelhaxhiu
Copy link
Contributor

Payment summary:

@situchan do you get paid via NewDot or Upwork?

@ygshbht
Copy link
Contributor

ygshbht commented Sep 22, 2023

Does this not get 50% bonus?

@michaelhaxhiu
Copy link
Contributor

michaelhaxhiu commented Sep 22, 2023

I am basing my price point on Vit's slack comment in #expensify-open-source here:

https://expensify.slack.com/archives/C01GTK53T8Q/p1693407966629239?thread_ts=1693347701.566439&cid=C01GTK53T8Q

Good question, i think to make this fair consider that if the PR is non-urgent ie non related to the above topics, you dont have to rush as it would most likely not be merged in the time for the urgency bonus. I believe if it’s urgent pr we make external the engineer/ bugzero person will clealy clarify that

This was assigned Sept 5, and merged sept 11 (delay likely due to feature freeze). This scenario exact scenario is what Vit outlined in his commentimo. But at the same time... I get that there was some mixed guidance on this GH issue about bonuses and so this is totally fair for you to ask @ygshbht.

If you & situ or @neil-marcellini feel strongly, I am obviously open to offering the bonus. I just was trying to fairly apply the rule in slack across the board. As you can imagine this gets hairy for a BZ to discern when we start making one-off exceptions from the rule of thumb.

@situchan
Copy link
Contributor

@situchan do you get paid via NewDot or Upwork?

upwork

Example of bonus applied: #25889 (comment)

@neil-marcellini
Copy link
Contributor

I approved the proposal on September 6th, the PR was raised the same day, C+ approved on the 8th, I approved and merged on the 12th. So it was good to merge within 3 days, but I was slow to review. I think we should give the bonuses @michaelhaxhiu.

@michaelhaxhiu
Copy link
Contributor

Cool thanks for input @neil-marcellini (and sorry if i was a lil strict on my initial take, yall 😓)

@michaelhaxhiu
Copy link
Contributor

Bug reporter: $250 @ygshbht
Contributor: $750 @ygshbht (50% bonus)
C+: @situchan $750 @situchan (50% bonus)

@michaelhaxhiu
Copy link
Contributor

All are paid. @situchan can you please complete the BZ checklist so that we can close this?

@situchan
Copy link
Contributor

No regression. This is for desktop only, Spanish only, context menu only which is super rare care for the user. I think this is enough reason why we don't wanna add regression test step.

@michaelhaxhiu
Copy link
Contributor

Cool, I agree that this was just a candid oversight. Closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

6 participants