mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-06 13:01:50 +02:00
Update ihatemoney/utils.py
Co-Authored-By: Glandos <bugs-github@antipoul.fr>
This commit is contained in:
parent
1497d2c666
commit
9d91eea6c2
1 changed files with 1 additions and 6 deletions
|
@ -320,12 +320,7 @@ def localize_list(list, surround_with_em=True):
|
||||||
middle = _("{previous_object}, {next_object}")
|
middle = _("{previous_object}, {next_object}")
|
||||||
end = _("{previous_object}, and {end_object}")
|
end = _("{previous_object}, and {end_object}")
|
||||||
|
|
||||||
item_wrapper = em_surround
|
item_wrapper = em_surround if surround_with_em else lambda x: x
|
||||||
# fmt: off
|
|
||||||
if not surround_with_em:
|
|
||||||
def item_wrapper(x):
|
|
||||||
return x
|
|
||||||
# fmt: on
|
|
||||||
|
|
||||||
if len(list) == 1:
|
if len(list) == 1:
|
||||||
return one.format(single_object=item_wrapper(list[0]))
|
return one.format(single_object=item_wrapper(list[0]))
|
||||||
|
|
Loading…
Reference in a new issue