From 403479338380fd4853128f11b5f7055e925125a5 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 8 Dec 2014 15:13:59 +0000 Subject: [PATCH] Added missing translation markers in realtions.py. Closes #2231. --- rest_framework/relations.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rest_framework/relations.py b/rest_framework/relations.py index 178a8e2b0..75d68204b 100644 --- a/rest_framework/relations.py +++ b/rest_framework/relations.py @@ -115,9 +115,9 @@ class StringRelatedField(RelatedField): class PrimaryKeyRelatedField(RelatedField): default_error_messages = { - 'required': 'This field is required.', - 'does_not_exist': "Invalid pk '{pk_value}' - object does not exist.", - 'incorrect_type': 'Incorrect type. Expected pk value, received {data_type}.', + 'required': _('This field is required.'), + 'does_not_exist': _("Invalid pk '{pk_value}' - object does not exist."), + 'incorrect_type': _('Incorrect type. Expected pk value, received {data_type}.'), } def to_internal_value(self, data): @@ -162,11 +162,11 @@ class HyperlinkedRelatedField(RelatedField): lookup_field = 'pk' default_error_messages = { - 'required': 'This field is required.', - 'no_match': 'Invalid hyperlink - No URL match', - 'incorrect_match': 'Invalid hyperlink - Incorrect URL match.', - 'does_not_exist': 'Invalid hyperlink - Object does not exist.', - 'incorrect_type': 'Incorrect type. Expected URL string, received {data_type}.', + 'required': _('This field is required.'), + 'no_match': _('Invalid hyperlink - No URL match'), + 'incorrect_match': _('Invalid hyperlink - Incorrect URL match.'), + 'does_not_exist': _('Invalid hyperlink - Object does not exist.'), + 'incorrect_type': _('Incorrect type. Expected URL string, received {data_type}.'), } def __init__(self, view_name=None, **kwargs):