admin/translations: add a text area to translate any message

This commit is contained in:
Benjamin Dauvergne 2014-01-13 14:33:55 +01:00
parent 7a41c6ce25
commit d93f4f660d
1 changed files with 7 additions and 1 deletions

View File

@ -65,6 +65,8 @@ class TranslationsDirectory(Directory):
continue
ignore, number, ignore = key.split('-')
key = post.get(key)
if not key:
continue
value = post.get('translation-%s-value' % number)
if not value:
custom_translation.pop(key, None)
@ -121,12 +123,16 @@ pre {
}
</style>'''
'<form method="post"><table>'
i = 0
i = 1
'<input class="submit" type="submit" name="submit" value="%s">' % _('Submit')
'<thead><tr><td>%s</td>' % _('Message')
'<td>%s</td>' % _('Custom translation')
'<td>%s</td></tr></thead>' % _('Default translation')
'<tbody>'
'<tr>'
'<td class="message"><textarea name="translation-%s-key"></textarea></td>' % 0
'<td class="custom-translation"><textarea rows="10" cols="50" name="translation-%s-value"></textarea></td>' % 0
'</tr>'
for key in keys:
if not key:
continue