Management commands


Running management commands under a different user than is running your webserver can cause wrong permissions on some files, please check Filesystem permissions for more details.

Django comes with a management script (available as ./ in sources or installed as weblate when Weblate is installed). It provides various management commands and Weblate extends it with several additional commands.

Invoking management commands

As mentioned before, invocation depends on how you have installed Weblate.

If you are using virtualenv for Weblate, you can either specify full path to weblate or activate the virtualenv prior invoking it:

# Direct invocation

# Activating virtualenv adds it to search path
. ~/weblate-env/bin/activate

If you are using source code directly (either tarball or Git checkout), the management script is ./ in Weblate sources. Execution can be done as:

python ./ list_versions

If you’ve installed Weblate using PIP installer or by ./ script, the weblate is installed to your path (or virtualenv path) and you can use it to control Weblate:

weblate list_versions

For Docker image, the script is installed same as above, you can execute it using docker exec:

docker exec --user weblate <container> weblate list_versions

With docker-compose this is quite similar, you just have to use docker-compose exec:

docker-compose exec --user weblate weblate weblate list_versions

In case you need to pass some file, you can temporary add a volume:

docker-compose exec --user weblate /tmp:/tmp weblate weblate importusers /tmp/users.json

add_suggestions add_suggestions <project> <component> <language> <file>

New in version 2.5.

Imports translation from the file as a suggestion to given translation. It skips translations which are the same as existing ones, only different ones are added.


Email of author for the suggestions. This user has to exist prior importing (you can create one in the admin interface if needed).


./ --author add_suggestions weblate master cs /tmp/suggestions-cs.po

auto_translate auto_translate <project> <component> <language>

New in version 2.5.

Performs automatic translation based on other component translations.


Specifies component to use as source for translation. If not specified all components in the project are used.


Specify username who will be author of the translations. Anonymous user is used if not specified.


Whether to overwrite existing translations.


Whether to overwrite existing translations which are inconsistent (see Inconsistent).


Automatically add language if given translation does not exist.

--mt MT

Use machine translation instead of other components.

--threshold THRESHOLD

Similarity threshold for machine translation, defaults to 80.


./ --user nijel --inconsistent --source phpmyadmin/master phpmyadmin 4-5 cs

celery_queues celery_queues

New in version 3.7.

Displays length of Celery task queues.

changesite changesite

New in version 2.4.

You can use this to change or display site name from command line without using admin interface.

--set-name NAME

Sets name for the site.


Prints currently configured site name.

checkgit checkgit <project|project/component>

Prints current state of the backend git repository.

You can either define which project or component to update (eg. weblate/master) or use --all to update all existing components.

commitgit commitgit <project|project/component>

Commits any possible pending changes to backend git repository.

You can either define which project or component to update (eg. weblate/master) or use --all to update all existing components.

commit_pending commit_pending <project|project/component>

Commits pending changes older than given age.

You can either define which project or component to update (eg. weblate/master) or use --all to update all existing components.

--age HOURS

Age in hours for committing. If not specified value configured in Component configuration is used.


This is automatically perfomed in the background by Weblate, so there is not much reason to invoke this manually besides forcing earlier commit than specified by Component configuration.


New in version 3.1. cleanup_avatar_cache

Removes invalid items in avatar cache. This can be useful when switching between Python 2 and 3 as the cache files might be not compatible.

cleanuptrans cleanuptrans

Cleanups orphaned checks and translation suggestions. This is normally not needed to execute manually, the cleanups happen automatically in the background.

createadmin createadmin

Creates admin account with random password unless it is specified.

--password PASSWORD

Provide password on the command line and skip generating random one.


Do not set password, this can be useful with –update.

--username USERNAME

Use given name instead of admin.


Specify admin e-mail.


Specify admin name (visible).


Update existing user (you can use this to change password).

Changed in version 2.9: Added parameters --username, --email, --name and --update.

delete_memory delete_memory

New in version 2.20.

Deletes entries in the Weblate Translation Memory.

--origin ORIGIN

Origin to delete, for imported files the origin is filename without path.


Delete complete memory content and recreate the database.

dump_memory dump_memory

New in version 2.20.

Export a JSON file with the Weblate Translation Memory content.

dumpuserdata dumpuserdata <file.json>

Dumps userdata to file for later use by importuserdata

This is useful when migrating or merging Weblate instances.

import_json import_json <json-file>

New in version 2.7.

Batch import of components based on JSON data.

The imported JSON file structure pretty much corresponds to the component object (see GET /api/components/(string:project)/(string:component)/). You always have to include fields name and filemask.

--project PROJECT

Specifies where the components will be imported.

--main-component COMPONENT

Use VCS repository from this component for all.


Skip already imported components.


Update already imported components.

Changed in version 2.9: Added parameters --ignore and --update to deal with already imported components.

Example of JSON file:

        "slug": "po",
        "name": "Gettext PO",
        "file_format": "po",
        "filemask": "po/*.po",
        "new_lang": "none"
        "name": "Android",
        "filemask": "android/values-*/strings.xml",
        "template": "android/values/strings.xml",
        "repo": "weblate://test/test",
        "file_format": "aresource"

See also


import_memory import_memory <file>

New in version 2.20.

Imports a TMX or JSON file into the Weblate Translation Memory.

--language-map LANGMAP

Allows to map languages in the TMX to Weblate one. The language codes are mapped after normalization usually done by Weblate.

For example --language-map en_US:en will import all en_US strings as en ones.

This can be useful in case your TMX file locales does not match what you use in Weblate.

import_project import_project <project> <gitrepo> <branch> <filemask>

Changed in version 3.0: The import_project command is now based on the Component discovery addon and that has lead to some changes in behavior and accepted parameters.

Batch imports components into project based on file mask.

<project> names an existing project, into which the components should be imported.

The <gitrepo> defines URL of Git repository to use, and <branch> the git branch. To import additional translation components, from an existing Weblate component, use a weblate://<project>/<component> URL for the <gitrepo>.

The <filemask> defines files discovery in the repository. It can be either simple using wildcards or it can use full power of regular expressions.

The simple matching uses ** for component name and * for language, for example: **/*.po

The regular expression has to contain named groups component and language. For example: (?P<language>[^/]*)/(?P<component>[^-/]*)\.po

The import matches existing components based on files and adds the ones which do not exist. It does no changes to the already existing ones.

--name-template TEMPLATE

Customize the component’s name, using Django template syntax.

For example: Documentation: {{ component }}

--base-file-template TEMPLATE

Customize base file for monolingual translations.

For example: {{ component }}/res/values/string.xml

--new-base-template TEMPLATE

Customize base file for adding new translations.

For example: {{ component }}/ts/en.ts

--file-format FORMAT

You can also specify file format to use (see Supported file formats), the default is autodetection.

--language-regex REGEX

You can specify language filtering (see Component configuration) by this parameter. It has to be valid regular expression.


You can specify which component will be chosen as main - the one actually containing VCS repository.

--license NAME

Specify translation license.

--license-url URL

Specify translation license URL.

--vcs NAME

In case you need to specify version control system to use, you can do it here. The default version control is Git.

To give you some examples, let’s try importing two projects.

As first we import The Debian Handbook translations, where each language has separate folder with translations of each chapter:

./ import_project \
    debian-handbook \
    git:// \
    squeeze/master \

Another example can be Tanaguru tool, where we need to specify file format, base file template and has all components and translations located in single folder:

./ import_project \
    --file-format=properties \
    --base-file-template=web-app/tgol-web-app/src/main/resources/i18n/ \
    tanaguru \ \
    master \

Example of more complex parsing of filenames to get correct component and language out of filename like src/security/

./ import_project \
    tails \
    git:// master \

Filtering only translations in chosen language:

./manage import_project \
    --language-regex '^(cs|sk)$' \
    weblate \ \

See also

More detailed examples can be found in the Starting with internationalization chapter, alternatively you might want to use import_json.

importuserdata importuserdata <file.json>

Imports userdata from file created by dumpuserdata

importusers importusers --check <file.json>

Imports users from JSON dump of Django auth_users database.


With this option it will just check whether given file can be imported and report possible conflicts on usernames or e-mails.

You can dump users from existing Django installation using:

./ dumpdata auth.User > users.json


New in version 3.2. install_addon --addon ADDON <project|project/component>

Installs addon to set of components.

--addon ADDON

Name of addon to install. For example weblate.gettext.customize.

--configuration CONFIG

JSON encoded configuration of an addon.


Update existing addon configuration.

You can either define on which project or component to install addon (eg. weblate/master) or use --all to include all existing components.

For example installing Customize gettext output to all components:

./ install_addon --addon weblate.gettext.customize --config '{"width": -1}' --update --all

See also


list_ignored_checks list_ignored_checks

Lists most frequently ignored checks. This can be useful for tuning your setup, if users have to ignore too many of consistency checks.

list_languages list_languages <locale>

Lists supported language in MediaWiki markup - language codes, English names and localized names.

This is used to generate <>.

list_memory list_memory

New in version 2.20.

Lists contents of the Weblate Translation Memory.

--type {origin}

Type of information to list, defaults to listing used origins.

list_translators list_translators <project|project/component>

Renders the list of translators by language for the given project:

Jean Dupont <>
John Doe <>

Use language code instead of language name in output.

You can either define which project or component to use (eg. weblate/master) or use --all to list translators from all existing components.

list_versions list_versions

Lists versions of Weblate dependencies.

loadpo loadpo <project|project/component>

Reloads translations from disk (eg. in case you did some updates in VCS repository).


Force update even if the files should be up to date.


Limit processing to single language.

You can either define which project or component to update (eg. weblate/master) or use --all to update all existing components.


You seldom need to invoke this, Weblate will automatically load changed files on VCS update. This is needed in case you manually change underlying Weblate VCS repository or in some special cases after upgrade.

lock_translation lock_translation <project|project/component>

Locks given component for translating. This is useful in case you want to do some maintenance on underlying repository.

You can either define which project or component to update (eg. weblate/master) or use --all to update all existing components.

move_language move_language source target

New in version 3.0.

Allows you to merge language content. This is useful when updating to new version which contains aliases for previously unknown languages which were created with the (generated) suffix. It moves all content from the source language to target one.


./ move_language cze cs

After moving the content, you should review if there is nothing left (this is subject to race conditions when somebody updates the repository meanwhile) and remove the (generated) language.

optimize_memory optimize_memory

New in version 3.2.

Optimizes translation memory storage.


The index will be completely rebuilt by dumping all content and creating it again. It is recommended to backup it prior to this operation.

pushgit pushgit <project|project/component>

Pushes committed changes to upstream VCS repository.


Force committing any pending changes prior to push.

You can either define which project or component to update (eg. weblate/master) or use --all to update all existing components.


Weblate does push changes automatically if Push on commit in Component configuration is enabled, what is default.

rebuild_index rebuild_index <project|project/component>

Rebuilds index for fulltext search. This might be lengthy operation if you have a huge set of translation strings.


Removes all words from database prior updating, this is implicit when called with --all.


The index will not be processed again, only its content will be optimized (removing stale entries and merging possibly split index files).

See also

Fulltext search

unlock_translation unlock_translation <project|project/component>

Unlocks a given component for translating. This is useful in case you want to do some maintenance on the underlying repository.

You can either define which project or component to update (eg. weblate/master) or use --all to update all existing components.

See also


setupgroups setupgroups

Configures default groups and optionally assigns all users to default group.


Disables update of existing groups (only adds new ones).


Prevents updates of groups for existing projects. This allows to add newly added groups to existing projects, see Per project access control.

See also

Access control

setuplang setuplang

Updates list of defined languages in Weblate.


Disables update of existing languages (only adds new ones).

updatechecks updatechecks <project|project/component>

Updates all check for all strings. This could be useful only on upgrades which do major changes to checks.

You can either define which project or component to update (eg. weblate/master) or use --all to update all existing components.

updategit updategit <project|project/component>

Fetches remote VCS repositories and updates internal cache.

You can either define which project or component to update (eg. weblate/master) or use --all to update all existing components.


Usually it is better to configure hooks in the repository to trigger Notification hooks instead of regular polling by updategit.