#22635: Welcome page should be translatable ------------------------------+------------------------------------------- Reporter: hakanw | Owner: giuliettamasina Type: Bug | Status: assigned Component: Translations | Version: master Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 1 Easy pickings: 0 | UI/UX: 0 ------------------------------+-------------------------------------------
Comment (by giuliettamasina): Here's the improved implementation of this: https://github.com/alimony/django/commit/f493d27579d94420b1b07a9bac6220fd1c7ba072 First, I tried just using `DEFAULT_URLCONF_TEMPLATE` as a format string, with named placeholders and a dict at the end, which is how many other localized strings are done. But this caused a strange circular dependency and import errors. A fix for this is putting it inside a function. But instead of adding a new function, I figured easiest would be to just pass the translated strings to the template context, and having regular template variables in the HTML. Let me know if this is a good approach. All tests are passing, and I've tested the change itself by: 1. Starting a new project, 2. generating a `.po` using `makemessages`, 3. translating it, 4. generating a new `.mo`, 5. changing `LANGUAGE_CODE` in `settings.py`, 6. doing `runserver` and visiting the site -- Ticket URL: <https://code.djangoproject.com/ticket/22635#comment:14> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.c76608949d192e55ae6b916b8097cba4%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.