We should automate some of the checks that people perform during i18n review of our code.
Below I've included one by Erik Bernhardson that checks for missing i18n documentation.[2] The maintenance/language directory has several check* scripts[1]; I couldn't get its checkExtension.php to run, it references a $wgTranslateAC that was removed from extension Translate in 4651bd97f.
[1] https://git.wikimedia.org/tree/mediawiki%2Fcore/HEAD/maintenance%2Flanguage
[2] This is in the form of a git hook but I hope it's straightforward to turn it into a Jenkins job. (Its assumption that MyExtension has a MyExtension.i18n.php file is true for 150 of the 180 extensions I have locally.)
In .git/hooks/pre-review put the following:
#!/usr/bin/env php <?php // This file must have the executable flag set to work as a hook // A hooks path is always /path/to/repo/.git/hooks/hook-name $repo = dirname( dirname( dirname( realpath( $argv[0] ) ) ) ); include "$repo/Flow.i18n.php"; $missing = array_diff( array_keys( $messages['en'] ), array_keys( $messages['qqq'] ) ); if ( $missing ) { echo "Missing i18n messages:\n\t" . implode( "\n\t", $missing ) . "\n"; exit( 1 ); }
chmod +x the new file.
Version: unspecified
Severity: enhancement