This git hook checks that there's a qqq message for every English message. With a little enhancement it could be generalized to most extensions.
Can someone add a test like this to Jenkins? Would it go in < https://git.wikimedia.org/blob/integration%2Fjenkins-job-builder-config.git/...
---------- Forwarded message ---------- From: Erik Bernhardson ebernhardson@wikimedia.org Date: Wed, Oct 2, 2013 at 10:36 AM Subject: [E2] i18n messages To: E2 development team e2@lists.wikimedia.org
I've noticed a recurrence of git reviews about missing i18n documentation, to help solve these up front we could add a hook to git review (or git commit if you prefer) that checks this at a basic level for us.
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, and anytime you do a git review with missing qqq it should say:
git review Custom script execution failed. The following command failed with exit code 255
"/home/guy/Jobs/mediawiki/vagrant/mediawiki/extensions/Flow/.git/hooks/pre-review" ----------------------- Missing i18n messages: flow-post-action-censor-post
-----------------------
Relatedly, there is a new patch in gerrit to fix that missing message that made it through review.
Erik B.
_______________________________________________ E2 mailing list E2@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/e2
This is awesome. Kudos to Erik for the suggestion! On 7 Oct 2013 12:26, "S Page" spage@wikimedia.org wrote:
This git hook checks that there's a qqq message for every English message. With a little enhancement it could be generalized to most extensions.
Can someone add a test like this to Jenkins? Would it go in < https://git.wikimedia.org/blob/integration%2Fjenkins-job-builder-config.git/...
---------- Forwarded message ---------- From: Erik Bernhardson ebernhardson@wikimedia.org Date: Wed, Oct 2, 2013 at 10:36 AM Subject: [E2] i18n messages To: E2 development team e2@lists.wikimedia.org
I've noticed a recurrence of git reviews about missing i18n documentation, to help solve these up front we could add a hook to git review (or git commit if you prefer) that checks this at a basic level for us.
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, and anytime you do a git review with missing qqq it should say:
git review Custom script execution failed. The following command failed with exit code 255
"/home/guy/Jobs/mediawiki/vagrant/mediawiki/extensions/Flow/.git/hooks/pre-review"
Missing i18n messages: flow-post-action-censor-post
Relatedly, there is a new patch in gerrit to fix that missing message that made it through review.
Erik B.
E2 mailing list E2@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/e2
-- =S Page Features engineer
QA mailing list QA@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/qa
I'm very pro this conversation! Especially because it part of an item in my 2013-2014 roadmap for Language Engineering. Everything that I don't have to plan explicitly, and pops up grass root, I support. So +1!
Here's what is in the LangEng engineering roadmap document about this feature: ---
All Wikimedia website software features are submitted and merged through our source code management systems. Our procedures prescribe that code enters a production stage only when it is written by one person, and accepted by another person. As many of our features have textual components that need to be translated, or graphical components that may require mirroring or other features when used in Right-to-Left contexts instead of the Left-to-Right context they were developed in, we aim for a mandatory internationalization review, documented in Gerrit, in case code touches any internationalization or localization area. The L10n code review can be partially performed by an automated checker ("MediaWiki i18n linter") to provide quick feedback to developers on often observed i18n/L10n related issues, and partially requires feedback from an interactive. Mandatory review will ensure that fewer i18n and L10n issues will hit production, be it localization or an incorrect display in for example Arabic or Hebrew.
---
On Mon, Oct 7, 2013 at 9:25 PM, S Page spage@wikimedia.org wrote:
This git hook checks that there's a qqq message for every English message. With a little enhancement it could be generalized to most extensions.
Can someone add a test like this to Jenkins? Would it go in < https://git.wikimedia.org/blob/integration%2Fjenkins-job-builder-config.git/...
---------- Forwarded message ---------- From: Erik Bernhardson ebernhardson@wikimedia.org Date: Wed, Oct 2, 2013 at 10:36 AM Subject: [E2] i18n messages To: E2 development team e2@lists.wikimedia.org
I've noticed a recurrence of git reviews about missing i18n documentation, to help solve these up front we could add a hook to git review (or git commit if you prefer) that checks this at a basic level for us.
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, and anytime you do a git review with missing qqq it should say:
git review Custom script execution failed. The following command failed with exit code 255
"/home/guy/Jobs/mediawiki/vagrant/mediawiki/extensions/Flow/.git/hooks/pre-review"
Missing i18n messages: flow-post-action-censor-post
Relatedly, there is a new patch in gerrit to fix that missing message that made it through review.
Erik B.
E2 mailing list E2@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/e2
-- =S Page Features engineer
Mediawiki-i18n mailing list Mediawiki-i18n@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-i18n
I filed https://bugzilla.wikimedia.org/show_bug.cgi?id=55456
As I mention in the bug I had problems running maintenance/language/checkExtensions.php , which seemed another useful starting point.
On Mon, Oct 7, 2013 at 1:20 PM, Siebrand Mazeland (WMF) < smazeland@wikimedia.org> wrote:
I'm very pro this conversation! Especially because it part of an item in my 2013-2014 roadmap for Language Engineering. Everything that I don't have to plan explicitly, and pops up grass root, I support. So +1!
Here's what is in the LangEng engineering roadmap document about this feature:
All Wikimedia website software features are submitted and merged through our source code management systems. Our procedures prescribe that code enters a production stage only when it is written by one person, and accepted by another person. As many of our features have textual components that need to be translated, or graphical components that may require mirroring or other features when used in Right-to-Left contexts instead of the Left-to-Right context they were developed in, we aim for a mandatory internationalization review, documented in Gerrit, in case code touches any internationalization or localization area. The L10n code review can be partially performed by an automated checker ("MediaWiki i18n linter") to provide quick feedback to developers on often observed i18n/L10n related issues, and partially requires feedback from an interactive. Mandatory review will ensure that fewer i18n and L10n issues will hit production, be it localization or an incorrect display in for example Arabic or Hebrew.
On Mon, Oct 7, 2013 at 9:25 PM, S Page spage@wikimedia.org wrote:
This git hook checks that there's a qqq message for every English message. With a little enhancement it could be generalized to most extensions.
Can someone add a test like this to Jenkins? Would it go in < https://git.wikimedia.org/blob/integration%2Fjenkins-job-builder-config.git/...
---------- Forwarded message ---------- From: Erik Bernhardson ebernhardson@wikimedia.org Date: Wed, Oct 2, 2013 at 10:36 AM Subject: [E2] i18n messages To: E2 development team e2@lists.wikimedia.org
I've noticed a recurrence of git reviews about missing i18n documentation, to help solve these up front we could add a hook to git review (or git commit if you prefer) that checks this at a basic level for us.
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, and anytime you do a git review with missing qqq it should say:
git review Custom script execution failed. The following command failed with exit code 255
"/home/guy/Jobs/mediawiki/vagrant/mediawiki/extensions/Flow/.git/hooks/pre-review"
Missing i18n messages: flow-post-action-censor-post
Relatedly, there is a new patch in gerrit to fix that missing message that made it through review.
Erik B.
E2 mailing list E2@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/e2
-- =S Page Features engineer
Mediawiki-i18n mailing list Mediawiki-i18n@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-i18n
-- Siebrand Mazeland Product Manager Language Engineering Wikimedia Foundation
M: +31 6 50 69 1239 Skype: siebrand
Support Free Knowledge: http://wikimediafoundation.org/wiki/Donate
Mediawiki-i18n mailing list Mediawiki-i18n@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-i18n
mediawiki-i18n@lists.wikimedia.org