Commandes de gestion¶
Note
L’exécution de commandes de gestion avec un utilisateur différent de celui qui exécute votre serveur Web peut entraîner l’attribution de permissions incorrectes aux fichiers ; consultez Permissions du système de fichiers pour plus de détails.
Vous trouverez les commandes de gestion de base (disponibles sous forme de ./manage.py dans les sources Django, ou sous forme d’un ensemble étendu dans un script appelé weblate, installable sur Weblate).
Appel des commandes de gestion¶
Comme indiqué précédemment, l’appel dépend de la manière dont vous avez installé Weblate.
If using a Python environment for Weblate, you can either specify the full path to weblate, or activate the Python environment prior to invoking it:
# Direct invocation
~/weblate-env/bin/weblate
# Activating Python environment adds it to search path
. ~/weblate-env/bin/activate
weblate
Si vous utilisez directement le code source (depuis une archive tarball ou une copie Git), le script de gestion ./manage.py est disponible dans les sources Weblate. Pour l’exécuter :
python ./manage.py list_versions
If you’ve installed Weblate using the pip installer, or by using the ./setup.py
script, the weblate is installed to your path (or Python environment path),
from where you can use it to control Weblate:
weblate list_versions
Pour l’image Docker, le script est installé comme indiqué ci-dessus, et vous pouvez l’exécuter à l’aide de docker exec :
docker exec --user weblate <container> weblate list_versions
For docker-compose-plugin the process is similar, you just have to use docker compose exec:
docker compose exec --user weblate weblate weblate list_versions
Si vous devez lui transmettre un fichier, vous pouvez ajouter temporairement un volume :
docker compose exec --user weblate /tmp:/tmp weblate weblate importusers /tmp/users.json
add_suggestions¶
- weblate add_suggestions <project> <component> <language> <file>¶
Imports a translation from the file to use as a suggestion for the given translation. It skips duplicated translations; only different ones are added.
- --author USER@EXAMPLE.COM¶
E-mail of author for the suggestions. This user has to exist prior to importing (you can create one in the admin interface if needed).
Exemple :
weblate --author michal@cihar.com add_suggestions weblate application cs /tmp/suggestions-cs.po
analyze_translator_work¶
- weblate analyze_translator_work¶
Analyzes change history to estimate realistic translator throughput per day. The command includes only active human users and unit-backed manual translation changes, and applies daily minimum and maximum thresholds to skip obvious outliers, bots, bulk imports, uploads, and other events that would pollute the result.
- --days DAYS¶
Number of recent days to analyze when
--sinceis not specified.
- --since YYYY-MM-DD¶
Start date for the analysis.
- --until YYYY-MM-DD¶
End date for the analysis.
- --project PROJECT¶
Limit the analysis to a project slug.
- --component PROJECT/COMPONENT¶
Limit the analysis to a component.
- --language LANGUAGE¶
Limit the analysis to a language code.
- --min-changes COUNT¶
Minimum translated strings per user day to include.
- --max-changes COUNT¶
Maximum translated strings per user day to include.
- --max-words COUNT¶
Maximum translated source words per user day to include.
Exemple :
weblate analyze_translator_work --project weblate --since 2026-01-01
auto_translate¶
- weblate auto_translate <project> <component> <language>¶
Modifié dans la version 4.6: Ajouter un paramètre pour le mode de traduction.
Effectue une traduction automatique basée sur les traductions d’autres composants.
- --source PROJECT/COMPONENT¶
Specifies the component to use as source available for translation. If not specified all components in the project are used.
- --user USERNAME¶
Specify username listed as author of the translations. « Anonymous user » is used if not specified.
- --overwrite¶
Whether to overwrite existing translations.
- --inconsistent¶
Whether to overwrite existing translations that are inconsistent (see Incohérence).
- --add¶
Automatically add language if a given translation does not exist.
- --mt MT¶
Use machine translation instead of other components as machine translations.
- --threshold THRESHOLD¶
Similarity threshold for machine translation, defaults to 80.
- --mode MODE¶
Specify translation mode, default is
translatebutfuzzyorsuggestcan be used.
Exemple :
weblate auto_translate --user nijel --inconsistent --source weblate/application weblate website cs
Voir aussi
backup¶
- weblate backup¶
Runs configured backups synchronously, without using Celery. It first updates
the settings and database backup dumps in DATA_DIR, then runs the
selected Borg backup service or services.
- --list¶
Lists configured backup service IDs.
- --service ID¶
Runs one backup service by ID.
- --all¶
Runs all enabled backup services.
Use Django’s standard --verbosity 2 option to show backup service output.
Failed backup service output is shown even without increased verbosity.
Exemples :
weblate backup --list
weblate backup --service 1 --verbosity 2
weblate backup --all
For Docker Compose deployments, you can stop the regular Weblate container and run the command in a one-off container using docker compose run. The database and configured backup storage still need to be available.
docker compose stop weblate
docker compose run --rm --user weblate weblate weblate backup --list
docker compose run --rm --user weblate weblate weblate backup --service 1 --verbosity 2
Voir aussi
benchmark¶
- weblate benchmark¶
Imports given content into Weblate, useful for benchmarking.
# Run benchmark with a profiling
python -m cProfile -o benchmark.prof ./manage.py benchmark --project benchmark --filemask '*.tbx' --format tbx --zipfile /tmp/MicrosoftTermCollection2.zip
# Convert to SVG for visualization
uvx gprof2dot -f pstats benchmark.prof | dot -Tsvg -o benchmark.svg
# Display SVG
firefox ./benchmark.svg
# Run benchmark under memray
uvx memray run ./manage.py benchmark --project benchmark --filemask '*.tbx' --format tbx --zipfile /tmp/MicrosoftTermCollection2.zip
# Render the profile
uvx memray flamegraph ./memray-manage.py.2554179.bin
# Display it
fixefox memray-flamegraph-manage.py.2554179.html
billing_demo¶
- weblate billing_demo¶
Ajouté dans la version 5.15.
Creates a demo billing project. Can be executed multiple times to add additional invoices and billing events.
This can be useful when developing Weblate. Needs Facturation installed.
celery_queues¶
- weblate celery_queues¶
Affiche la longueur des files d’attente de tâches Celery.
Voir aussi
checkgit¶
- weblate checkgit <project|project/component>¶
Prints current state of the back-end Git repository.
Vous pouvez définir soit le projet soit le composant à mettre à jour (par exemple weblate/application), soit utiliser --all pour mettre à jour tous les composants existants.
commitgit¶
- weblate commitgit <project|project/component>¶
Valide toutes les modifications éventuellement en attente dans le dépôt Git du back-end.
You can either define which project or component to update (for example
weblate/application), or use --all to update all existing components,
or use --file-format to filter based on the file format.
commit_pending¶
- weblate commit_pending <project|project/component>¶
Valide les modifications en attente datant de plus longtemps qu’une durée donnée.
Vous pouvez définir soit le projet soit le composant à mettre à jour (par exemple weblate/application), soit utiliser --all pour mettre à jour tous les composants existants.
- --age HOURS¶
Age in hours for committing. If not specified the value configured in Configuration des composants is used.
Note
This is automatically performed in the background by Weblate, so there no real need to invoke this manually, besides forcing an earlier commit than specified by Configuration des composants.
cleanuptrans¶
- weblate cleanuptrans¶
Nettoie les vérifications orphelines et les suggestions de traduction. En général, il n’est pas nécessaire de l’exécuter manuellement, car les nettoyages s’effectuent automatiquement en arrière-plan.
Voir aussi
cleanup_memory¶
- weblate cleanup_memory¶
Ajouté dans la version 5.13.
Removes all obsolete entries with pending status from the translation memory.
cleanup_ssh_keys¶
- weblate cleanup_ssh_keys¶
Ajouté dans la version 4.9.1.
Performs cleanup of stored SSH host keys:
Removes deprecated RSA keys for GitHub which might cause issues connecting to GitHub.
Removes duplicate entries in host keys.
Voir aussi
createadmin¶
- weblate createadmin¶
Crée un compte admin avec un mot de passe aléatoire, sauf si celui-ci est spécifié.
- --password PASSWORD¶
Provides a password on the command-line, to not generate a random one.
- --no-password¶
Do not set password, this can be useful with –update.
- --username USERNAME¶
Use the given name instead of
admin.
- --email USER@EXAMPLE.COM¶
Specify the admin e-mail address.
- --name¶
Specify the admin name (visible).
- --update¶
Update the existing user (you can use this to change passwords).
dump_memory¶
- weblate dump_memory¶
Exporter un fichier JSON contenant le contenu de la mémoire de traduction Weblate.
dumpuserdata¶
- weblate dumpuserdata <file.json>¶
Vide les données utilisateur dans un fichier pour une utilisation ultérieure par importuserdata.
Indication
Cela devient pratique lorsque vous migrez ou fusionnez des instances Weblate.
import_demo¶
- weblate import_demo¶
Ajouté dans la version 4.1.
Creates a demo project with components based on <https://github.com/WeblateOrg/demo>. Make sure the celery tasks are running before running this command.
Ceci peut être utile lors du développement de Weblate.
- --delete¶
Removes existing demo project.
import_json¶
- weblate import_json <json-file>¶
Importation par lot des composants basés sur les données JSON.
La structure du fichier JSON importé correspond d’assez près à l’objet du composant (voir GET /api/components/(string:project)/(string:component)/). Vous devez inclure les champs name et filemask.
- --project PROJECT¶
Specifies where the components will be imported from.
- --main-component COMPONENT¶
Use the given VCS repository from this component for all of them.
- --ignore¶
Skip (already) imported components.
- --update¶
Update (already) imported components.
Exemple de fichier JSON :
[
{
"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"
}
]
Voir aussi
import_memory¶
- weblate import_memory <file>¶
Imports a file into the Weblate translation memory.
Supported file formats are TMX, JSON, XLIFF, PO, CSV.
Specifying a source and a target languages might be necessary for formats other than JSON and TMX.
- --language-map LANGMAP¶
Allows mapping languages in the TMX to the Weblate translation memory. The language codes are mapped after normalization usually done by Weblate.
--language-map en_US:enwill for example import allen_USstrings asenones.This can be useful in case your TMX file locales happen not to match what you use in Weblate.
- --source-language SOURCE_LANG¶
Specifies the source language for imported translations. Typically needed for formats where the languages cannot be determined from the file itself.
- --target-language TARGET_LANG¶
Specifies the target language for imported translations. Typically needed for formats where the languages cannot be determined from the file itself.
import_project¶
- weblate import_project <project> <gitrepo> <branch> <filemask>¶
Batch imports components into project based on the file mask. It is based on the Découverte du composant add-on, so you might want to use that instead.
<project> désigne un projet existant, dans lequel les composants doivent être importés.
La balise <gitrepo> définit l’URL du dépôt Git à utiliser, et <branch> désigne la branche Git. Pour importer des composants de traduction supplémentaires depuis un composant Weblate existant, utilisez une URL weblate://<project>/<component> pour <gitrepo>.
<filemask> définit la découverte de fichiers pour le dépôt. Elle peut être simplifiée à l’aide de caractères génériques, ou utiliser toute la puissance des expressions rationnelles.
La correspondance simple utilise ** pour le nom du composant et * pour la langue, par exemple : **/*.po
The regular expression has to contain groups named component and language,
for example: (?P<language>[^/]*)/(?P<component>[^-/]*)\.po.
L’importation établit une correspondance entre les composants existants en fonction des fichiers et ajoute ceux qui n’existent pas. Elle ne modifie pas ceux qui existent déjà.
- --name-template TEMPLATE¶
Customize the name of a component using Django template syntax.
For example:
Documentation: {{ component }}
- --base-file-template TEMPLATE¶
Customize the base file for monolingual translations.
For example:
{{ component }}/res/values/string.xml
- --new-base-template TEMPLATE¶
Customize the base file for addition of new translations.
For example:
{{ component }}/ts/en.ts
- --file-format FORMAT¶
You can also specify the file format to use (see Localization file formats), the default is auto-detection.
- --language-regex REGEX¶
You can specify language filtering (see Configuration des composants) with this parameter. It has to be a valid regular expression.
- --main-component¶
You can specify which component will be chosen as the main one—the one actually containing the VCS repository.
- --license NAME¶
Specify the overall, project or component translation license.
- --license-url URL¶
Specify the URL where the translation license is to be found.
- --vcs NAME¶
In case you need to specify which version control system to use, you can do it here. The default version control is Git.
Pour vous donner quelques exemples, essayons d’importer deux projets.
D’abord les traductions du manuel Debian où chaque langue possède un répertoire séparé avec les traductions de chaque chapître :
weblate import_project \
debian-handbook \
https://salsa.debian.org/hertzog/debian-handbook.git \
bullseye/main \
'*/**.po'
Puis l’outil Tanaguru, où le format du fichier doit être spécifié en même temps que le modèle du fichier de base et la manière dont tous les composants et les traductions sont répartis dans un même répertoire :
weblate import_project \
--file-format=properties \
--base-file-template=web-app/tgol-web-app/src/main/resources/i18n/%s-I18N.properties \
tanaguru \
https://github.com/Tanaguru/Tanaguru \
master \
web-app/tgol-web-app/src/main/resources/i18n/**-I18N_*.properties
Exemple plus élaboré de l’analyse syntaxique des noms de fichiers permettant d’obtenir le composant correct ainsi que la langue à partir d’un nom de fichier tel que src/security/Numerous_security_holes_in_0.10.1.de.po :
weblate import_project \
tails \
git://git.tails.boum.org/tails master \
'wiki/src/security/(?P<component>.*)\.(?P<language>[^.]*)\.po$'
Filtrer uniquement les traductions pour une seule langue :
./manage import_project \
--language-regex '^(cs|sk)$' \
weblate \
https://github.com/WeblateOrg/weblate.git \
'weblate/locale/*/LC_MESSAGES/**.po'
Importer la documentation Sphinx répartie sur plusieurs fichiers :
$ weblate import_project --name-template 'Documentation: %s' \
--file-format po \
project https://github.com/project/docs.git master \
'docs/locale/*/LC_MESSAGES/**.po'
Importer la documentation Sphinx répartie sur plusieurs fichiers et répertoires :
$ weblate import_project --name-template 'Directory 1: %s' \
--file-format po \
project https://github.com/project/docs.git master \
'docs/locale/*/LC_MESSAGES/dir1/**.po'
$ weblate import_project --name-template 'Directory 2: %s' \
--file-format po \
project https://github.com/project/docs.git master \
'docs/locale/*/LC_MESSAGES/dir2/**.po'
Voir aussi
Vous trouverez d’autres exemples plus détaillés dans le chapître Starting with internationalization , mais vous pouvez aussi utiliser import_json.
import_projectbackup¶
- weblate import_projectbackup <project_name> <project_slug> <username> <filename>¶
Ajouté dans la version 5.10.
Imports Sauvegarde au niveau Projet.
Indication
Usually it is more comfortable to import project when Ajouter des projets et des composant de traduction.
importuserdata¶
- weblate importuserdata <file.json>¶
Importe les données utilisateur à partir d’un fichier créé par dumpuserdata.
importusers¶
- weblate importusers --check <file.json>¶
Importe les utilisateurs à partir d’un dump JSON de la base de données Django auth_users .
- --check¶
With this option it will just check whether a given file can be imported and report possible conflicts arising from usernames or e-mails.
You can dump users from the existing Django site using:
./manage.py dumpdata auth.User > users.json
Indication
Use dumpuserdata for dumping data from other Weblate server as that includes user settings as well.
Voir aussi
install_addon¶
- weblate install_addon --addon ADDON <project|project/component>¶
Installe une greffon sur un ensemble de composants.
- --addon ADDON¶
Name of the add-on to install. For example
weblate.gettext.customize.
- --configuration CONFIG¶
JSON encoded configuration of an add-on.
- --update¶
Update the existing add-on configuration.
Vous pouvez soit définir le projet ou le composant dans lequel installer le greffon (par exemple weblate/application), ou utiliser --all pour inclure tous les composants existants.
To install Générer des fichiers MO for all components:
weblate install_addon --addon weblate.gettext.mo --configuration '{"fuzzy": true}' --update --all
Voir aussi
install_machinery¶
Ajouté dans la version 4.18.
- weblate install_machinery --service SERVICE¶
Installs a site-wide automatic suggestion service.
- --service SERVICE¶
Name of the service to install. For example
deepl.
- --configuration CONFIG¶
JSON encoded configuration of a service.
- --update¶
Update the existing service configuration.
Pour installer DeepL :
weblate install_machinery --service deepl --configuration '{"key": "x", "url": "https://api.deepl.com/"}' --update
Voir aussi
list_addons¶
- weblate list_addons¶
Lists add-ons in reStructuredText as a template for Extensions.
- --sections {events,addons,parameters}¶
Filter the generated output to just the add-on event sections, the built-in add-on sections, or the shared add-on parameter sections. If omitted, all generated sections are shown.
Voir aussi
list_permissions¶
- weblate list_permissions¶
Lists permissions in reStructuredText as a template for Contrôle d’accès.
Voir aussi
list_checks¶
- weblate list_checks¶
Lists quality checks in reStructuredText as a template for Contrôles de qualité et corrections and Contrôles de qualité et corrections.
- --sections {checks,flags}¶
Filter the generated output to just the quality check sections or the shared check flag sections. If omitted, all generated sections are shown.
Note
Using --output requires selecting exactly one value in --sections so
each generated snippet is written to its own file. This matches the
Contribuer à la documentation de Weblate workflow and the make -C docs
update-docs targets.
Voir aussi
list_languages¶
- weblate list_languages <locale>¶
Liste les langues prises en charge dans le balisage MediaWiki - codes de langue, noms anglais et noms traduits.
This is used to generate <https://www.l10n.cz/wiki/Slovn%C3%ADky/Slovn%C3%ADk_s_n%C3%A1zvy_jazyk%C5%AF/>.
list_machinery¶
- weblate list_machinery¶
Lists automatic suggestions services in reStructuredText as a template for Suggestions automatiques.
Voir aussi
list_translators¶
- weblate list_translators <project|project/component>¶
Liste les traducteurs en fonction de la langue à laquelle ils ont contribué pour le projet donné :
[French]
Jean Dupont <jean.dupont@example.com>
[English]
John Doe <jd@example.com>
- --language-code¶
List names by language code instead of language name.
Vous pouvez définir soit le projet ou le composant à utiliser (par exemple weblate/application), ou utiliser --all pour lister les traducteurs de tous les composants existants.
list_versions¶
- weblate list_versions¶
Répertorie toutes les dépendances de Weblate et leurs versions.
list_file_format_params¶
- weblate list_file_format_params¶
Lists File format parameters.
list_change_events¶
- weblate list_change_events¶
Lists all possible change event types.
list_format_features¶
- weblate list_format_features¶
Generates RST documentation snippets describing the supported features for every file format.
The command generates one file for every format, that can be found in the specified output directory.
- --output PATH¶
Directory where the format feature snippets will be written.
Note
The generated documentation files are meant to be included in documentation sources such as Localization file formats. See also weblate/formats/management/commands/list_format_features.py for customization and merging logic.
loadpo¶
- weblate loadpo <project|project/component>¶
Recharge les traductions depuis le disque (par exemple si vous avez effectué des mises à jour dans le dépôt du système de contrôle des versions).
- --force¶
Force update, even if the files should be up-to-date.
- --lang LANGUAGE¶
Limit processing to a single language.
Vous pouvez définir soit le projet soit le composant à mettre à jour (par exemple weblate/application), soit utiliser --all pour mettre à jour tous les composants existants.
Note
Vous devez rarement appeler cette commande ; Weblate charge automatiquement les fichiers modifiés lors de chaque mise à jour du système de contrôle des versions. Elle est nécessaire si vous avez modifié manuellement un dépôt Weblate sous-jacent du système de contrôle des versions ou, dans certains cas particuliers, après une mise à niveau.
lock_translation¶
- weblate lock_translation <project|project/component>¶
Empêche toute traduction ultérieure d’un composant.
Indication
Utile si vous souhaitez effectuer une opération de maintenance sur le dépôt sous-jacent.
Vous pouvez définir soit le projet soit le composant à mettre à jour (par exemple weblate/application), soit utiliser --all pour mettre à jour tous les composants existants.
Voir aussi
metrics¶
- weblate metrics¶
Outputs the server metrics exposed by GET /api/metrics/.
- --format FORMAT¶
Selects the output format. Supported formats are
json,csv, andopenmetrics. The default isjson.
migrate¶
- weblate migrate¶
Migrates database to current Weblate schema. The command line options are
described at Django migrate.
Indication
In case you want to run an installation non interactively, you can use
weblate migrate --noinput, and then create an admin user using
createadmin command.
Voir aussi
move_language¶
- weblate move_language source target¶
Allows you to merge language content. This is useful when updating to a new
version which contains aliases for previously unknown languages that have been
created with the (generated) suffix. It moves all content from the source
language to the target one.
Exemple :
weblate move_language cze cs
After moving the content, you should check whether there is anything left (this is
subject to race conditions when somebody updates the repository meanwhile) and
remove the (generated) language.
pushgit¶
- weblate pushgit <project|project/component>¶
Pousse les modifications validées vers le dépôt amont du système de contrôle des versions.
- --force-commit¶
Force commits any pending changes, prior to pushing.
Vous pouvez définir soit le projet soit le composant à mettre à jour (par exemple weblate/application), soit utiliser --all pour mettre à jour tous les composants existants.
Note
Weblate pushes changes automatically if Pousser lors du commit in Configuration des composants is turned on, which is the default.
unlock_translation¶
- weblate unlock_translation <project|project/component>¶
Déverrouille un composant donné, le rendant disponible pour la traduction.
Indication
Utile si vous souhaitez effectuer une opération de maintenance sur le dépôt sous-jacent.
Vous pouvez définir soit le projet soit le composant à mettre à jour (par exemple weblate/application), soit utiliser --all pour mettre à jour tous les composants existants.
Voir aussi
setupgroups¶
- weblate setupgroups¶
Configure les groupes par défaut et ajoute optionnellement tous les utilisateurs à ce groupe.
- --no-privs-update¶
Turns off automatic updating of existing groups (only adds new ones).
- --no-projects-update¶
Prevents automatic updates of groups for existing projects. This allows adding newly added groups to existing projects, see Contrôle d’accès au projet.
Voir aussi
setuplang¶
- weblate setuplang¶
Met à jour la liste des langues définies dans Weblate.
- --no-update¶
Turns off automatic updates of existing languages (only adds new ones).
updatechecks¶
- weblate updatechecks <project|project/component>¶
Met à jour toutes les vérifications pour toutes les chaînes.
Indication
Utile pour les mises à niveau qui apportent des modifications importantes aux vérifications.
Vous pouvez définir soit le projet soit le composant à mettre à jour (par exemple weblate/application), soit utiliser --all pour mettre à jour tous les composants existants.
Note
Checks are recalculated regularly by Weblate in the background, the frequency
can be configured via BACKGROUND_TASKS.
updategit¶
- weblate updategit <project|project/component>¶
Récupère les dépôts distants du système de contrôle des versions et met à jour le cache interne.
Vous pouvez définir soit le projet soit le composant à mettre à jour (par exemple weblate/application), soit utiliser --all pour mettre à jour tous les composants existants.
Note
Usually it is better to configure hooks in the repository to trigger
Déclencheurs de notification, instead of regular triggering the updates by updategit.