Skip to content

Commit

Permalink
Specify translation context, so the value can be easily changed in a … (
Browse files Browse the repository at this point in the history
#4012)

Specify translation context, so the value can be easily changed in a project if needed.
  • Loading branch information
specialunderwear committed Nov 23, 2022
1 parent 3dee0ae commit 993e8a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/oscar/apps/catalogue/abstract_models.py
Expand Up @@ -21,7 +21,7 @@
from django.utils.safestring import mark_safe
from django.utils.translation import get_language
from django.utils.translation import gettext_lazy as _
from django.utils.translation import pgettext_lazy
from django.utils.translation import pgettext, pgettext_lazy
from treebeard.mp_tree import MP_Node

from oscar.core.loading import get_class, get_classes, get_model
Expand Down Expand Up @@ -1145,8 +1145,8 @@ def _entity_as_text(self):
@property
def _boolean_as_text(self):
if self.value:
return _("Yes")
return _("No")
return pgettext("Product attribute value", "Yes")
return pgettext("Product attribute value", "No")

@property
def value_as_html(self):
Expand Down
1 change: 0 additions & 1 deletion tests/integration/catalogue/test_attributes.py
Expand Up @@ -81,7 +81,6 @@ def test_boolean_value_as_text_false(self):
assert attr_val.value_as_text == "No"



class TestMultiOptionAttributes(TestCase):

def setUp(self):
Expand Down

0 comments on commit 993e8a6

Please sign in to comment.