Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify translation context, so the value can be easily changed in a … #4012

Merged
merged 3 commits into from Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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