How to display only the tags translated into the corresponding language on a multilingual site?
In my multilingual site, when I display the page of an article, the tags remain in English while in the admin, the tag has been translated into French.
So how do I proceed so that the translated page is displayed with the translated tags?
class Insight(Page):
...
tags = ClusterTaggableManager(through='insight.InsightTag', blank = True)
...
@register_snippet
class InsightTag(
TranslatableMixin,
TaggedItemBase
):
content_object = ParentalKey(
to='insight.Insight',
related_name='tagged_items',
on_delete=models.CASCADE
)
def get_preview_template(self, request, mode_name):
return "base.html"
def get_preview_context(self, request, mode_name):
return {"insighttag": self.body}
class Meta(TranslatableMixin.Meta):
verbose_name = "insight Tag"
verbose_name_plural = "insight Tags"