-
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
Fix: Translation for system message #21780
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@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 🚀
|
@@ -249,6 +249,7 @@ function addActions(reportID, text = '', file) { | |||
|
|||
const optimisticReport = { | |||
lastVisibleActionCreated: currentTime, | |||
lastMessageTranslationKey: lodashGet(lastAction, 'message[0].translationKey', ''), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like that push event should also update this field to update let LHN message after sending an attachment, like this case #22937
@@ -249,6 +249,7 @@ function addActions(reportID, text = '', file) { | |||
|
|||
const optimisticReport = { | |||
lastVisibleActionCreated: currentTime, | |||
lastMessageTranslationKey: lodashGet(lastAction, 'message[0].translationKey', ''), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
* @returns {Boolean} | ||
*/ | ||
export default function isReportMessageAttachment({text, html}) { | ||
export default function isReportMessageAttachment({text, html, translationKey}) { | ||
if (translationKey) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @eVoloshchak
Details
System messages are currently hard-coded strings. This PR added
translationKey
for 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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