You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contributingGuides/philosophies/INTERNATIONALIZATION.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,14 +29,14 @@ All translations are stored in language files in [src/languages](https://github.
29
29
### - Common phrases SHOULD be shared when used in multiple places
30
30
A common rule of thumb is to move a common word/phrase to be shared when it's used in 3 or more places.
31
31
32
-
### - Complex translation strings MUST use arrow function format
33
-
Always prefer longer and more complex strings in the translation files. For example, if you need to generate the text `User has sent $20.00 to you on Oct 25th at 10:05am`, add just one key to the translation file and use the arrow function version:
32
+
### - Complex translation strings MUST NOT be split up for formatting or value injection
33
+
Always prefer to use arrow functions and/or HTML to produce rich text in translation files. For example, if you need to generate the text `User has sent $20.00 to you on Oct 25th at 10:05am`, add just one key to the translation file and use the arrow function version:
34
34
35
35
```javascript
36
-
nameOfTheKey: ({amount, dateTime}) =>`User has sent ${amount} to you on ${datetime}`,
36
+
nameOfTheKey: ({amount, dateTime}) =>`User has sent <strong>${amount}</strong> to you on <a>${datetime}</a>`,
37
37
```
38
38
39
-
This is because the order of phrases might vary from one language to another.
39
+
This is because the order of phrases might vary from one language to another, and LLMs will be able to produce better translations will the full context of the phrase. If rich formatting is needed, use HTML in the string and render it with react-native-render-html.
40
40
41
41
### - Plural forms MUST be handled correctly using plural translation objects
42
42
When working with translations that involve plural forms, it's important to handle different cases correctly:
0 commit comments