-
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
[$500] Add system for pluralizing strings to our internationalization/localization library #38614
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01e4da0f48a9da5a41 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jayeshmangwani ( |
Triggered auto assignment to @MitchExpensify ( |
|
Is this open for external contributors? I would like to work on it. |
Yes, it is |
ProposalPlease re-state the problem that we are trying to solve in this issue.Add system for pluralizing strings to our internationalization/localization library. What is the root cause of that problem?New feature What changes do you think we should make in order to solve the problem?Example code to achieve this: (This would be added in the existing
Note: We need to discuss the way to add count in phraseParameters. We can either convert phraseParameters into an object and have different keys for count and the values, or we can keep it as an array and ensure that the first item should be the count.
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Add system for pluralizing strings to our internationalization/localization library What is the root cause of that problem?New Feature Here : App/src/components/LocaleContextProvider.tsx Lines 81 to 86 in 0d700c3
we need to refactor the translate method to add support for Pluralisation
What changes do you think we should make in order to solve the problem?As discussed above, we need to add do all these things to
What alternative solutions did you explore? (Optional)N/A Fyi If needed I can implement and add test branch as well. |
@ShridharGoel I think we can use Also you are not doing this correctly:
|
hey @iwiznia ! Do you need sample code ? Just asking hope you don't mind asking me this. |
It always helps.
I think this is not correct? The code for translating is in
If no count is passed, it should treat it as such, not default to 1 |
ProposalUpdated with code optimisation and example usage. |
@iwiznia I actually made an update just now, can you have a look? |
Did you see this?
Also: I think these are wrong:
Because if the translation has other parameters, they will not be replaced. Plus, a translation entry can be a function too. |
@iwiznia Yes, it makes more sense to add in Can we also change
Else, we can keep it as an array and make count to be the first element always. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Add system for pluralizing strings to our internationalization/localization library to support languages with more than two pluralization forms. What is the root cause of that problem?New Feature What changes do you think we should make in order to solve the problem?I propose the following changes to the Handling of translated phrases and
|
Proposal |
📣 @shubham1206agra 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Progress update: I am in the process of merging all parameters into one. This is taking some time as there are many keys to check. I will open a PR on Monday. |
Sounds good |
I have asked @jayeshmangwani to review this first. |
Waiting on @jayeshmangwani to final review the PR. |
📣 @ZhenjaHorbach 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Swapped C+ assignment per this discussion. |
This issue has not been updated in over 15 days. @iwiznia, @twisterdotcom, @shubham1206agra, @ZhenjaHorbach eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
How many people need paying for this big one? I see @jayeshmangwani and @shubham1206agra were involved as C+? |
@shubham1206agra and @ZhenjaHorbach needed to be paid here. |
Oh, yeah @shubham1206agra is Contributor here I will add BugZero Checklist today or tomorrow ! |
@twisterdotcom I want to ask for pay increase here as the work here was more than the initially anticipated. |
Nice, thanks for asking. Just discussing internally, but I see no reason not to increase it - just figuring out what to: https://expensify.slack.com/archives/C01SKUP7QR0/p1728559862581289 |
Okay, gonna add another $250 here folks. |
Payment Summary:
|
@twisterdotcom Accepted offer |
Problem
I've been seeing more and more copy that has singular and plural versions and what we are doing is adding 2 different translations for it, which is less than ideal for a localized app, as some languages have more than 2 forms (plural and singular) and this means we won't be able to support those languages without a major effort
Solution
Add feature to support pluralization in our localization system. How it will work is:
This way, we have a standard way of pluralizing phrases that works for all languages and avoid having to refactor all this when we decide we want to support localization for real.
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @twisterdotcomThe text was updated successfully, but these errors were encountered: