-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Added pluralization system for lang translations #45892
Added pluralization system for lang translations #45892
Conversation
@jayeshmangwani You can start testing this PR. |
Sure, will start testing in an hour |
Co-authored-by: Jayesh Mangwani <[email protected]>
@jayeshmangwani Can you test this PR once? |
@shubham1206agra Yes, I have tested it and suggested a few changes above. When running the app, I haven't faced any issues yet. |
@shubham1206agra If you feel that the PR is ready for verifying the TypeScript changes, then we can tag the TS expert to verify the type changes. |
src/libs/Localize/index.ts
Outdated
if (typeof calledTranslatedPhrase === 'string') { | ||
return calledTranslatedPhrase; | ||
} | ||
const count = phraseParameters[1] ?? 0; |
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.
Why are we setting the count default to 0 if there is a first element?
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.
Nope, this is different logic. This logic gives a fallback value to count. This is to make TS happy only.
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.
Why are we setting the count default to 0 if there is a first element?
This will not be a case always.
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.
What I am trying to say is that we should not add the fallback to 0. If there is no count, then we can return the translatedPhrase, right?
@shubham1206agra The PR is working fine for me; I haven't found any issues. I think we can proceed with opening this PR for the type changes. WDYT ? |
src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx
Outdated
Show resolved
Hide resolved
@shubham1206agra Would you complete the checklist here? |
@blazejkustra Tagging you here for verifying 👀 the TypeScript changes on the PR |
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.
Couple comments, looking really solid from TS perspective!
@ZhenjaHorbach This is ready for review again. |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromeandroid-web.moviOS: Nativeios.moviOS: mWeb Safariios-web.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
LGTM ! |
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.
Going to approve since I posted this to see if we enable the eslint rule for it: https://expensify.slack.com/archives/C01GTK53T8Q/p1727441233067399
@jayeshmangwani can you re-review and tag me to merge once you are done, please? |
Technically I'm a reviewer here ! https://expensify.slack.com/archives/C02NK2DQWUX/p1724766480541149 So we can move on |
Ah got it! |
@iwiznia looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
Same as in #45892 this PR touches a lot of unrelated files and we don't want to fix existing eslint problems as part of it. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/iwiznia in version: 9.0.41-0 🚀
|
@jayeshmangwani @blazejkustra Could you help us with 1st 3 steps where do we see the following?
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.0.41-10 🚀
|
@kavimuru Sorry, I forgot to remove this old test. |
Details
Fixed Issues
$ #38614
Tests
Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.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
Android: Native
Screen.Recording.2024-08-05.at.10.42.37.PM.mov
Android: mWeb Chrome
Screen.Recording.2024-08-05.at.9.38.05.PM.mov
iOS: Native
Screen.Recording.2024-08-05.at.10.21.26.PM.mov
iOS: mWeb Safari
Screen.Recording.2024-08-05.at.9.33.41.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2024-08-05.at.9.29.21.PM.mov
MacOS: Desktop
Screen.Recording.2024-08-05.at.9.41.20.PM.mov