mirror of
https://github.com/progval/Limnoria.git
synced 2025-04-27 05:21:09 -05:00
Add the '<empty>' feature to nItems, and changed ChannelStats localization in order to use it as bug fixer
This commit is contained in:
parent
8864a7fc71
commit
f3a579f3da
@ -84,7 +84,7 @@ msgstr "étaient des ACTIONs"
|
||||
#: plugin.py:292
|
||||
#: plugin.py:293
|
||||
msgid "time"
|
||||
msgstr " fois"
|
||||
msgstr "<empty>"
|
||||
|
||||
#: plugin.py:296
|
||||
msgid "I have no stats for that %s in %s."
|
||||
|
@ -294,17 +294,28 @@ def depluralize(s):
|
||||
def nItems(n, item, between=None):
|
||||
"""Works like this:
|
||||
|
||||
>>> nItems(4, '<empty>')
|
||||
'4'
|
||||
|
||||
>>> nItems(1, 'clock')
|
||||
'1 clock'
|
||||
|
||||
>>> nItems(10, 'clock')
|
||||
'10 clocks'
|
||||
|
||||
>>> nItems(4, '<empty>', between='grandfather')
|
||||
'4 grandfather'
|
||||
|
||||
>>> nItems(10, 'clock', between='grandfather')
|
||||
'10 grandfather clocks'
|
||||
"""
|
||||
assert isinstance(n, int) or isinstance(n, long), \
|
||||
'The order of the arguments to nItems changed again, sorry.'
|
||||
if item == '<empty>':
|
||||
if between is None:
|
||||
return format('%s', n)
|
||||
else:
|
||||
return format('%s %s', n, item)
|
||||
if between is None:
|
||||
if n != 1:
|
||||
return format('%s %p', n, item)
|
||||
|
Loading…
x
Reference in New Issue
Block a user