From cd70539df8694e249bd0873725d0051b502916f1 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Fri, 10 Oct 2014 19:14:19 -0300 Subject: [PATCH] Enable language selection --- sigi/settings/base.py | 7 ++++++- sigi/urls.py | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sigi/settings/base.py b/sigi/settings/base.py index faa4d60..6eb71b1 100644 --- a/sigi/settings/base.py +++ b/sigi/settings/base.py @@ -14,7 +14,6 @@ from os.path import dirname import django.conf.global_settings as DEFAULT_SETTINGS - BASE_DIR = dirname(dirname(dirname(__file__))) # Quick-start development settings - unsuitable for production @@ -95,6 +94,12 @@ USE_I18N = True USE_L10N = True USE_THOUSAND_SEPARATOR = True +gettext_noop = lambda s: s # for gettext discovery +LANGUAGES = ( + ('en', gettext_noop('English')), + ('pt-br', gettext_noop('Brazilian Portuguese')), +) + # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/dev/howto/static-files/ STATIC_ROOT = os.path.join(BASE_DIR, 'static') diff --git a/sigi/urls.py b/sigi/urls.py index f958508..e73c9ec 100644 --- a/sigi/urls.py +++ b/sigi/urls.py @@ -18,8 +18,11 @@ urlpatterns = patterns('', url(r'^servicos/', include('sigi.apps.servicos.urls')), url(r'^dashboard/', include('sigi.apps.metas.urls')), - url(r'^', include(admin.site.urls)), + + # to enable language selection + url(r'^i18n/', include('django.conf.urls.i18n')), + ) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) if settings.DEBUG: