Back to index

plone3  3.1.7
fallback.py
Go to the documentation of this file.
00001 from zope.interface import implements
00002 
00003 from plone.i18n.negotiator.interfaces import ILanguageFallback
00004 
00005 
00006 class LanguageFallback(object):
00007 
00008     implements(ILanguageFallback)
00009 
00010     def __init__(self):
00011         pass
00012 
00013     def fallback(self, language):
00014         # pt is not a fallback for pt-br
00015         if language.startswith('pt-br'):
00016             return ()
00017         parts = language.split('-')
00018         return (parts[0],)