-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$500] Assign Task - Task completion and reopening notification not translated in Share Somewhere section #25633
Comments
ProposalPlease re-state the problem that we are trying to solve in this issue.Task completion and reopening notification not translated in Share Somewhere section What is the root cause of that problem?The translation for complete task and re-open task work well in LHN because we have logic to update alternativeText in getOptionData for LHN options Lines 300 to 304 in 08b75f3
But when creating option for share destination, we don't have any logic to update the translation like we did in LHN What changes do you think we should make in order to solve the problem?I suggest that when creating option for share destination, we should update translation if the last actionName is complete task or reopen task (It seems we miss translate cancelled task message in LHN)
Lines 300 to 304 in 08b75f3
add condition:
With this approach, we need to define visibleReportActionItems as we did in SidebarUtils. Result![]() |
ProposalPlease re-state the problem we are trying to fixFor task reports, actions like reopening and completing are not translated to Spanish in share options but are translated in LHN, therefore, an inconsistency. Disclaimer: This proposal is a little lengthy because I went into a lot of detail for the explanation please be sure to ask about any part that might be doubtful, I will be happy to explain it further. What is the root cause of the problem?When creating the options to display in RHP, we are using the Lines 297 to 308 in aaa12f4
But this translation is not happening when we create options to share because that uses the method App/src/libs/OptionsListUtils.js Line 490 in 38ed41f
What changes should we make in-order to solve this?We should stop the differential use of the So after moving that logic, this is how the function getLastMessageTextForReport(report) {
const lastReportAction = _.find(
allSortedReportActions[report.reportID],
(reportAction, key) => ReportActionUtils.shouldReportActionBeVisible(reportAction, key) && reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
);
let lastMessageTextFromReport = report ? report.lastMessageText || '' : '';
const lastNonWhisper = _.find(allSortedReportActions[report.reportID], (action) => !ReportActionUtils.isWhisperAction(action)) || {};
if (ReportUtils.isReportMessageAttachment({text: report.lastMessageText, html: report.lastMessageHtml, translationKey: report.lastMessageTranslationKey})) {
lastMessageTextFromReport = `[${Localize.translateLocal(report.lastMessageTranslationKey || 'common.attachment')}]`;
} else if (ReportActionUtils.isReportPreviewAction(lastReportAction)) {
const iouReport = ReportUtils.getReport(ReportActionUtils.getIOUReportIDFromReportActionPreview(lastReportAction));
lastMessageTextFromReport = ReportUtils.getReportPreviewMessage(iouReport, lastReportAction);
} else if (ReportActionUtils.isModifiedExpenseAction(lastReportAction)) {
lastMessageTextFromReport = ReportUtils.getModifiedExpenseMessage(lastReportAction);
} else if (ReportActionUtils.isPendingRemove(lastNonWhisper)) {
const latestVisibleAction =
_.find(
allSortedReportActions[report.reportID],
(action) => ReportActionUtils.shouldReportActionBeVisibleAsLastAction(action) && !ReportActionUtils.isCreatedAction(action),
) || {};
lastMessageTextFromReport = lodashGet(latestVisibleAction, 'message[0].text', '');
} else if (ReportUtils.isChatRoom(report) || ReportUtils.isThread(report) || ReportUtils.isPolicyExpenseChat(report) || ReportUtils.isTaskReport(report)) {
if (lodashGet(lastReportAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.RENAMED) {
const newName = lodashGet(lastReportAction, 'originalMessage.newName', '');
lastMessageTextFromReport = Localize.translate(preferredLocale, 'newRoomPage.roomRenamedTo', {newName});
} else if (lodashGet(lastReportAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.TASKREOPENED) {
lastMessageTextFromReport = `${Localize.translate(preferredLocale, 'task.messages.reopened')}: ${report.reportName}`;
} else if (lodashGet(lastReportAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED) {
lastMessageTextFromReport = `${Localize.translate(preferredLocale, 'task.messages.completed')}: ${report.reportName}`;
} else if (lodashGet(lastReportAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.TASKCANCELLED) {
lastMessageTextFromReport = `${Localize.translate(preferredLocale, 'task.messages.canceled')}: ${report.reportName}`;
} else {
lastMessageTextFromReport = lastMessageTextFromReport.length > 0 ? lastMessageTextFromReport : Localize.translate(preferredLocale, 'report.noActivityYet');
}
}
return lastMessageTextFromReport;
} This might look like a lot of changes, so here is a summary of them:
This function now looks much cleaner than before and all the translation logic is also now at once place. Now, in if (!lastMessageText) {
// Here we get the beginning of chat history message and append the display name for each user, adding pronouns if there are any.
// We also add a fullstop after the final name, the word "and" before the final name and commas between all previous names.
lastMessageText =
Localize.translate(preferredLocale, 'reportActionsView.beginningOfChatHistory') +
_.map(displayNamesWithTooltips, ({displayName, pronouns}, index) => {
const formattedText = _.isEmpty(pronouns) ? displayName : `${displayName} (${pronouns})`;
if (index === displayNamesWithTooltips.length - 1) {
return `${formattedText}.`;
}
if (index === displayNamesWithTooltips.length - 2) {
return `${formattedText} ${Localize.translate(preferredLocale, 'common.and')}`;
}
if (index < displayNamesWithTooltips.length - 2) {
return `${formattedText},`;
}
}).join(' ');
}
result.alternateText = lastMessageText || formattedLogin; This code makes sure that we have |
Triggered auto assignment to @mallenexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
@mallenexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@mallenexpensify 6 days overdue. This is scarier than being forced to listen to Vogon poetry! |
From what I can see in my tests, if the task was originally created in English, we leave it that way and don't update it.
cc @tewodrosGirmaA who reported the issue ![]() |
If report action is reopened task message, the actionName is TASKREOPENED As I see that if the last message is TASKREOPENED, TASKCOMPLETED we will translate it in LHN (It seems that we missed TASKCANCELLED) because we can realize it by actionName of last report action. And we don't translate if the last message is "Assigned a task ..." because there is no way to know if it is a created task message. If we want to translate "Assigned a task ..." we need to introduce new actionName for created task message with the change from BE |
Job added to Upwork: https://www.upwork.com/jobs/~016eac5381208cd4cb |
Triggered auto assignment to @slafortune ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws ( |
Thanks @DylanDylann . @Ollyws , can you please review @DylanDylann 's comment above #25633 (comment) Then, if you agree, can you please review their proposal above? Thx @slafortune I'm off this week, can you please keep 👀 on this then I'll snag it back on Monday? Thx |
@Ollyws @slafortune @mallenexpensify 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! |
It looks like we need some backend work done if this is something we will move forward with -
Adding engineering |
Triggered auto assignment to @AndrewGable ( |
Removing myself since @mallenexpensify will be back next week and I'm out on sabbatical. |
@AndrewGable @Ollyws @mallenexpensify this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:
Thanks! |
Current assignee @Ollyws is eligible for the Internal assigner, not assigning anyone new. |
@marcochavezf or @thienlnam - I'd be curious for your thoughts on how we should best handle this and if any of the existing solutions make sense. I think the current discussion on whether we should do this translation on the front end or back end has probably been discussed previously and you might have some examples that will help us come to the correct decision in this case. Thank you! |
For more information, currently from the FE side, we only support translating 3 cases: From FE, We don't support translating:
|
There have been a few issues related to translation issues - we've largely decided to close them until we support localization in the backend as these are messages stored in the reportAction message itself |
@thienlnam Currently, we are supporting translating 3 cases: in reportAction message, LHN. So I think we also should support translating these cases in share somewhere section for consistency.
It means all task message will be translated from BE? and we will remove all translation for task message in FE, right? |
Sounds like yes we should close this and when we move the translation to the backend we will remove the front end translation. @thienlnam - Should we be linking this case to a larger tracking issue? |
BE localization is a pretty far out project - I imagine when we start to support that we'll go through and address all existing cases we have now. I don't think there is a tracking issue though |
I don't think this consistency is acceptable in the long time. It might confuse for user when with the same system message some places translate, some don't translate |
@thienlnam I would ask you to once go through my proposal before deciding because in it, I have proposed to move the translation logic to App/src/libs/OptionsListUtils.js Lines 392 to 395 in 2e8e699
|
@AndrewGable, @Ollyws, @mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick! |
I'm unsure what the next best step is here. Should we put this on hold pending backend localization? (then link to the tracking issue once it's created?) |
Sounds like @thienlnam is saying we should not do a work around and should handle this via the API/back end. There is a question of when this will happen, but we don't know for now. So I'd close this and we can circle back on this via the API at a later date. |
Thanks @AndrewGable !! |
@mallenexpensify am I eligible for payment ? |
@tewodrosGirmaA from CONTRIBUTING.md
Since we didn't fix anything here yet, compensation is not due. |
@mallenexpensify OK Thank you for Replying, No problem , I understand 😊 |
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:
Expected Result:
The task completion and reopening notification should be translated in the Share Somewhere section as per user preference, just like in LHN and Assigned Task
Actual Result:
The task completion and reopening notification are not translated in the Share Somewhere section, causing inconsistency in language usage
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.56-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
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
screen-capture.-.2023-08-11T101123.220.mp4
Recording.2945.mp4
Expensify/Expensify Issue URL:
Issue reported by: @tewodrosGirmaA
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1691775469383549
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: