Browse Source

Enable language selection

producao
Marcio Mazza 10 years ago
parent
commit
cd70539df8
  1. 7
      sigi/settings/base.py
  2. 5
      sigi/urls.py

7
sigi/settings/base.py

@ -14,7 +14,6 @@ from os.path import dirname
import django.conf.global_settings as DEFAULT_SETTINGS import django.conf.global_settings as DEFAULT_SETTINGS
BASE_DIR = dirname(dirname(dirname(__file__))) BASE_DIR = dirname(dirname(dirname(__file__)))
# Quick-start development settings - unsuitable for production # Quick-start development settings - unsuitable for production
@ -95,6 +94,12 @@ USE_I18N = True
USE_L10N = True USE_L10N = True
USE_THOUSAND_SEPARATOR = 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) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/dev/howto/static-files/ # https://docs.djangoproject.com/en/dev/howto/static-files/
STATIC_ROOT = os.path.join(BASE_DIR, 'static') STATIC_ROOT = os.path.join(BASE_DIR, 'static')

5
sigi/urls.py

@ -18,8 +18,11 @@ urlpatterns = patterns('',
url(r'^servicos/', include('sigi.apps.servicos.urls')), url(r'^servicos/', include('sigi.apps.servicos.urls')),
url(r'^dashboard/', include('sigi.apps.metas.urls')), url(r'^dashboard/', include('sigi.apps.metas.urls')),
url(r'^', include(admin.site.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) ) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
if settings.DEBUG: if settings.DEBUG:

Loading…
Cancel
Save