wheezy.web / demos / quickstart-i18n / src /


from wheezy.routing import url

from public.web.urls import error_urls
from public.web.urls import public_urls
from public.web.urls import static_urls
from public.web.views import WelcomeHandler

locale_pattern = '{locale:(en|ru)}/'
locale_defaults = {'locale': 'en'}

locale_urls = []
locale_urls += public_urls
locale_urls.append(('error/', error_urls))
locale_urls.append(('.*', lambda ignore: None))
all_urls = [
    url('', WelcomeHandler, locale_defaults),
    url(locale_pattern.rstrip('/'), WelcomeHandler, locale_defaults,
    (locale_pattern, locale_urls, locale_defaults),
all_urls += static_urls
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.