Opened 9 years ago
Closed 9 years ago
#25820 closed Bug (fixed)
Month names can't be localized properly in admin Javascript
Reported by: | gunchleoc | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | i18n |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | yes | UI/UX: | no |
Description
While localizing https://www.transifex.com/django/django/contrib-admin-js/, I ran into the following string in contrib/admin/static/admin/js/calendar.js:11:
January February March April May June July August September October November December
Which I have now to translate as:
Faoilleach Gearran Màirt Giblean Cèitean Ògmhios Iuchar Lùnastal Sultain Dàmhair Samhain Dùbhlachd
However, the natural translation for
January
is
Am Faoilleach
and similarly for all the month names.
The point here is that the code has no way of knowing which whitespaces to choose as segmentation tokens.
So, I recommend translating these as separate entries, just like in the Python part of the code. The "S M T W T F S" string should then also be split for consistency.
Change History (7)
comment:1 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 9 years ago
Easy pickings: | set |
---|---|
Version: | 1.8 → master |
comment:3 by , 9 years ago
comment:4 by , 9 years ago
Yes, that would work for me. Maybe we should use / or | as a separator? It somehow feels safer than a comma.
comment:5 by , 9 years ago
PR posted with this fix (PR 5739 https://github.com/django/django/pull/5739)
comment:6 by , 9 years ago
Has patch: | set |
---|---|
Patch needs improvement: | set |
Would simply switching the javascript to split on commas or another character be sufficient?