caktus / django-project-template

Django project template for startproject (Requires 2.2+)
209 stars 53 forks source link

Basic translation setup with Transifex #210

Closed vkurup closed 9 years ago

vkurup commented 9 years ago

Thanks to @dpoirier for most of this, as well as to @mlavin for https://www.caktusgroup.com/blog/2013/04/25/managing-django-translations-transifex/

Closes #209

dpoirier commented 9 years ago

make makemessages doesn't work out of the box because the locale directories aren't there. Should we go ahead and create the directories? (We might need to put a .gitkeep file or something in them, since git doesn't store directories as such.)

vkurup commented 9 years ago

Hmmm... it created the directories for me:

(rescue_id)vkurup@caktus014:~/dev/rescue_id(develop) $ ls -al locale
ls: cannot access locale: No such file or directory
(rescue_id)vkurup@caktus014:~/dev/rescue_id(develop) $ make makemessages
# Extract English messages from our source code
python manage.py makemessages --ignore 'conf/*' --ignore 'docs/*' --ignore 'requirements/*' \
        --no-location --no-obsolete -l en
processing locale en
(rescue_id)vkurup@caktus014:~/dev/rescue_id(develop) $ ls locale
en
dpoirier commented 9 years ago

Hmm:

$ make makemessages
# Extract English messages from our source code
python manage.py makemessages --ignore 'conf/*' --ignore 'docs/*' --ignore 'requirements/*' \
                --no-location --no-obsolete -l en
CommandError: Unable to find a locale path to store translations for file manage.py
make: *** [makemessages] Error 1
dpoirier commented 9 years ago

then:

$ mkdir locale

$ make makemessages
# Extract English messages from our source code
python manage.py makemessages --ignore 'conf/*' --ignore 'docs/*' --ignore 'requirements/*' \
                --no-location --no-obsolete -l en
processing locale en
$
vkurup commented 9 years ago

I've added the 'gitkeep-ed' folder and also added the Locale middleware.

dpoirier commented 9 years ago

:+1: