Commit 3af323bb authored by Michal Čihař's avatar Michal Čihař

Do not think that single translation is plural

parent a0c31a76
......@@ -9,12 +9,12 @@ class PluralTextarea(forms.Textarea):
'''
def render(self, name, value, attrs=None):
lang, value = value
if not isinstance(value, list):
if len(value) == 1:
attrs['class'] = 'translation'
# Prevent losing leading new line in <textarea>
if len(value) >= 1 and value[0] == '\n':
if len(value[0]) >= 1 and value[0][0] == '\n':
value = '\n' + value
return super(PluralTextarea, self).render(name, value, attrs)
return super(PluralTextarea, self).render(name, value[0], attrs)
ret = []
for idx, val in enumerate(value):
if idx > 0:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment