Added pluralization system for lang translations#45892
Added pluralization system for lang translations#45892iwiznia merged 32 commits intoExpensify:mainfrom
Conversation
|
@jayeshmangwani You can start testing this PR. |
Sure, will start testing in an hour |
Co-authored-by: Jayesh Mangwani <35371050+jayeshmangwani@users.noreply.github.com>
|
@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.
Why are we setting the count default to 0 if there is a first element?
There was a problem hiding this comment.
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.
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.
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 |
blazejkustra
left a comment
There was a problem hiding this comment.
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 ! |
iwiznia
left a comment
There was a problem hiding this comment.
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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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
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