Changes between Version 1 and Version 2 of Ticket #12202
- Timestamp:
- Sep 7, 2015, 6:03:19 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #12202 – Description
v1 v2 11 11 >>> from trac.util.translation import get_available_locales 12 12 >>> fmts = {} 13 >>> for locale_id in sorted(get_available_locales()):13 >>> 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(): 14 14 ... fmt = get_datetime_format('medium', locale_id) 15 15 ... fmts.setdefault(fmt, []).append(locale_id) 16 16 ... 17 >>> for fmt in fmts:17 >>> for fmt in sorted(fmts): 18 18 ... print('%r => %s' % (fmt, ' '.join(fmts[fmt]))) 19 19 ... 20 u'{0} {1}' => vi 20 21 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 21 22 u'{1}, {0}' => ro 23 u'{1}\u060c \u0633\u0627\u0639\u062a {0}' => fa 22 24 }}} 23 25 24 26 {{{#!pycon 27 >>> import babel 25 28 >>> babel.__version__ 26 29 '1.3' … … 28 31 >>> from trac.util.translation import get_available_locales 29 32 >>> fmts = {} 30 >>> for locale_id in sorted(get_available_locales()):33 >>> 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(): 31 34 ... fmt = get_datetime_format('medium', locale_id) 32 35 ... fmts.setdefault(fmt, []).append(locale_id) 33 36 ... 34 >>> for fmt in fmts:37 >>> for fmt in sorted(fmts): 35 38 ... print('%r => %s' % (fmt, ' '.join(fmts[fmt]))) 36 39 ... 37 u'{0} {1}' => nb 40 u'{0} {1}' => nb vi 41 u'{1} - {0}' => el 38 42 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 39 43 u'{1}, {0}' => en_US he hy pl ro ru 40 u'{1} - {0}' => el44 u'{1}\u060c\u200f {0}' => fa 41 45 }}}