Fix: Translation for system message#21780
Conversation
|
@eVoloshchak Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@eVoloshchak I added new logic for |
|
@yuwenmemon As mentioned above, since all the old report actions haven't had
|
|
@tienifr I think we can proceed without worrying about the old messages if that makes things simpler. This only effects the most recent message shown in the LHN anyway, so I don't see a need to fix the old messages for that reason either. |
|
Okay so we'll keep both the old and new logic, right? |
|
Ah, okay then I guess so, but then why would you need this?
|
|
Take
Thus I think if we want to completely migrate to the
This is not true since |
|
Just providing some information on the subtitle translation issues discussion we had previously for LHN since I saw this PR which was mentioned in another issue. @yuwenmemon @eVoloshchak The last callout was to avoid complicated solutions incase of LHN translations and leave out small bugs if only way forward is a complex solution. Even attachments was mentioned there and the current path seems to have backend changes and complex solutions. Lines 342 to 358 in 5997357 But anyways just providing my 2 cents from the last discussion I had and leaving it up for you guys to decide. |
|
The proposal |
|
@abdulrahuman5196, thanks for attaching the discussion!
It is a rare bug that can be reproduced only when switching languages, I agree this isn't a top priority. I think the implementation in this PR is correct, so in case we decide to implement this later - we should use it. |
|
@eVoloshchak Any update? |
eVoloshchak
left a comment
There was a problem hiding this comment.
@tienifr, the translation in LHN works well now.
I think we should translate "Uploading attachment" message too
Screen.Recording.2023-07-06.at.17.39.28.mov
|
We are going to remove the |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-07-10.at.14.02.38.movMobile Web - Chromescreen-20230710-140726.mp4Mobile Web - SafariScreen.Recording.2023-07-10.at.15.10.04.movDesktopScreen.Recording.2023-07-10.at.14.14.37.moviOSScreen.Recording.2023-07-10.at.15.08.13.movAndroidscreen-20230710-140856.mp4 |
Ah, you're correct, we indeed have an issue for that Looks good to me, there are only two steps left
|
|
@eVoloshchak |
|
@eVoloshchak All were updated. Thanks for your patience. |
|
@tienifr, could you please take a look at the failing PR Author check? |
|
@eVoloshchak Thanks, I've updated that. |
|
🚀 Deployed to staging by https://github.com/yuwenmemon in version: 1.3.40-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.40-5 🚀
|
|
|
||
| const optimisticReport = { | ||
| lastVisibleActionCreated: currentTime, | ||
| lastMessageTranslationKey: lodashGet(lastAction, 'message[0].translationKey', ''), |
There was a problem hiding this comment.
It looks like that push event should also update this field to update let LHN message after sending an attachment, like this case #22937
|
|
||
| const optimisticReport = { | ||
| lastVisibleActionCreated: currentTime, | ||
| lastMessageTranslationKey: lodashGet(lastAction, 'message[0].translationKey', ''), |
There was a problem hiding this comment.
Hi all, this PR caused a regression Red dot and [Attachment] shows in LHN even after close error message
This is because we didn't set failure data for lastMessageTranslationKey
| */ | ||
| export default function isReportMessageAttachment({text, html}) { | ||
| export default function isReportMessageAttachment({text, html, translationKey}) { | ||
| if (translationKey) { |
There was a problem hiding this comment.
👋 This was partially responsible for a regression in #24246
It was mainly a back-end problem, the translation key is not set/reset when we change from a message with a translation key to one without, or vice-versa
While this wasn't caused by this PR, leaving a note to myself and others to test more complex test cases (this one included testing with two accounts)
Details
System messages are currently hard-coded strings. This PR added
translationKeyfor them.Fixed Issues
$ #19449
PROPOSAL: #19449 (comment)
Tests
[Archivo adjunto]shows on LHNOffline tests
NA
QA Steps
[Archivo adjunto]shows on LHNPR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
Screencast.from.28-06-2023.16.53.59.webm
Mobile Web - Chrome
video_2023-07-07_23-58-03.mp4
Mobile Web - Safari
original-0E4EA68E-32B7-45EC-AAE8-8FB8B355AF1A.mp4
Desktop
Screen.Recording.2023-07-09.at.15.27.43.mov
iOS
Screen.Recording.2023-07-09.at.15.36.58.mov
Android
Screencast.from.07-07-2023.23.46.56.webm