Skip to content

Commit 88fae8a

Browse files
committed
Fix localization for widgets
1 parent f970414 commit 88fae8a

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed
Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
def pl(n: int, forms: str) -> str: # pylint: disable=invalid-name
2-
"""
3-
Choose a singular/plural form for English - or create one, for regular nouns
1+
from orangecanvas.utils.localization import pl
42

5-
`forms` can be a string containing the singular and plural form, separated
6-
by "|", for instance `"dictionary|dictionaries".
7-
8-
IF `forms` does not contain character |, plural is formed by appending
9-
an 's'.
10-
11-
Args:
12-
n: number
13-
forms: plural forms, separated by "|", or a single (regular) noun
14-
15-
Returns:
16-
form corresponding to the given number
17-
"""
18-
if "|" in forms:
19-
return forms.split("|")[n != 1]
20-
else:
21-
return forms + "s" * (n != 1)
3+
__all__ = ['pl']

0 commit comments

Comments
 (0)