2

I am really getting annoyed by this. So I have the following structure:

project/
   project/
   locale/
      fr/
        locale/
          LC_MESSAGES/
              django.po
              django.mo
   templates/

I have

USE_I18N = True

USE_L10N = True

LANGUAGE_COOKIE_NAME = 'django_language'

LOCALE_PATHS = '/Users/xxxx/Programming/Projects/xxxx/locale'

LANGUAGES = ( ('en', gettext_noop('English')), ('fr', gettext_noop('French')), )

I mostly have my strings to translate in my templates which are in the templates directory.

Within my app, it seems like I am setting the language correctly, since I can see the django password forms are changing from French to English. It is just MY templates are not getting translated.

Thanks!

abisson
  • 4,365
  • 9
  • 46
  • 68
  • 1
    Did you try `LOCALE_PATHS = ('/Users/xxxx/Programming/Projects/xxxx/locale', )` ? http://stackoverflow.com/questions/16768809/django-internationalization-minimal-example/16773455 – andrea.ge May 31 '13 at 08:10
  • It worked! You can write an answer if you want, I will accept it! – abisson May 31 '13 at 13:05

1 Answers1

1

LOCALE_PATHS is a tuple, as stated in https://docs.djangoproject.com/en/dev/ref/settings/#locale-paths

If you provide a string, Django considers it as a tuple (of characters) and probably loops through all the characters one by one, looking for templates in there.

If you have a single directory remember to write it as a tuple, i.e. ('string', ) and not ('string'), if you have more then ('string1', 'string2') is fine.

andrea.ge
  • 1,937
  • 1
  • 18
  • 27