You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-09-20] [$500] MacOS: Context Menu does not translate to Spanish #25704
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.
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
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:
changed the title [-]MacOS: Context Menu does not translate to Spanish[/-][+][$1000] MacOS: Context Menu does not translate to Spanish[/+]on Aug 28, 2023
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.
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.
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.
Activity
melvin-bot commentedon Aug 22, 2023
Triggered auto assignment to @michaelhaxhiu (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Aug 22, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)izarutskaya commentedon Aug 22, 2023
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
ContextMenuoptions 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
ContextMenuin the application does not handle translations. Specifically, the labels for various options in theContextMenu(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
What changes do you think we should make in order to solve the problem?
To address this issue, the
ContextMenufunction can be enhanced to support translations. Specifically, the labels for the default menu options can be provided directly using the labels option, like so:Additionally, for custom menu items that we're manually appending, the label can be set directly within the
MenuItem: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 commentedon Aug 22, 2023
Thanks!
Solution video:
context.translation.solution.mp4
melvin-bot commentedon Aug 28, 2023
@michaelhaxhiu Eep! 4 days overdue now. Issues have feelings too...
michaelhaxhiu commentedon 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
Externallabel so that folks know the prices before they invest too much time.[-]MacOS: Context Menu does not translate to Spanish[/-][+][$1000] MacOS: Context Menu does not translate to Spanish[/+]melvin-bot commentedon Aug 28, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01780b67747fbfff83
44 remaining items
neil-marcellini commentedon Sep 22, 2023
Bump for payment @michaelhaxhiu
michaelhaxhiu commentedon Sep 22, 2023
Payment summary:
@situchan do you get paid via NewDot or Upwork?
ygshbht commentedon Sep 22, 2023
Does this not get 50% bonus?
michaelhaxhiu commentedon 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
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 commentedon Sep 22, 2023
@situchan do you get paid via NewDot or Upwork?
upwork
Example of bonus applied: #25889 (comment)
neil-marcellini commentedon Sep 25, 2023
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 commentedon Sep 25, 2023
Cool thanks for input @neil-marcellini (and sorry if i was a lil strict on my initial take, yall 😓)
michaelhaxhiu commentedon Sep 25, 2023
Bug reporter: $250 @ygshbht
Contributor: $750 @ygshbht (50% bonus)
C+: @situchan $750 @situchan (50% bonus)
michaelhaxhiu commentedon Sep 25, 2023
All are paid. @situchan can you please complete the BZ checklist so that we can close this?
situchan commentedon Sep 25, 2023
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 commentedon Sep 25, 2023
Cool, I agree that this was just a candid oversight. Closing!