Skip to content

LHN - [Comment Deleted] text translated in Spanish after refresh the page #7764

Closed

Description

@kbecciv

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 App as login user
  2. Change English to Spanish
  3. Go back to LHN and verify that [Comment Deleted] alternate text should be translated.

Expected Result:

[Comment Deleted] alternate text should be translated in LHN

Actual Result:

[Comment Deleted] text translated in Spanish after refresh the page

Workaround:

Unknown

Platform:

Where is this issue occurring?

  • Web
  • iOS - [Comment Deleted] text translated in Spanish after closed and reopen the app
  • Android - [Comment Deleted] text translated in Spanish after closed and reopen the app
  • Desktop App
  • Mobile Web

Version Number: 1.1.39-1

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

Notes/Photos/Videos: Any additional supporting documentation

Bug5455148_1502.mp4
Recording.218.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause

Slack conversation:

Issue was found when executing: #7552

View all open jobs on GitHub

Activity

  1. MelvinBot commented on Feb 15, 2022

    @MelvinBot
    Contributor

    Triggered auto assignment to @Julesssss (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

  2. changed the title [-]LHN - [Delete Attachment] text translated in Spanish after refresh the page[/-] [+]LHN - [Comment Deleted] text translated in Spanish after refresh the page[/+] on Feb 15, 2022
  3. parasharrajat commented on Feb 16, 2022

    @parasharrajat
    Member
  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Feb 16, 2022
  5. MelvinBot commented on Feb 16, 2022

    @MelvinBot
    Contributor

    Triggered auto assignment to @SofiedeVreese (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

  6. sobitneupane commented on Feb 16, 2022

    @sobitneupane
    Contributor

    Proposal:
    Return isLastMessageDeleted from getSimplifiedReportObject() in src/libs/actions/Report.js

    let lastMessageText = null;
    if (report.reportActionCount > 0) {
    // We are removing any html tags from the message html since we cannot access the text version of any comments as
    // the report only has the raw reportActionList and not the processed version returned by Report_GetHistory
    // We convert the line-breaks in html to space ' ' before striping the tags
    lastMessageText = lastActionMessage
    .replace(/((<br[^>]*>)+)/gi, ' ')
    .replace(/(<([^>]+)>)/gi, '') || `[${Localize.translateLocal('common.deletedCommentMessage')}]`;
    lastMessageText = ReportUtils.formatReportLastMessageText(lastMessageText);
    }

    +    let isLastMessageDeleted = false;
        let lastMessageText = null;
        if (report.reportActionCount > 0) {
            // We are removing any html tags from the message html since we cannot access the text version of any comments as
            // the report only has the raw reportActionList and not the processed version returned by Report_GetHistory
            // We convert the line-breaks in html to space ' ' before striping the tags
            lastMessageText = lastActionMessage
                .replace(/((<br[^>]*>)+)/gi, ' ')
                .replace(/(<([^>]+)>)/gi, '') || `[${Localize.translateLocal('common.deletedCommentMessage')}]`;
            lastMessageText = ReportUtils.formatReportLastMessageText(lastMessageText);
    +        isLastMessageDeleted = !lastActionMessage && true
        }

    and use it in src/libs/OptionsListUtils.js in the following way:

    const lastMessageTextFromReport = ReportUtils.isReportMessageAttachment(lodashGet(report, 'lastMessageText', ''))
    ? `[${Localize.translateLocal('common.attachment')}]`
    : Str.htmlDecode(lodashGet(report, 'lastMessageText', ''));

     let lastMessageTextFromReport = ReportUtils.isReportMessageAttachment(lodashGet(report, 'lastMessageText', ''))
            ? `[${Localize.translateLocal('common.attachment')}]`
            : Str.htmlDecode(lodashGet(report, 'lastMessageText', ''));
    +    lastMessageTextFromReport = lodashGet(report, 'isLastMessageDeleted', false) 
    +        ? `[${Localize.translateLocal('common.deletedCommentMessage')}]`
    +        : lastMessageTextFromReport;  
  7. thesahindia commented on Feb 16, 2022

    @thesahindia
    Member

    Aren't we removing [comment deleted] in #7646 ?
    cc: @parasharrajat @Julesssss

  8. Julesssss commented on Feb 16, 2022

    @Julesssss
    Contributor

    Yes, good spot.

    It's not certain that we'll prioritize that improvement internally though. I think we should just make this fix anyway for now.

  9. parasharrajat commented on Feb 16, 2022

    @parasharrajat
    Member

    Oh. Sorry, I thought it is a regression so I tagged Sobit.

  10. SofiedeVreese commented on Feb 16, 2022

    @SofiedeVreese
    Contributor

    To reconfirm, this is not a regression and should be pushed externally?

  11. Julesssss commented on Feb 17, 2022

    @Julesssss
    Contributor

    this is not a regression and should be pushed externally?
    It could be, but I haven't been able to confirm.

    Regardless it can be made external

  12. SofiedeVreese commented on Feb 18, 2022

    @SofiedeVreese
    Contributor
  13. MelvinBot commented on Feb 18, 2022

    @MelvinBot
    Contributor

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

  14. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 18, 2022
  15. MelvinBot commented on Feb 18, 2022

    @MelvinBot
    Contributor

    Current assignee @Julesssss is eligible for the Exported assigner, not assigning anyone new.

  16. rushatgabhane commented on Feb 21, 2022

    @rushatgabhane
    Member

    @Julesssss there's already a PR out which makes this issue redundant, and it's like 99% done.

    I suggest that we wait for #7711 to merge.

  17. Julesssss commented on Feb 21, 2022

    @Julesssss
    Contributor

    I did see that but it didn't seem too close to completion previously. But yeah, as this still hasn't been assigned lets close it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions