Can't set the shop language in Satchmo
Question: I'm trying to set the default and only shop language of a Satchmo 0.9.2
installationto Dutch.

I'm following the instructions on [translating
content](http://www.satchmoproject.com/docs/dev/translation.html):

From the directory
`/home/myusername/webapps/myshop/lib/python2.7/Satchmo-0.9.2-py2.7.egg` I
issued the following command to compile the Dutch langauge files:

    
    
    find . -name locale -exec sh -c 'cd $0 && cd ../ && python2.7 
    /home/myusername/webapps/myshop/lib/python2.7/django/bin/django-admin.py 
    makemessages -l nl -e html,txt,rml' {} \;
    

I can now see multiple `.../locale/nl/LC_MESSAGES/django.po` files wich
contain messagestrings translated into Dutch.

My `local_settings.py` file has a `LOCALE_PATHS` variable defined:

    
    
    LOCALE_PATHS = ""
    

I have compiled the `.po` files to `.mo` files with:

    
    
    find . -name locale -exec sh -c 'cd $0 && cd ../ && python2.7
    /home/myusername/webapps/myshop/lib/python2.7/django/bin/django-admin.py 
    compilemessages' {} \;
    

I only want text to appear in Dutch, so my `local_settings.py` only contains:

    
    
    LANGUAGE_CODE = 'nl'
    LANGUAGES = (
        ('nl', "Nederlands"),
    )
    

Users should not be ablo to choose other translations, so
`allow_translation_choice` is set to `False` in `settings.py`:

    
    
    L10N_SETTINGS = {
      'currency_formats' : {
         'EURO' : {'symbol': u'€', 'positive' : u"€%(val)0.2f", 'negative':
    u"€(%(val)0.2f)",
                   'decimal' : ','},
      },
      'default_currency' : 'EURO',
      'show_admin_translations': True,
      'allow_translation_choice': False,
    }
    

and in the same file I have enabled my i18n urls:

    
    
    SATCHMO_SETTINGS = {
        'SHOP_BASE' : '',
        'MULTISHOP' : False,
        'SHOP_URLS' : patterns('', (r'^i18n/', include('l10n.urls')),)
    }
    

To make sure that my templates use the correct language code, I also have in
`settings.py`:

    
    
    TEMPLATE_CONTEXT_PROCESSORS = (
        'satchmo_store.shop.context_processors.settings',
        'django.core.context_processors.auth',
        'django.core.context_processors.i18n',
    )
    

After jumping through all these hoops, my shop language still shows up in
English and still has the 'Change language' with an empty drop-down button in
the lower right corner.

Anyone have a clue where I went wrong?

Thanks in advance.


Answer: The only necessary steps to enable switching languages are:

1) Change languages in local_settings.py:

    
    
    LANGUAGE_CODE = 'nl'      # not as important as would expected
    LANGUAGES = (
        ('nl', "Nederlands"), # languages supported by you 
    )
    

2) Enable switching by adding the following line to the dictionary
SATCHMO_SETTINGS in settings.py:

    
    
        'SHOP_URLS' : patterns('', (r'^i18n/', include('l10n.urls')),),
    

Select your language on the web page.

Notes:

I have verified now the previous with new installed old Satchmo valid at the
date of your report. (last change at end of Februar 2011)

For sure look that no previous value is set later to a different value in
settings.py or local_settings.py.

I am not sure that LANGUAGE_CODE does what is expected by most people. It is
used only if user did not selected any language manually and the language
preferred by user's browser is not enabled by site. Therefore I usually
disable English.

If you are adding a new language to Satchmo, verify that it is in
`django/conf/locale`. (there are more than 50 languages) Otherwise use
FORMAT_MODULE_PATH and read Django documentation about it.

