Added missing translation markers in realtions.py. Closes #2231.

This commit is contained in:
Tom Christie 2014-12-08 15:13:59 +00:00
parent 62cca1eec7
commit 4034793383

View File

@ -115,9 +115,9 @@ class StringRelatedField(RelatedField):
class PrimaryKeyRelatedField(RelatedField): class PrimaryKeyRelatedField(RelatedField):
default_error_messages = { default_error_messages = {
'required': 'This field is required.', 'required': _('This field is required.'),
'does_not_exist': "Invalid pk '{pk_value}' - object does not exist.", 'does_not_exist': _("Invalid pk '{pk_value}' - object does not exist."),
'incorrect_type': 'Incorrect type. Expected pk value, received {data_type}.', 'incorrect_type': _('Incorrect type. Expected pk value, received {data_type}.'),
} }
def to_internal_value(self, data): def to_internal_value(self, data):
@ -162,11 +162,11 @@ class HyperlinkedRelatedField(RelatedField):
lookup_field = 'pk' lookup_field = 'pk'
default_error_messages = { default_error_messages = {
'required': 'This field is required.', 'required': _('This field is required.'),
'no_match': 'Invalid hyperlink - No URL match', 'no_match': _('Invalid hyperlink - No URL match'),
'incorrect_match': 'Invalid hyperlink - Incorrect URL match.', 'incorrect_match': _('Invalid hyperlink - Incorrect URL match.'),
'does_not_exist': 'Invalid hyperlink - Object does not exist.', 'does_not_exist': _('Invalid hyperlink - Object does not exist.'),
'incorrect_type': 'Incorrect type. Expected URL string, received {data_type}.', 'incorrect_type': _('Incorrect type. Expected URL string, received {data_type}.'),
} }
def __init__(self, view_name=None, **kwargs): def __init__(self, view_name=None, **kwargs):