Inline locale generation for a Django project
Generating the locales for all your application within a Django project can be painful. You have to get into each application directory and invoke "django-admin.py compilemessages". This can be solved by the following shell command which look for apps with a "locale" directory and and generate its locale.
for dir in $(find ./ -maxdepth 1 -mindepth 1 -type d -not -path '*/\.*'); do if [ -d "$dir/locale" ]; then cd "$dir"; django-admin.py compilemessages; cd ..; fi; done
Obviously, a variation of this command can be used with "makemessages" instead of "compilemessages".
Written by Rodolphe Breard
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#