django-recurrence
django-recurrence copied to clipboard
translation of rules buggy?
I have a simple object:
class RecurringTask(CreatedUpdatedMixin):
title = models.CharField(max_length=255)
recurrence = RecurrenceField()
def __str__(self):
return (
f"{self.title} ({', '.join([r.to_text() for r in self.recurrence.rrules])})"
)
When I see it in the Django admin, it translates the rule correctly into German (alle 3 Monate):
But when I click on the item, the field is untranslated ("every 3 months"):
Could it be that the RecurrenceField uses an untranslated string output when creating the edit widget? Or are these strings translated separatedly, and one is just not translated?
Did you follow the instructions how to set up i18n?
https://django-recurrence.readthedocs.io/en/latest/installation.html#set-up-internationalization
Yes, this is my main urls.py:
import django
from django.urls import path
from main.views import MainView
from django.views.i18n import JavaScriptCatalog
urlpatterns = [...]
js_info_dict = {
'packages': ('recurrence', ),
}
urlpatterns += [
path('jsi18n', JavaScriptCatalog.as_view(), js_info_dict),
]