django-admin makemessages
Runs over the entire source tree of the current directory and pulls out all strings marked for translation. It creates (or updates) a message file in the conf/locale (in the django tree) or locale (for projects and applications) directory. You must run this command with one of either the --locale, --exclude, or --all options
Options
Name | Description |
---|---|
--locale, -l <LOCALE> | Creates or updates the message files for the given locale(s) (e.g. pt_BR). Can be used multiple times |
--exclude, -x <EXCLUDE> | Locales to exclude. Default is none. Can be used multiple times |
--domain, -d <DOMAIN> | The domain of the message files (default: "django") |
--all, -a | Updates the message files for all existing locales |
--extension, -e <EXTENSIONS> | The file extension(s) to examine (default: "html,txt,py", or "js" if the domain is "djangojs"). Separate multiple extensions with commas, or use -e multiple times |
--symlinks, -s | Follows symlinks to directories when examining source code and templates for translation strings |
--ignore, -i <PATTERN> | Ignore files or directories matching this glob-style pattern. Use multiple times to ignore more |
--no-default-ignore | Don't ignore the common glob-style patterns 'CVS', '.*', '*~' and '*.pyc' |
--no-wrap | Don't break long message lines into several lines |
--no-location | Don't write '#: filename:line' lines |
--add-location [location] | [{full,file,never}] Controls '#: filename:line' lines. If the option is 'full' (the default if not given), the lines include both file name and line number. If it's 'file', the line number is omitted. If it's 'never', the lines are suppressed (same as --no-location). --add-location requires gettext 0.19 or newer |
--no-obsolete | Remove obsolete message strings |
--keep-pot | Keep .pot file after making messages. Useful when debugging |
-h, --help | Show this help message and exit |
--version | Show program's version number and exit |
-v, --verbosity <{0,1,2,3}> | Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output |
--settings <SETTINGS> | The Python path to a settings module, e.g. "myproject.settings.main". If this isn't provided, the DJANGO_SETTINGS_MODULE environment variable will be used |
--pythonpath <PYTHONPATH> | A directory to add to the Python path, e.g. "/home/djangoprojects/myproject" |
--traceback | Raise on CommandError exceptions |
--no-color | Don't colorize the command output |
--force-color | Force colorization of the command output |