diff --git a/base/assets/stylesheets/components/_profiles.scss b/base/assets/stylesheets/components/_profiles.scss index 1734135d..b4bbb0c6 100644 --- a/base/assets/stylesheets/components/_profiles.scss +++ b/base/assets/stylesheets/components/_profiles.scss @@ -7,6 +7,20 @@ } } +%secondary-name { + font-size: 1.333rem; + font-weight: 300; +} +%primary-name { + color: #454D57; + font-family: $font-family-primary; + font-size: 2.369rem; + font-weight: 600; + letter-spacing: -1px; + + b { color: $headings-font-color; } +} + // .profile-header (*) // Classes tasked with styling the header section of a profile page. .profile-header { @@ -39,18 +53,14 @@ margin-top: 0; margin-bottom: 0; padding: 3px 0; - .name { - font-size: 1.333rem; - font-weight: 300; + :lang(en) & { + .name { @extend %secondary-name; } + .romanized-name { @extend %primary-name; } + } - .romanized-name { - color: #454D57; - font-family: $font-family-primary; - font-size: 2.369rem; - font-weight: 600; - letter-spacing: -1px; - - b { color: $headings-font-color; } + :lang(ja) & { + .name { @extend %primary-name; } + .romanized-name { @extend %secondary-name; } } } diff --git a/base/settings/base.py b/base/settings/base.py index 81201390..888d00d4 100644 --- a/base/settings/base.py +++ b/base/settings/base.py @@ -10,6 +10,8 @@ from djcelery import setup_loader from postgresify import postgresify +ugettext = lambda s: s + class Base(Configuration): # Path Configuration. @@ -63,8 +65,9 @@ class Base(Configuration): # -------------------------------------------------------------------------- MIDDLEWARE_CLASSES = ( 'django.middleware.gzip.GZipMiddleware', - 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.locale.LocaleMiddleware', + 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', @@ -104,13 +107,20 @@ class Base(Configuration): # General Configuration. # -------------------------------------------------------------------------- - DATE_FORMAT = 'Y/m/d' LANGUAGE_CODE = 'en-us' SITE_ID = 1 TIME_ZONE = 'UTC' + USE_TZ = True + + # Internationalization Configuration. + # -------------------------------------------------------------------------- + FORMAT_MODULE_PATH = 'settings.formats' + LANGUAGES = ( + ('en', ugettext('English')), + ('ja', ugettext('Japanese')), + ) USE_I18N = True USE_L10N = True - USE_TZ = True # Template Configuration. # -------------------------------------------------------------------------- diff --git a/base/settings/formats/__init__.py b/base/settings/formats/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/base/settings/formats/en/__init__.py b/base/settings/formats/en/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/base/settings/formats/en/formats.py b/base/settings/formats/en/formats.py new file mode 100644 index 00000000..b739e2c1 --- /dev/null +++ b/base/settings/formats/en/formats.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +DATE_FORMAT = u'F j, Y' +SHORT_DATE_FORMAT = u'Y/m/d' diff --git a/base/settings/formats/ja/__init__.py b/base/settings/formats/ja/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/base/settings/formats/ja/formats.py b/base/settings/formats/ja/formats.py new file mode 100644 index 00000000..7225b177 --- /dev/null +++ b/base/settings/formats/ja/formats.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +DATE_FORMAT = u'Y年m月d日' +SHORT_DATE_FORMAT = u'Y/m/d' diff --git a/base/settings/production.py b/base/settings/production.py index c7468471..a4d9b427 100644 --- a/base/settings/production.py +++ b/base/settings/production.py @@ -22,9 +22,10 @@ class Production(Settings): MIDDLEWARE_CLASSES = ( 'django.middleware.cache.UpdateCacheMiddleware', 'django.middleware.gzip.GZipMiddleware', - 'django.middleware.common.CommonMiddleware', 'djangosecure.middleware.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.locale.LocaleMiddleware', + 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', diff --git a/base/templates/base.html b/base/templates/base.html index c1a0852b..a012f5f9 100644 --- a/base/templates/base.html +++ b/base/templates/base.html @@ -1,4 +1,6 @@ +{% load i18n %} {% load static from staticfiles %} +{% get_current_language as LANGUAGE_CODE %} diff --git a/base/templates/events/event_detail.html b/base/templates/events/event_detail.html index 8d799b45..6f802863 100644 --- a/base/templates/events/event_detail.html +++ b/base/templates/events/event_detail.html @@ -31,7 +31,7 @@
{{ primary.standing }}{% if primary.group.romanized_name != "Soloist" %} of {{ primary.group }}{% endif %}
{% endwith %}