Edgewall Software

Opened 9 years ago

Last modified 9 years ago

#12202 closed defect

Mismatch datetime separator in datetime picker for several locales — at Version 2

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.0.9
Component: i18n Version: 1.0-stable
Severity: normal Keywords: datetimepicker
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Jun Omae)

Originally reported in [50289f02/rjollos.git].

timepicker_separator is always ' ' when iso8601 format isn't configured. However, date/time separator isn't a space character for several locales. ({0} is time part, {1} is date part in get_datetime_format()).

>>> import babel
>>> babel.__version__
'0.9.6'
>>> from babel.dates import get_datetime_format
>>> from trac.util.translation import get_available_locales
>>> fmts = {}
>>> for locale_id in 'ca cs da de el en_GB en_US eo es es_AR es_MX et fa fi fr gl he hu hy it ja ko nb nl pl pt pt_BR ro ru sl sv tr uk vi zh_CN zh_TW'.split():
...   fmt = get_datetime_format('medium', locale_id)
...   fmts.setdefault(fmt, []).append(locale_id)
...
>>> for fmt in sorted(fmts):
...   print('%r => %s' % (fmt, ' '.join(fmts[fmt])))
...
u'{0} {1}' => vi
u'{1} {0}' => ca cs da de el en_GB en_US eo es es_AR es_MX et fi fr gl he hu hy it ja ko nb nl pl pt pt_BR ru sl sv tr uk zh_CN zh_TW
u'{1}, {0}' => ro
u'{1}\u060c \u0633\u0627\u0639\u062a {0}' => fa
>>> import babel
>>> babel.__version__
'1.3'
>>> from babel.dates import get_datetime_format
>>> from trac.util.translation import get_available_locales
>>> fmts = {}
>>> for locale_id in 'ca cs da de el en_GB en_US eo es es_AR es_MX et fa fi fr gl he hu hy it ja ko nb nl pl pt pt_BR ro ru sl sv tr uk vi zh_CN zh_TW'.split():
...   fmt = get_datetime_format('medium', locale_id)
...   fmts.setdefault(fmt, []).append(locale_id)
...
>>> for fmt in sorted(fmts):
...   print('%r => %s' % (fmt, ' '.join(fmts[fmt])))
...
u'{0} {1}' => nb vi
u'{1} - {0}' => el
u'{1} {0}' => ca cs da de en_GB eo es es_AR es_MX et fi fr gl hu it ja ko nl pt pt_BR sl sv tr uk zh_CN zh_TW
u'{1}, {0}' => en_US he hy pl ro ru
u'{1}\u060c\u200f {0}' => fa

Change History (2)

comment:1 by Jun Omae, 9 years ago

Description: modified (diff)
Owner: set to Jun Omae
Status: newassigned

Proposed changes in [83e0d4c90/jomae.git].

comment:2 by Jun Omae, 9 years ago

Description: modified (diff)

(modified description to use all locales)

Note: See TracTickets for help on using tickets.