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: doc/translation_strings_policy.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,44 @@ Avoid dividing up a message into fragments. Translators see every string separat
64
64
There have been difficulties with use of HTML in translation strings; translators should not be able to accidentally affect the formatting of messages.
65
65
This may sometimes be at conflict with the recommendation in the previous section.
66
66
67
+
### Plurals
68
+
69
+
Plurals can be complex in some languages. A quote from the gettext documentation:
70
+
71
+
In Polish we use e.g. plik (file) this way:
72
+
1 plik,
73
+
2,3,4 pliki,
74
+
5-21 pliko'w,
75
+
22-24 pliki,
76
+
25-31 pliko'w
77
+
and so on
78
+
79
+
In Qt code use tr's third argument for optional plurality. For example:
80
+
81
+
tr("%n hour(s)","",secs/HOUR_IN_SECONDS);
82
+
tr("%n day(s)","",secs/DAY_IN_SECONDS);
83
+
tr("%n week(s)","",secs/WEEK_IN_SECONDS);
84
+
85
+
This adds `<numerusform>`s to the respective `.ts` file, which can be translated separately depending on the language. In English, this is simply:
86
+
87
+
<message numerus="yes">
88
+
<source>%n active connection(s) to Bitcoin network</source>
89
+
<translation>
90
+
<numerusform>%n active connection to Bitcoin network</numerusform>
91
+
<numerusform>%n active connections to Bitcoin network</numerusform>
92
+
</translation>
93
+
</message>
94
+
95
+
Where it is possible try to avoid embedding numbers into the flow of the string at all. e.g.
96
+
97
+
WARNING: check your network connection, %d blocks received in the last %d hours (%d expected)
98
+
99
+
versus
100
+
101
+
WARNING: check your network connection, less blocks (%d) were received in the last %n hours than expected (%d).
102
+
103
+
The second example reduces the number of pluralized words that translators have to handle from three to one, at no cost to comprehensibility of the sentence.
104
+
67
105
### String freezes
68
106
69
107
During a string freeze (often before a major release), no translation strings are to be added, modified or removed.
0 commit comments