From 9a918b82d0dc32a3d84ac80a83b241176c2d4378 Mon Sep 17 00:00:00 2001 From: louyihua Date: Thu, 22 Oct 2015 15:28:02 +0800 Subject: [PATCH] Fix i18n error 1. When ```PLATFORM_NAME``` or ```APPLICATION_NAME``` contains non-ascii characters, production.py casuse an UnicodeDecode exception. 2. Use ```{{ application_name }}``` rather than hard-code ```Insights``` in index.html. --- analytics_dashboard/courses/templates/courses/index.html | 2 +- analytics_dashboard/settings/production.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/analytics_dashboard/courses/templates/courses/index.html b/analytics_dashboard/courses/templates/courses/index.html index 1b0efa574..a96f37fbf 100644 --- a/analytics_dashboard/courses/templates/courses/index.html +++ b/analytics_dashboard/courses/templates/courses/index.html @@ -15,7 +15,7 @@

{% endblock %} {% block intro-text %} - {% blocktrans %}Here are the courses you currently have access to in Insights:{% endblocktrans %} + {% blocktrans %}Here are the courses you currently have access to in {{ application_name }}:{% endblocktrans %} {% endblock intro-text %} {% block content %} diff --git a/analytics_dashboard/settings/production.py b/analytics_dashboard/settings/production.py index afa6e8a24..aeef27807 100644 --- a/analytics_dashboard/settings/production.py +++ b/analytics_dashboard/settings/production.py @@ -37,7 +37,7 @@ DATABASES['default'][override] = value # Re-declare the full application name in case the components have been overridden. -FULL_APPLICATION_NAME = '{0} {1}'.format(PLATFORM_NAME, APPLICATION_NAME) +FULL_APPLICATION_NAME = u'{0} {1}'.format(PLATFORM_NAME, APPLICATION_NAME) # Depends on DOCUMENTATION_LOAD_ERROR_URL, so evaluate at the end DOCUMENTATION_LOAD_ERROR_MESSAGE = 'This data may not be available for your course. ' \