django-recurrence icon indicating copy to clipboard operation
django-recurrence copied to clipboard

translation of rules buggy?

Open nerdoc opened this issue 4 years ago • 2 comments

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): image

But when I click on the item, the field is untranslated ("every 3 months"): image

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?

nerdoc avatar Jan 02 '21 15:01 nerdoc

Did you follow the instructions how to set up i18n?

https://django-recurrence.readthedocs.io/en/latest/installation.html#set-up-internationalization

lino avatar Jul 10 '22 21:07 lino

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),
]

nerdoc avatar Aug 28 '22 21:08 nerdoc