diff options
-rw-r--r-- | askbot/setup_templates/settings.py | 1 | ||||
-rw-r--r-- | askbot/setup_templates/settings.py.mustache | 1 | ||||
-rw-r--r-- | askbot/urls.py | 6 |
3 files changed, 7 insertions, 1 deletions
diff --git a/askbot/setup_templates/settings.py b/askbot/setup_templates/settings.py index ed5c30da..ef24a82f 100644 --- a/askbot/setup_templates/settings.py +++ b/askbot/setup_templates/settings.py @@ -200,6 +200,7 @@ logging.basicConfig( # ASKBOT_URL = 'forum/' # ASKBOT_URL = '' #no leading slash, default = '' empty string +ASKBOT_TRANSLATE_URL = True #translate specific URLs _ = lambda v:v #fake translation function for the login url LOGIN_URL = '/%s%s%s' % (ASKBOT_URL,_('account/'),_('signin/')) #note - it is important that upload dir url is NOT translated!!! diff --git a/askbot/setup_templates/settings.py.mustache b/askbot/setup_templates/settings.py.mustache index fa0b20d0..081f37fa 100644 --- a/askbot/setup_templates/settings.py.mustache +++ b/askbot/setup_templates/settings.py.mustache @@ -199,6 +199,7 @@ logging.basicConfig( # ASKBOT_URL = 'forum/' # ASKBOT_URL = '' #no leading slash, default = '' empty string +ASKBOT_TRANSLATE_URL = True #translate specific URLs _ = lambda v:v #fake translation function for the login url LOGIN_URL = '/%s%s%s' % (ASKBOT_URL,_('account/'),_('signin/')) #note - it is important that upload dir url is NOT translated!!! diff --git a/askbot/urls.py b/askbot/urls.py index 8c1e3c3a..ec10d3b5 100644 --- a/askbot/urls.py +++ b/askbot/urls.py @@ -6,7 +6,6 @@ from django.conf import settings from django.conf.urls.defaults import url, patterns, include from django.conf.urls.defaults import handler500, handler404 from django.contrib import admin -from django.utils.translation import ugettext as _ from askbot import views from askbot.feed import RssLastestQuestionsFeed, RssIndividualQuestionFeed from askbot.sitemap import QuestionsSitemap @@ -15,6 +14,11 @@ from askbot.skins.utils import update_media_revision admin.autodiscover() update_media_revision()#needs to be run once, so put it here +if hasattr(settings, "ASKBOT_TRANSLATE_URL") and settings.ASKBOT_TRANSLATE_URL: + from django.utils.translation import ugettext as _ +else: + _ = lambda s:s + feeds = { 'rss': RssLastestQuestionsFeed, 'question':RssIndividualQuestionFeed |