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

translation of rules buggy? #180

Open
nerdoc opened this issue Jan 2, 2021 · 2 comments
Open

translation of rules buggy? #180

nerdoc opened this issue Jan 2, 2021 · 2 comments

Comments

@nerdoc
Copy link

nerdoc commented Jan 2, 2021

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?

@lino
Copy link
Contributor

lino commented Jul 10, 2022

Did you follow the instructions how to set up i18n?

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

@nerdoc
Copy link
Author

nerdoc commented Aug 28, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants