#14164: Automatic localization of numbers (L10N) in templates can cause invalid sitemap priorities ------------------------------------------------------+--------------------- Reporter: dokterbob | Owner: nobody Status: new | Milestone: Component: Internationalization | Version: 1.2 Keywords: internationalization L10N sitemaps comma | Stage: Unreviewed Has_patch: 0 | ------------------------------------------------------+--------------------- When specifying priorities for a sitemap as a float (as is suggested by the official documentation) and `USE_L10N = True`, it can happen that requested sitemaps contain comma's in the priority values for items when the server detects certain locales. As the sitemaps specification requires a dot as a separator for float values this yields an invalid sitemap and has been confirmed to prohibit the indexing of certain sites.
The problem can be reproduced as follows: 1. Make sure `USE_L10N = True` in `settings.py`. 2. Create a Sitemap object with a priority and expose it somewhere in the URL space. (For example: `priority = 0.5`) 3. Request the sitemap with a browser for which the decimal separator is something other than a dot. (This holds for many European locales.) 4. Priority value should now be rendered wrongly. (For example: `<priority>0,5</priority>`) As this problem is likely to occur for other situations where templates are used to render machine-parseable content, a structural solution should be in order. -- Ticket URL: <http://code.djangoproject.com/ticket/14164> Django <http://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 post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.
