def clean_translation(self):
translation = self.cleaned_data['<STR_LIT>']<EOL>if self.instance and self.instance.content_object:<EOL><INDENT>obj = self.instance.content_object<EOL>field = obj._meta.get_field(self.instance.field)<EOL>max_length = field.max_length<EOL>if max_length and len(translation) > max_length:<EOL><INDENT>raise forms.ValidationError(<EOL>_('<STR_LIT>'<EOL>'<STR_LIT>') % {<EOL>'<STR_LIT>': len(translation),<EOL>'<STR_LIT>': max_length,<EOL>}<EOL>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise forms.ValidationError(<EOL>_('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>)<EOL><DEDENT>return translation<EOL>
Do not allow translations longer than the max_lenght of the field to
be translated.