Repository navigation
Description
Design doc section: #62805
One thing we do in some locations in our existing translations is split phrases up into multiple keys (for example addPaymentCardReadAndAcceptTextPart1 and addPaymentCardReadAndAcceptTextPart2). Typically this is done because there’s different formatting used for different parts of the string - maybe one part is bold and another is not, or there’s a link between two parts, etc…
We’ll reclassify this as a bad practice, because ChatGPT will be able to perform better translations if it has context for the full phrase. Furthermore, some languages may have different sentence structure, resulting in the string needing to be divided up differently (this hasn’t happened yet with English and Spanish as far as I know, but some other languages are more different in their sentence structure than those two).
So we’ll clean all these up, and instead of manually splitting up these strings, we’ll just use HTML to style them richly (i.e: using
<strong>for bold,<em>for italic, etc…) and then render that rich text with react-native-render-html (just like every chat message in NewDot).We can use react-native-render-html to render whatever we want amidst text components. In the case of italic
<strong>or links<a>, we already have renderers set up and ready to go. If we want to render complex/custom components, we already have a mechanism for that too - we can create a custom HTML-like tag and define a renderer for it. Some examples of us doing that can be found here.
Problem
When a phrase is split up into multiple chunks in English, and each of those chunks are translated separately, we get lower-quality translations than if the whole phrase is translated together.
Solution
- Identify all uses of "split phrase" translations in
src/languages/en.ts, refactor those usages to usereact-native-render-htmlinstead - Document that splitting phrases in translations is a bad practice, with good and bad examples
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021927053003546041104
- Upwork Job ID: 1927053003546041104
- Last Price Increase: 2025-05-26
- Automatic offers:
- allgandalf | Reviewer | 107456556
- PiyushChandra17 | Contributor | 107456557
Activity
[-]Stop splitting up phrases for formatting[/-][+][$250] Stop splitting up phrases for formatting[/+]melvin-bot commentedon May 26, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021927053003546041104
melvin-bot commentedon May 26, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @allgandalf (
External)melvin-bot commentedon May 26, 2025
Triggered auto assignment to @miljakljajic (
NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.melvin-bot commentedon May 26, 2025
391 remaining items
roryabraham commentedon Oct 28, 2025
The sub-issues are moving
roryabraham commentedon Nov 7, 2025
Only the following sub-issues need their PR created and/or merged. Others are either complete or awaiting deploy and/or payment:
roryabraham commentedon Nov 15, 2025
Only these remain:
roryabraham commentedon Dec 4, 2025
Just submitted a review for #75129
roryabraham commentedon Dec 9, 2025
Just merged one of the last PRs here. I think there may only be one left now
roryabraham commentedon Dec 19, 2025
This is done
ikevin127 commentedon Nov 27, 2026
Small regression from #68260 here. When the upgrade success message moved into a single HTML string, the workspace name went in unencoded, so HTML in the name rendered on the upgrade confirmation page. It's fixed now, and payment for the fix is tracked in #107982.