Last modified: 2014-11-17 09:21:33 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T57456, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55456 - run i18n message checks in Jenkins (tracking)
run i18n message checks in Jenkins (tracking)
Status: NEW
Product: Wikimedia
Classification: Unclassified
Continuous integration (Other open bugs)
unspecified
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
: tracking
Depends on: 64045 61509
Blocks: tracking
  Show dependency treegraph
 
Reported: 2013-10-08 04:05 UTC by spage
Modified: 2014-11-17 09:21 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description spage 2013-10-08 04:05:50 UTC
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.
Comment 1 Santhosh Thottingal 2013-10-08 04:15:41 UTC
Also note that sometimes an extension will have multiple i18n files. Eg: Translate
Comment 2 Antoine "hashar" Musso (WMF) 2013-11-13 20:15:14 UTC
I did something like that with https://gerrit.wikimedia.org/r/#/c/5550/  it is failing though.  Feel free to take over that patch or fix it up.
Comment 3 Antoine "hashar" Musso (WMF) 2014-04-18 12:21:31 UTC
Bug 61509 was requesting such feature for mediawiki core and it has been fixed (via a grunt task invoking "banana" checker).

For the other repositories we need to integrate the javascript banana checker and write the appropriate Jenkins jobs, that is bug 64045.


Making this bug a tracking bug and setting appropriate blockers.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links