• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Locales

The Locale instance for a user is available via the request object, which is always available from a view. However, you can easily test the functionality of Locale instances by using the interactive Python prompt. To do so, you go to the directory Zope3-Installation/lib/python and start Python. You can then use the following code to get a locale:

01 >>> from zope.i18n.locales import LocaleProvider
02 >>> provider = LocaleProvider('./zope/i18n/locales/data')
03 >>> locale = provider.getLocale('en', 'US')


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint