comparison doc/display.txt @ 40:0739bc8e7210 trunk

Syntax highlighting for the docs.
author cmlenz
date Wed, 06 Jun 2007 11:02:48 +0000
parents 1b9956f20649
children 98dcabc99308
comparison
equal deleted inserted replaced
39:008de2f257a6 40:0739bc8e7210
27 27
28 The ``Locale`` Class 28 The ``Locale`` Class
29 ==================== 29 ====================
30 30
31 You normally access such locale data through the `Locale`_ class provided 31 You normally access such locale data through the `Locale`_ class provided
32 by Babel:: 32 by Babel:
33
34 .. code-block:: pycon
33 35
34 >>> from babel import Locale 36 >>> from babel import Locale
35 >>> locale = Locale('en', 'US') 37 >>> locale = Locale('en', 'US')
36 >>> locale.territories['US'] 38 >>> locale.territories['US']
37 u'United States' 39 u'United States'
58 The `Locale`_ class provides access to many locale display names related to 60 The `Locale`_ class provides access to many locale display names related to
59 calendar display, such as the names of week days or months. 61 calendar display, such as the names of week days or months.
60 62
61 These display names are of course used for date formatting, but can also be 63 These display names are of course used for date formatting, but can also be
62 used, for example, to show a list of months to the user in their preferred 64 used, for example, to show a list of months to the user in their preferred
63 language:: 65 language:
66
67 .. code-block:: pycon
64 68
65 >>> locale = Locale('es') 69 >>> locale = Locale('es')
66 >>> month_names = locale.months['format']['wide'].items() 70 >>> month_names = locale.months['format']['wide'].items()
67 >>> month_names.sort() 71 >>> month_names.sort()
68 >>> for idx, name in month_names: 72 >>> for idx, name in month_names:
Copyright (C) 2012-2017 Edgewall Software