Help:Extension:Translate/Command line scripts

Jump to navigation Jump to search
This documentation is partly outdated and is missing many scripts.

Translate extension has many command line scripts which facilitate heavy processing that is not possible through the web interface. Each script has a --help switch that shows the exact syntax and supported parameters. This page is an overview of the purpose of each script. These scripts can be found at Translate/scripts. If the Translate extension is installed into nonstandard location, you must define MW_INSTALL_PATH environment variable that points to root of the MediaWiki installation.

export.php is the most important script for most setups. It allows exporting translated messages into filesystem. The output path structure and file formats vary between different message groups. It has --threshold parameter, which takes a completion percentage that must be met for a language to be exported. Languages which have less than the given percentage of messages translated in a group are ignored. This switch increases the export time considerably.
This is a command line variant of Special:ImportTranslations, which can be used to import large changes in one go.
This script is used to mark translated outdated = fuzzying. It takes a message name and fuzzies all translations. It's the only way for old-style message groups and can also be used with new-style message groups.
This command line script can be used to create almost any kind of completion statistics table. Special:LanguageStats shows the percentages for all groups in one language, but with this script you can make table with completion percentages in all languages for one ore more message groups. You need an another script to import the script output into MediaWiki.
For old-style message groups which do not have web interface, this is the script which looks for changes and imports them into the wiki. It can also be used with new-style message groups, but not recommended.
Run this script to create and populate the translation memory. Hooks in the extension will take care of adding new translation into the translation memory database.
This script creates a mapping from each message key to the groups it belongs to. This information is used in many places, for example in the statistics features. Usually this task is triggered automatically. Running it manually may fix inconsistent things.