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 Tim Graham, 9 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Claude Paroz, 9 years ago

Easy pickings: set
Version: 1.8master

comment:3 by Benjamin Phillips, 9 years ago

Would simply switching the javascript to split on commas or another character be sufficient?

comment:4 by gunchleoc, 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 Benjamin Phillips, 9 years ago

PR posted with this fix (PR 5739 https://github.com/django/django/pull/5739)

comment:6 by Simon Charette, 9 years ago

Has patch: set
Patch needs improvement: set

comment:7 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: newclosed

In 7f663aec:

Fixed #25820 -- Allowed whitespace in admin's calendar.js month/weekday names.

This is useful for certain language translations.

Note: See TracTickets for help on using tickets.
Back to Top