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

Translate alternate text to Spanish #7552

Merged

Conversation

sobitneupane
Copy link
Contributor

@sobitneupane sobitneupane commented Feb 3, 2022

Details

[Attachment] alternate text in LHN is not translated to Spanish

Fixed Issues

$ #7440

Tests

  • Send attachment
  • Change language to Spanish and check at LHN. [Attachment] alternate text should be translated.

QA Steps

  • Send attachment
  • Change language to Spanish and check at LHN. [Attachment] alternate text should be translated.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

attachment-translation.mp4

Mobile Web

Screenshot_20220203-212457_Chrome
Screenshot_20220203-212428_Chrome

Desktop

Screen Shot 2022-02-09 at 21 34 22

Screen Shot 2022-02-09 at 21 34 35

iOS

Simulator Screen Shot - iPhone 13 - 2022-02-09 at 21 37 45
Simulator Screen Shot - iPhone 13 - 2022-02-09 at 21 37 27

Android

Screenshot_20220203-200522_New Expensify
Screenshot_20220203-200602_New Expensify

@sobitneupane sobitneupane requested a review from a team as a code owner February 3, 2022 17:09
@MelvinBot MelvinBot requested review from parasharrajat and roryabraham and removed request for a team February 3, 2022 17:09
src/libs/actions/Report.js Outdated Show resolved Hide resolved
Comment on lines 231 to 234
? (hasMultipleParticipants && lastActorDetails
? `${lastActorDetails.displayName}: `
: '')
+ Str.htmlDecode(report.lastMessageText)
+ (isLastMessageAttachment ? `[${Localize.translateLocal('common.attachment')}]` : Str.htmlDecode(report.lastMessageText))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we please simplify this ternary? lets not nest it multi levels.

Copy link
Contributor Author

@sobitneupane sobitneupane Feb 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be okay. Any suggestion?

    const lastMessageTextFromReport = isLastMessageAttachment ? `[${Localize.translateLocal('common.attachment')}]` : Str.htmlDecode(report.lastMessageText);
    const lastMessageText = report
        ? (hasMultipleParticipants && lastActorDetails
            ? `${lastActorDetails.displayName}: `
            : '')
        + (lastMessageTextFromReport)
        : '';

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's break the concatenation into the next line.

const lastMessageTextFromReport = isLastMessageAttachment ? `[${Localize.translateLocal('common.attachment')}]` : Str.htmlDecode(report.lastMessageText);
 let lastMessageText = report && hasMultipleParticipants && lastActorDetails
            ? `${lastActorDetails.displayName}: `
            : '';
            
     lastMessageText  +=  report? lastMessageTextFromReport : '';

@@ -221,17 +221,17 @@ function createOption(personalDetailList, report, {
const personalDetail = personalDetailList[0];
const hasDraftComment = hasReportDraftComment(report);
const hasOutstandingIOU = lodashGet(report, 'hasOutstandingIOU', false);
const isLastMessageAttachment = report ? ReportUtils.isReportMessageAttachment(report.lastMessageText) : false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const isLastMessageAttachment = report ? ReportUtils.isReportMessageAttachment(report.lastMessageText) : false;

? `${lastActorDetails.displayName}: `
: '')
+ Str.htmlDecode(report.lastMessageText)
const lastMessageTextFromReport = report && (isLastMessageAttachment ? `[${Localize.translateLocal('common.attachment')}]` : Str.htmlDecode(report.lastMessageText));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

cc: @roryabraham
🎀 👀 🎀 C+ reviewed

@parasharrajat
Copy link
Member

@sobitneupane Please tick all the platforms on the template and attach screenshots for all.

@sobitneupane
Copy link
Contributor Author

@sobitneupane Please tick all the platforms on the template and attach screenshots for all.

okay

@roryabraham
Copy link
Contributor

@sobitneupane I have one small tip for you to keep in mind for the future. When adding screenshots in the pull request description, GitHub has a tendency to make the images way too big, especially when pasting a screenshot of a mobile device/simulator.

I find it very helpful to adjust those images to a more reasonable size by either:

  1. Using a hard-coded html img tag instead of GH's default markdown:

    - ![Screenshot_20220203-212457_Chrome](https://user-images.githubusercontent.com/25876548/152380678-4cff0b29-102e-4fac-9cac-9a5527e61e8b.jpg)
    + <img src="https://user-images.githubusercontent.com/25876548/152380678-4cff0b29-102e-4fac-9cac-9a5527e61e8b.jpg" alt="" width="350px" />
  2. Or (even better in this case) using a markdown table to store screenshots:

English Español
Screenshot_20220203-212428_Chrome Screenshot_20220203-212457_Chrome

This is helpful not only to reviewers, but also to our QA team. Thanks!

@roryabraham roryabraham merged commit bdf3a74 into Expensify:main Feb 10, 2022
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@sobitneupane
Copy link
Contributor Author

Thanks for the suggestion. Will definitely take care moving forward.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @roryabraham in version: 1.1.39-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @timszot in version: 1.1.39-3 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@Stutikuls
Copy link

Stutikuls commented Mar 4, 2022

Issue 1 -

Title- [Medium]: Voiceover +Safari: Screen reader : Screen reader is not reading the Role, State & Value for the 'Language' control.
Actual - When focus lands on the Language control then screen reader is only reading "Language" and focus lands on the label, value of the control individually and multiple times.
Expected - Role = Drop down, State = Collapsed/expanded, Value = English. Focus should land on the control only once and when focus lands on the control then screen reader should read like "Language English drop down button collapsed".
WCAG failure - 4.1.2
Reproducible in staging?: - Yes
Version Number: - v1.1.39-3
Platforms - iOS

7552_Screen.reader.is.not.reading.the.Role.State.Value.for.the.Language.control.MOV

Issue 2 -

Title- [Medium]:Chrome +Jaws: Screen reader : Screen reader is not reading the Label along with the value.
Actual - When focus lands on the Language control then screen reader is reading "English", not reading the name of the control along with the value.
Expected - Screen reader should read like "Language English drop down button collapsed".
WCAG failure - 1.3.1
Reproducible in staging?: - Yes
Version Number: - v1.1.39-3
Platforms - Web

7552_Label.is.not.associated.with.the.value.of.the.combo.box.mp4

Issue 3 -

Title- [Medium]: Chrome +Talkback: Screen reader : Focus stuck on the 'Language' control twice.
Actual - Focus lands on the language control twice. first time its reading "English edit box disable" and 2nd time screen reader is reading "Language".
Expected - Focus should stay on the control only once and screen reader should read like "Language English drop down button collapsed".
WCAG failure - 2.4.3
Reproducible in staging?: - Yes
Version Number: - v1.1.44-3
Platforms - Android

7552_Stuck.twice.mp4

Issue 4 -

Title- [Medium]: Talkback+ Chrome: Screen reader : Incorrect role and state is defined for the 'Language' control.
Actual - When focus lands on the Language control then screen reader is reading "English edit box disable" and 2nd time screen reader is reading "Language" and focus lands on the label, value of the control individually.
Expected - Role = Drop down, State = Collapsed/expanded, Value = English. Focus should land on the control only once and when focus lands on the control then screen reader should read like "Language English drop down button collapsed".
WCAG failure - 4.1.2
Reproducible in staging?: - Yes
Version Number: - v1.1.44-3
Platforms - Android

7552_Incorrect.state.mp4

Issue 5 -

Title- [Medium]: Talkback+ Chrome: Screen reader :'Language' control drop down is not accessible using screen reader.
Actual - When focus lands on the Language control then screen reader is reading "English edit box disable" and 2nd time screen reader is reading "Language" but control is not activate after press double Tap on it.
Expected - Language' control drop down should accessible using screen reader.
WCAG failure - 2.1.1
Reproducible in staging?: - Yes
Version Number: - v1.1.44-3
Platforms - Android

7552_2.1.1_.Language.control.drop.down.is.not.accessible.using.screen.reader.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants