Skip to content

Commit 4034793

Browse files
committed
Added missing translation markers in realtions.py. Closes #2231.
1 parent 62cca1e commit 4034793

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

rest_framework/relations.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ def to_representation(self, value):
115115

116116
class PrimaryKeyRelatedField(RelatedField):
117117
default_error_messages = {
118-
'required': 'This field is required.',
119-
'does_not_exist': "Invalid pk '{pk_value}' - object does not exist.",
120-
'incorrect_type': 'Incorrect type. Expected pk value, received {data_type}.',
118+
'required': _('This field is required.'),
119+
'does_not_exist': _("Invalid pk '{pk_value}' - object does not exist."),
120+
'incorrect_type': _('Incorrect type. Expected pk value, received {data_type}.'),
121121
}
122122

123123
def to_internal_value(self, data):
@@ -162,11 +162,11 @@ class HyperlinkedRelatedField(RelatedField):
162162
lookup_field = 'pk'
163163

164164
default_error_messages = {
165-
'required': 'This field is required.',
166-
'no_match': 'Invalid hyperlink - No URL match',
167-
'incorrect_match': 'Invalid hyperlink - Incorrect URL match.',
168-
'does_not_exist': 'Invalid hyperlink - Object does not exist.',
169-
'incorrect_type': 'Incorrect type. Expected URL string, received {data_type}.',
165+
'required': _('This field is required.'),
166+
'no_match': _('Invalid hyperlink - No URL match'),
167+
'incorrect_match': _('Invalid hyperlink - Incorrect URL match.'),
168+
'does_not_exist': _('Invalid hyperlink - Object does not exist.'),
169+
'incorrect_type': _('Incorrect type. Expected URL string, received {data_type}.'),
170170
}
171171

172172
def __init__(self, view_name=None, **kwargs):

0 commit comments

Comments
 (0)