Skip to content

Commit b6b0ea5

Browse files
authored
Merge pull request #202 from mondeja/fix-193
2 parents 177e2cc + 9c50eb2 commit b6b0ea5

24 files changed

Lines changed: 1470 additions & 916 deletions

File tree

scripts/update-translations.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
set -e
22

33
# extract new phrases
4-
/usr/local/opt/gettext/bin/xgettext --from-code=UTF-8 -o humanize.pot -k'_' -k'N_' -k'P_:1c,2' -l python src/humanize/*.py
4+
/usr/local/opt/gettext/bin/xgettext --from-code=UTF-8 -o humanize.pot -k'_' -k'N_' -k'P_:1c,2' -k'NS_:1,2' -l python src/humanize/*.py
55

66
for d in src/humanize/locale/*/; do
77
locale="$(basename $d)"

src/humanize/i18n.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,26 @@ def num_name(n):
137137
return message
138138

139139

140+
def ngettext_noop(singular, plural):
141+
"""Mark two strings as pluralized translations without translating them.
142+
143+
Example usage:
144+
```python
145+
CONSTANTS = [ngettext_noop('first', 'firsts'), ngettext_noop('second', 'seconds')]
146+
def num_name(n):
147+
return ngettext(*CONSTANTS[n])
148+
```
149+
150+
Args:
151+
singular (str): Singular text to translate in the future.
152+
plural (str): Plural text to translate in the future.
153+
154+
Returns:
155+
tuple: Original text, unchanged.
156+
"""
157+
return (singular, plural)
158+
159+
140160
def thousands_separator() -> str:
141161
"""Return the thousands separator for a locale, default to comma.
142162

src/humanize/locale/ca_ES/LC_MESSAGES/humanize.po

Lines changed: 69 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ msgid ""
66
msgstr ""
77
"Project-Id-Version: humanize\n"
88
"Report-Msgid-Bugs-To: \n"
9-
"POT-Creation-Date: 2021-04-30 17:01+0300\n"
9+
"POT-Creation-Date: 2021-04-30 22:34+0200\n"
1010
"PO-Revision-Date: 2021-04-09 19:57+0200\n"
1111
"Last-Translator: Jordi Mas i Hernàndez <jmas@softcatala.org>\n"
1212
"Language-Team: Catalan\n"
@@ -17,141 +17,165 @@ msgstr ""
1717
"Plural-Forms: nplurals=2; plural=n!=1;\n"
1818
"X-Generator: Poedit 2.4.1\n"
1919

20-
#: src/humanize/number.py:54
20+
#: src/humanize/number.py:56
2121
msgctxt "0"
2222
msgid "th"
2323
msgstr "º"
2424

25-
#: src/humanize/number.py:55
25+
#: src/humanize/number.py:57
2626
msgctxt "1"
2727
msgid "st"
2828
msgstr "º"
2929

30-
#: src/humanize/number.py:56
30+
#: src/humanize/number.py:58
3131
msgctxt "2"
3232
msgid "nd"
3333
msgstr "º"
3434

35-
#: src/humanize/number.py:57
35+
#: src/humanize/number.py:59
3636
msgctxt "3"
3737
msgid "rd"
3838
msgstr "º"
3939

40-
#: src/humanize/number.py:58
40+
#: src/humanize/number.py:60
4141
msgctxt "4"
4242
msgid "th"
4343
msgstr "º"
4444

45-
#: src/humanize/number.py:59
45+
#: src/humanize/number.py:61
4646
msgctxt "5"
4747
msgid "th"
4848
msgstr "º"
4949

50-
#: src/humanize/number.py:60
50+
#: src/humanize/number.py:62
5151
msgctxt "6"
5252
msgid "th"
5353
msgstr "º"
5454

55-
#: src/humanize/number.py:61
55+
#: src/humanize/number.py:63
5656
msgctxt "7"
5757
msgid "th"
5858
msgstr "º"
5959

60-
#: src/humanize/number.py:62
60+
#: src/humanize/number.py:64
6161
msgctxt "8"
6262
msgid "th"
6363
msgstr "º"
6464

65-
#: src/humanize/number.py:63
65+
#: src/humanize/number.py:65
6666
msgctxt "9"
6767
msgid "th"
6868
msgstr "º"
6969

70-
#: src/humanize/number.py:124
70+
#: src/humanize/number.py:126
7171
msgid "thousand"
72-
msgstr ""
72+
msgid_plural "thousand"
73+
msgstr[0] ""
74+
msgstr[1] ""
7375

74-
#: src/humanize/number.py:125
76+
#: src/humanize/number.py:127
7577
msgid "million"
76-
msgstr "milió"
78+
msgid_plural "million"
79+
msgstr[0] "milió"
80+
msgstr[1] "milió"
7781

78-
#: src/humanize/number.py:126
82+
#: src/humanize/number.py:128
7983
msgid "billion"
80-
msgstr "mil milions"
84+
msgid_plural "billion"
85+
msgstr[0] "mil milions"
86+
msgstr[1] "mil milions"
8187

82-
#: src/humanize/number.py:127
88+
#: src/humanize/number.py:129
8389
msgid "trillion"
84-
msgstr "bilions"
90+
msgid_plural "trillion"
91+
msgstr[0] "bilions"
92+
msgstr[1] "bilions"
8593

86-
#: src/humanize/number.py:128
94+
#: src/humanize/number.py:130
8795
msgid "quadrillion"
88-
msgstr "quadrilió"
96+
msgid_plural "quadrillion"
97+
msgstr[0] "quadrilió"
98+
msgstr[1] "quadrilió"
8999

90-
#: src/humanize/number.py:129
100+
#: src/humanize/number.py:131
91101
msgid "quintillion"
92-
msgstr "quintillió"
102+
msgid_plural "quintillion"
103+
msgstr[0] "quintillió"
104+
msgstr[1] "quintillió"
93105

94-
#: src/humanize/number.py:130
106+
#: src/humanize/number.py:132
95107
msgid "sextillion"
96-
msgstr "sextilió"
108+
msgid_plural "sextillion"
109+
msgstr[0] "sextilió"
110+
msgstr[1] "sextilió"
97111

98-
#: src/humanize/number.py:131
112+
#: src/humanize/number.py:133
99113
msgid "septillion"
100-
msgstr "septilió"
114+
msgid_plural "septillion"
115+
msgstr[0] "septilió"
116+
msgstr[1] "septilió"
101117

102-
#: src/humanize/number.py:132
118+
#: src/humanize/number.py:134
103119
msgid "octillion"
104-
msgstr "octilió"
120+
msgid_plural "octillion"
121+
msgstr[0] "octilió"
122+
msgstr[1] "octilió"
105123

106-
#: src/humanize/number.py:133
124+
#: src/humanize/number.py:135
107125
msgid "nonillion"
108-
msgstr "nonilió"
126+
msgid_plural "nonillion"
127+
msgstr[0] "nonilió"
128+
msgstr[1] "nonilió"
109129

110-
#: src/humanize/number.py:134
130+
#: src/humanize/number.py:136
111131
msgid "decillion"
112-
msgstr "decilió"
132+
msgid_plural "decillion"
133+
msgstr[0] "decilió"
134+
msgstr[1] "decilió"
113135

114-
#: src/humanize/number.py:135
136+
#: src/humanize/number.py:137
115137
msgid "googol"
116-
msgstr "googol"
138+
msgid_plural "googol"
139+
msgstr[0] "googol"
140+
msgstr[1] "googol"
117141

118-
#: src/humanize/number.py:224
142+
#: src/humanize/number.py:228
119143
msgid "zero"
120144
msgstr "zero"
121145

122-
#: src/humanize/number.py:225
146+
#: src/humanize/number.py:229
123147
msgid "one"
124148
msgstr "un"
125149

126-
#: src/humanize/number.py:226
150+
#: src/humanize/number.py:230
127151
msgid "two"
128152
msgstr "dos"
129153

130-
#: src/humanize/number.py:227
154+
#: src/humanize/number.py:231
131155
msgid "three"
132156
msgstr "tres"
133157

134-
#: src/humanize/number.py:228
158+
#: src/humanize/number.py:232
135159
msgid "four"
136160
msgstr "quatre"
137161

138-
#: src/humanize/number.py:229
162+
#: src/humanize/number.py:233
139163
msgid "five"
140164
msgstr "cinc"
141165

142-
#: src/humanize/number.py:230
166+
#: src/humanize/number.py:234
143167
msgid "six"
144168
msgstr "sis"
145169

146-
#: src/humanize/number.py:231
170+
#: src/humanize/number.py:235
147171
msgid "seven"
148172
msgstr "set"
149173

150-
#: src/humanize/number.py:232
174+
#: src/humanize/number.py:236
151175
msgid "eight"
152176
msgstr "vuit"
153177

154-
#: src/humanize/number.py:233
178+
#: src/humanize/number.py:237
155179
msgid "nine"
156180
msgstr "nou"
157181

0 commit comments

Comments
 (0)