Django

Code

Changeset 7848

Show
Ignore:
Timestamp:
07/06/08 07:55:24 (5 months ago)
Author:
mtredinnick
Message:

Fixed #7643 -- Fixed an oversight from [7844].

Now makemessages works in projects again. Based on a patch from Horst Gutmann.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/conf/__init__.py

    r6943 r7848  
    7272        self._target = holder 
    7373 
     74    def configured(self): 
     75        """ 
     76        Returns True if the settings have already been configured. 
     77        """ 
     78        return bool(self._target) 
     79    configured = property(configured) 
     80 
    7481class Settings(object): 
    7582    def __init__(self, settings_module): 
  • django/trunk/django/core/management/commands/makemessages.py

    r7844 r7848  
    1111    """ 
    1212    Uses the locale directory from the Django SVN tree or an application/ 
    13     project to process all  
     13    project to process all 
    1414    """ 
    1515    # Need to ensure that the i18n framework is enabled 
    1616    from django.conf import settings 
    17     settings.configure(USE_I18N = True) 
    18      
     17    if settings.configured: 
     18        settings.USE_I18N = True 
     19    else: 
     20        settings.configure(USE_I18N = True) 
     21 
    1922    from django.utils.translation import templatize 
    2023 
     
    2528    else: 
    2629        raise CommandError("This script should be run from the Django SVN tree or your project or app tree. If you did indeed run it from the SVN checkout or your project or application, maybe you are just missing the conf/locale (in the django tree) or locale (for project and application) directory? It is not created automatically, you have to create it by hand if you want to enable i18n for your project or application.") 
    27      
     30 
    2831    if domain not in ('django', 'djangojs'): 
    2932        raise CommandError("currently makemessages only supports domains 'django' and 'djangojs'")